ChannelMediaAttachmentsScreen

fun ChannelMediaAttachmentsScreen(viewModelFactory: ChannelAttachmentsViewModelFactory, modifier: Modifier = Modifier, gridColumnCount: Int? = null, headerKeySelector: (item: ChannelAttachmentsViewState.Content.Item) -> String = ChannelAttachmentsDefaults.HeaderKeySelector, onNavigationIconClick: () -> Unit = {}, onVideoPlaybackError: (error: Throwable) -> Unit = {})

Displays the channel media attachments screen.

This screen includes a top bar, a grid of media attachments, and display a preview screen when an attachment is clicked. The attachments can be images or videos. The screen supports loading more attachments when the user scrolls to the end of the grid. It also supports grouping media items by a header key, which can be customized using the headerKeySelector function.

Parameters

viewModelFactory

The factory to create the ChannelAttachmentsViewModel.

modifier

The modifier for styling.

gridColumnCount

The number of columns in the grid. If null, it will adapt based on the screen size.

headerKeySelector

The function to select the group key for each media item and group them in the grid.

onNavigationIconClick

The callback to be invoked when the navigation icon is clicked.

onVideoPlaybackError

The callback to be invoked when there is an error during video playback.