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 Name | Description | Type |
---|---|---|
headerViewStyle | Style for the header of the report screen. | LMFeedHeaderViewStyle |
reportHeaderStyle | Style for the main header text in the report fragment. | LMFeedTextStyle |
reportSubHeaderStyle | Style for the sub-header text. | LMFeedTextStyle |
reportReasonInputStyle | Style for the reason input field. | LMFeedEditTextStyle |
reportButtonStyle | Style for the submit report button. | LMFeedButtonStyle |
reportTagStyle | Style for report tags (quick reasons). | LMFeedTextStyle |
selectedReportTagColor | Color for selected report tags. | Int |
reportSuccessDialogFragmentStyle | Style for the success dialog shown after reporting. | LMFeedAlertDialogViewStyle |
backgroundColor | Background 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.
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())