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),
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
Parameters
The modifier to be applied to the view.
onTopBarNavigationIconClick
The handler for when the top bar navigation icon is clicked.
The handler for when the top bar action is clicked.
The handler for when a channel item is clicked.
See also