Skip to main content

Screen: LMFeedReportFragment

The LMFeedReportFragment provides an interface for reporting inappropriate content within the LikeMinds feed system. Users can select or input a reason for reporting and submit it for review.

GitHub Link to LMFeedReportFragment


View Style: LMFeedReportFragmentViewStyle

The LMFeedReportFragmentViewStyle defines the visual style and structure of the fragment. Below are the available customization fields:

Field NameDescriptionType
headerViewStyleStyle for the header of the report screen.LMFeedHeaderViewStyle
reportHeaderStyleStyle for the main header text in the report fragment.LMFeedTextStyle
reportSubHeaderStyleStyle for the sub-header text.LMFeedTextStyle
reportReasonInputStyleStyle for the reason input field.LMFeedEditTextStyle
reportButtonStyleStyle for the submit report button.LMFeedButtonStyle
reportTagStyleStyle for report tags (quick reasons).LMFeedTextStyle
selectedReportTagColorColor for selected report tags.Int
reportSuccessDialogFragmentStyleStyle for the success dialog shown after reporting.LMFeedAlertDialogViewStyle
backgroundColorBackground color for the report fragment.Int

GitHub Link to LMFeedReportFragmentViewStyle


Customization Available in LMFeedReportFragment

Header and Text Customizations

  • customizeReportFragmentHeaderView(headerViewReport: LMFeedHeaderView)
    Customizes the header view of the report fragment.
  • customizeReportHeaderText(tvReportHeader: LMFeedTextView)
    Customizes the main header text in the report screen.
  • customizeReportSubHeaderText(tvReportSubHeader: LMFeedTextView)
    Customizes the sub-header text in the report screen.

Input and Button Customizations

  • customizeReportReasonInput(etReason: LMFeedEditText)
    Customizes the input field for entering a report reason.
  • customizeReportButton(btnPostReport: LMFeedButton)
    Customizes the appearance of the submit report button.

Interactions Available in LMFeedReportFragment

No interaction methods were found for this fragment.


Usage Example

In this example, we're customizing the following elements of the report screen:

  • Header View Appearance: Change the title.
  • Click Listeners: Override behavior for report submission.

Steps to customize

Step 1: Create CustomReportFragment

Start by extending LMFeedReportFragment and create a custom class, say CustomReportFragment.

class CustomReportFragment : LMFeedReportFragment() {
// We will override methods in the next step
}

Step 2: Override and Customize Methods

You can customize various aspects of the report screen by overriding specific functions.

note

If you're providing your own custom layout or binding, you must override all lifecycle functions, especially:

  • onCreateView
  • onViewCreated
  • onResume
  • onPause
  • onDestroyView
class CustomReportFragment : LMFeedReportFragment() {

override fun customizeReportFragmentHeaderView(headerViewReport: LMFeedHeaderView) {
super.customizeReportFragmentHeaderView(headerViewReport)

headerViewReport.setTitleText("Custom Title")
}

override fun onReportSubmitted() {
super.onReportSubmitted()

// Write your logic
}
}

Step 3: Pass CustomReportFragment for Navigation

You now need to ensure that your fragment is returned wherever the report screen is launched.

val application = this
val theme = LMFeedTheme.SOCIAL_FEED
val enablePushNotifications = false
val deviceId = null
val domain = "ENTER YOUR DOMAIN HERE"
val lmFeedCoreCallback = null

LMFeedCore.setup(
application = application,
theme,
enablePushNotifications = enablePushNotifications,
deviceId = deviceId,
domain = domain,
lmFeedCoreCallback = lmFeedCoreCallback
)

// Set your custom report fragment here
LMFeedCore.setReportFragment(CustomReportFragment())