Skip to main content

Screen: LMFeedPostMenuBottomSheetFragment

LMFeedPostMenuBottomSheetFragment provides a bottom sheet menu for performing various actions on a post. It enables users to access functionalities like editing, deleting, sharing, and reporting posts.
GitHub Link to LMFeedPostMenuBottomSheetFragment


View Style:

No view style found in this fragment.


Interactions available in LMFeedPostMenuBottomSheetFragment

  • onPostMenuItemClicked(position: Int, menuItem: LMFeedPostMenuItemViewData): Handles clicks on individual menu items in the post menu.

Usage Example

In this example, we're customizing the following elements of the post menu bottom sheet screen:

  • Click Listeners: Override behavior for like item click.

Steps to customize

Step 1: Create CustomPostMenuBottomSheetFragment

Start by extending LMFeedPostMenuBottomSheetFragment and create a custom class, say CustomPostMenuBottomSheetFragment.

class CustomPostMenuBottomSheetFragment : LMFeedPostMenuBottomSheetFragment() {
// We will override methods in the next step
}

Step 2: Override and Customize Methods

You can customize various aspects of the post menu bottom sheet 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 CustomPostMenuBottomSheetFragment : LMFeedPostMenuBottomSheetFragment() {
}

override fun onPostMenuItemClicked(position: Int, menuItem: LMFeedPostMenuItemViewData) {
super.onPostMenuItemClicked(position, menuItem)

// Write your logic
}
}

Step 3: Pass CustomPostMenuBottomSheetFragment for Navigation

You now need to ensure that your fragment is returned wherever the post menu bottom sheet 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 post menu bottom sheet fragment here
LMFeedCore.setPostMenuBottomSheetListener(CustomPostMenuBottomSheetFragment())