ChannelsScreen

fun ChannelsScreen(navController: NavController?, modifier: Modifier = Modifier, onTopBarNavigationIconClick: () -> Unit = { navController?.popBackStack() }, onTopBarActionClick: () -> Unit = { navController?.navigateToChannelCreation() }, onChannelItemClick: (channel: UikitGroupChannel) -> Unit = { channel -> navController?.navigateToChannel(channel.channelUrl) }, onChannelItemLongClick: (channel: UikitGroupChannel, channelsDialogState: ChannelsDialogState) -> Unit = { channel, channelsDialogState -> channelsDialogState.showChannelMenuDialog(channel) }, viewModelContract: ChannelsViewModelContract = viewModel<ChannelsViewModel>( factory = ChannelsViewModel.factory() ), channelDialogState: ChannelsDialogState = rememberChannelsDialogState(), snackbarHostState: SnackbarHostState = remember { SnackbarHostState() }, channelsDialog: @Composable (UikitGroupChannel, ChannelsDialogState) -> Unit = { channel, state -> ChannelMenuDialog( channel = channel, channelMenuDialogContract = DefaultChannelMenuDialogContract(channel, viewModelContract), onItemClick = { it.onClick() }, onDismissRequest = { state.dismissChannelMenuDialog() } ) }, topBar: @Composable (onNavigationIconClick: () -> Unit, onActionClick: () -> Unit) -> Unit = { onNavigationIconClick, onActionClick -> ChannelsTopBar( onNavigationIconClick = onNavigationIconClick, onActionClick = onActionClick ) }, loading: @Composable () -> Unit = { LoadingScreen() }, failure: @Composable (e: Throwable) -> Unit = { FailurePlaceholder( onRetryClick = { viewModelContract.prepare() } ) }, empty: @Composable () -> Unit = { ScreenPlaceholder( icon = painterResource(id = R.drawable.icon_chat), text = stringResource(id = R.string.sb_text_channel_list_empty) ) }, channelItem: @Composable (channel: UikitGroupChannel, onClick: (UikitGroupChannel) -> Unit, onLongClick: (UikitGroupChannel) -> Unit) -> Unit = { channel, onClick, onLongClick -> ChannelItem( channel = channel, onClick = onClick, onLongClick = onLongClick ) HorizontalDivider( modifier = Modifier.padding(start = 88.dp), color = MaterialTheme.colorScheme.onBackground.copy(alpha = SendbirdOpacity.ExtraLowOpacity) ) })

Represents the screen for displaying a list of UikitGroupChannels.

Since

1.0.0-beta.1

Parameters

modifier

The modifier to be applied to the view.

onTopBarNavigationIconClick

The handler for when the top bar navigation icon is clicked.

onTopBarActionClick

The handler for when the top bar action is clicked.

onChannelItemClick

The handler for when a channel item is clicked.

onChannelItemLongClick

The handler for when a channel item is long clicked. Defaults to ChannelsDialogState.showChannelMenuDialog.

viewModelContract

The ChannelsViewModelContract to handle the business logic.

channelDialogState

The ChannelsDialogState to handle the menu dialog for a channel.

topBar

The top bar composable. Defaults to ChannelsTopBar.

loading

The loading composable. Defaults to LoadingScreen.

failure

The failure composable. Defaults to FailurePlaceholder.

empty

The empty composable. Defaults to ScreenPlaceholder.

channelItem

The item composable for each channel in LazyColumn. Defaults to ChannelItem.

See also