Package-level declarations
Types
Link copied to clipboard
Represents the state of the channel settings edit dialog.
Link copied to clipboard
class ChannelSettingsViewModel(repository: ChannelSettingsScreenResourceRepository, savedStateHandle: SavedStateHandle) : ViewModel, SendbirdViewModelContract
The ViewModel class used in ChannelSettingsScreen.
Link copied to clipboard
Represents the parameters for ChannelSettingsViewModel.
Functions
Link copied to clipboard
fun ChannelSettingsInfo(title: String, imageModels: List<ImageModel>, modifier: Modifier = Modifier)
Represents the channel settings info that displays the title and the image.
Link copied to clipboard
Represents the channel settings menu to leave the channel.
Link copied to clipboard
Represents the channel settings menu to view the members of the channel.
Link copied to clipboard
fun ChannelSettingsMenu(icon: Painter, iconTint: Color, text: String, modifier: Modifier = Modifier, action: @Composable RowScope.() -> Unit = {})
Represents the channel settings menu that displays the icon, text, and action.
Link copied to clipboard
fun ChannelSettingsNotificationMenu(isChecked: Boolean, modifier: Modifier = Modifier, onCheckedChange: (Boolean) -> Unit = {})
Represents the channel settings menu for the notification settings.
Link copied to clipboard
fun ChannelSettingsScreen(navController: NavController?, channelUrl: String, modifier: Modifier = Modifier, onTopBarNavigationIconClick: () -> Unit = { navController?.popBackStack() }, onTopBarActionClick: (channelSettingsDialogState: ChannelSettingsDialogState) -> Unit = { channelSettingsDialogState ->
channelSettingsDialogState.showChannelEditDialog()
}, onChannelRemoved: (String) -> Unit = {
navController?.popBackStack(SendbirdNavigationRoute.Channels.route, inclusive = false)
}, onMembersMenuClick: () -> Unit = { navController?.navigateToMembers(channelUrl) }, viewModel: ChannelSettingsViewModel = viewModel(
factory = ChannelSettingsViewModel.factory(
ChannelSettingsViewModelParams(channelUrl)
)
), dialogState: ChannelSettingsDialogState = rememberChannelSettingsDialogState(), topBar: @Composable (onNavigationIconClick: () -> Unit, onActionClick: () -> Unit) -> Unit = { onNavigationIconClick, onActionClick ->
ChannelSettingsTopBar(
onNavigationIconClick = onNavigationIconClick,
onActionClick = onActionClick
)
}, loading: @Composable () -> Unit = {
LoadingScreen()
}, failure: @Composable (e: Throwable) -> Unit = { e ->
if (e !is ChannelRemovedException) {
FailurePlaceholder(
onRetryClick = { viewModel.prepare() }
)
}
}, notificationMenu: @Composable (isChecked: Boolean, onCheckedChange: (Boolean) -> Unit) -> Unit = { isChecked, onCheckedChange ->
Column {
ChannelSettingsNotificationMenu(isChecked = isChecked, onCheckedChange = onCheckedChange)
menuDivider()
}
}, membersMenu: @Composable (memberCount: Int, onClick: () -> Unit) -> Unit = { memberCount, onClick ->
Column {
ChannelSettingsMemberMenu(memberCount = memberCount, modifier = Modifier.clickable { onClick() })
menuDivider()
}
}, leaveChannelMenu: @Composable (onClick: () -> Unit) -> Unit = { onClick ->
Column {
ChannelSettingsLeaveChannelMenu(modifier = Modifier.clickable { onClick() })
menuDivider()
}
})
Represents the screen for channel settings.
Link copied to clipboard
fun ChannelSettingsTopBar(modifier: Modifier = Modifier, onNavigationIconClick: () -> Unit = {}, onActionClick: () -> Unit = {}, title: @Composable () -> Unit = {
TopBarTitleText(
stringResource(id = R.string.sb_text_header_channel_settings),
modifier = Modifier.padding(12.dp)
)
}, navigationIcon: @Composable () -> Unit = {
BackButton(onClick = onNavigationIconClick)
}, action: @Composable () -> Unit = {
SendbirdTextButton(
text = stringResource(id = R.string.sb_text_button_edit),
onClick = onActionClick
)
})
The top bar for the ChannelSettingsScreen.
Link copied to clipboard
Creates a ChannelSettingsDialogState that can be remembered across compositions.
Link copied to clipboard
fun SettingsMenu(modifier: Modifier = Modifier, icon: Painter? = null, iconTint: Color = LocalContentColor.current, iconSize: Dp = 24.dp, text: String? = null, textPaddingValues: PaddingValues = PaddingValues(horizontal = 16.dp), action: @Composable RowScope.() -> Unit = {})
Represents the settings menu that displays the icon, text, and action.