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, SendbirdViewModelContract
The ViewModel class for ChannelsScreen.
Link copied to clipboard
class ChannelsViewModelParams(val queryParams: GroupChannelListQueryParams) : SendbirdViewModelParams
The ViewModel parameters for ChannelsViewModel.
Functions
Link copied to clipboard
Represents a single item in the channel list.
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)
}, viewModel: ChannelsViewModel = viewModel(
factory = ChannelsViewModel.factory(
ChannelsViewModelParams(
queryParams = GroupChannelListQueryParams()
)
)
), dialogState: ChannelsDialogState = rememberChannelsDialogState(), 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 = { viewModel.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,
modifier = Modifier.combinedClickable(
onClick = { onClick(channel) },
onLongClick = { onLongClick(channel) }
)
)
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.