Package-level declarations

Types

Link copied to clipboard

Represents the state of the menu dialog in the ChannelsScreen when a channel is long clicked.

Link copied to clipboard
class ChannelsViewModel(repository: ChannelsScreenResourceRepository, savedStateHandle: SavedStateHandle) : ViewModel, ChannelsViewModelContract

The ViewModel class for ChannelsScreen.

Link copied to clipboard
Link copied to clipboard
class ChannelsViewModelParams @JvmOverloads constructor(val queryParams: GroupChannelListQueryParams = GroupChannelListQueryParams()) : SendbirdViewModelParams

The ViewModel parameters for ChannelsViewModel.

Link copied to clipboard

Represents the contract for the channel menu dialog in the ChannelsScreen.

Functions

Link copied to clipboard
fun ChannelItem(channel: UikitGroupChannel, modifier: Modifier = Modifier, onClick: (UikitGroupChannel) -> Unit = {}, onLongClick: (UikitGroupChannel) -> Unit = {})

Represents a single item in the channel list.

Link copied to clipboard
fun ChannelMenuDialog(channel: UikitGroupChannel, channelMenuDialogContract: ChannelMenuDialogContract, modifier: Modifier = Modifier, menus: @Composable (UikitGroupChannel, ChannelMenuDialogContract) -> List<DialogMenuDetail> = { groupChannel, contract -> SendbirdDialogDefaults.channelsMenuItems(channel = groupChannel, contract = contract) }, onItemClick: (DialogMenuDetail) -> Unit = { it.onClick() }, onDismissRequest: () -> Unit = {})

Represents the dialog for the channel menu in the ChannelsScreen.

Link copied to clipboard
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.

Link copied to clipboard
fun ChannelsTopBar(modifier: Modifier = Modifier, onNavigationIconClick: () -> Unit = {}, onActionClick: () -> Unit = {}, title: @Composable () -> Unit = { TopBarTitleText( stringResource(id = R.string.sb_text_header_channel_list), modifier = Modifier.padding(12.dp) ) }, navigationIcon: @Composable () -> Unit = { BackButton(onClick = onNavigationIconClick) }, action: @Composable () -> Unit = { SendbirdIconButton( icon = painterResource(id = R.drawable.icon_create), contentDescription = stringResource(id = R.string.sb_view_header_right_button_description), modifier = modifier.size(32.dp), onClick = onActionClick ) })

The top bar for the ChannelsScreen.

Link copied to clipboard

Creates a ChannelsDialogState that can be remembered across compositions.