MessagesScreen

fun MessagesScreen(viewModelFactory: MessagesViewModelFactory, showHeader: Boolean = true, onBackPressed: () -> Unit = {}, onHeaderTitleClick: (channel: Channel) -> Unit = {}, onChannelAvatarClick: () -> Unit = {}, onComposerLinkPreviewClick: (LinkPreview) -> Unit? = null, skipPushNotification: Boolean = false, skipEnrichUrl: Boolean = false, threadMessagesStart: ThreadMessagesStart = ThreadMessagesStart.BOTTOM, statefulStreamMediaRecorder: StatefulStreamMediaRecorder? = null)

Default root Messages screen component, that provides the necessary ViewModels and connects all the data handling operations, as well as some basic actions, like back pressed handling.

Because this screen can be shown only if there is an active/selected Channel, the user must provide a viewModelFactory that contains the channel ID, in order to load up all the data. Otherwise, we can't show the UI.

Parameters

viewModelFactory

The factory used to build ViewModels and power the behavior. You can customize the behavior of the list through its parameters. For default behavior, simply create an instance and pass in just the channel ID and the context.

showHeader

If we're showing the header or not.

onBackPressed

Handler for when the user taps on the Back button and/or the system back button.

onHeaderTitleClick

Handler for when the user taps on the header section.

onChannelAvatarClick

Handler called when the user taps on the channel avatar.

skipPushNotification

If new messages should skip triggering a push notification when sent. False by default.

skipEnrichUrl

If new messages being sent, or existing ones being updated should skip enriching the URL. If URL is not enriched, it will not be displayed as a link attachment. False by default.

threadMessagesStart

Thread messages start at the bottom or top of the screen. Default: ThreadMessagesStart.BOTTOM.