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) }, viewModelContract: ChannelSettingsViewModelContract = viewModel<ChannelSettingsViewModel>(
factory = ChannelSettingsViewModel.factory(
ChannelSettingsViewModelParams(channelUrl)
)
), dialogState: ChannelSettingsDialogState = rememberChannelSettingsDialogState(), snackbarHostState: SnackbarHostState = remember { SnackbarHostState() }, channelEditBottomSheet: @Composable (ChannelSettingsDialogState) -> Unit = { channelSettingsDialogState ->
ChannelEditBottomSheet(
channelEditBottomSheetContract = DefaultChannelEditBottomSheetContract(channelSettingsDialogState),
onItemClick = { it.onClick() },
onDismissRequest = { channelSettingsDialogState.dismissChannelEditDialog() }
)
}, channelCoverEditDialog: @Composable (CameraCapturerState, ImagePickerState) -> Unit = { cameraCapturerState, imagePickerState ->
ChannelCoverEditDialog(
channelCoverEditDialogContract = DefaultChannelCoverEditDialogContract(cameraCapturerState, imagePickerState),
onItemClick = { it.onClick() },
onDismissRequest = { dialogState.dismissChannelCoverEditDialog() }
)
}, topBar: @Composable (onNavigationIconClick: () -> Unit, onActionClick: () -> Unit) -> Unit = { onNavigationIconClick, onActionClick ->
ChannelSettingsTopBar(
onNavigationIconClick = onNavigationIconClick,
onActionClick = onActionClick
)
}, loading: @Composable () -> Unit = {
LoadingScreen()
}, failure: @Composable (e: Throwable) -> Unit = { e ->
FailurePlaceholder(
onRetryClick = { viewModelContract.prepare() }
)
}, notificationMenu: @Composable (isChecked: Boolean, onCheckedChange: (Boolean) -> Unit) -> Unit = { isChecked, onCheckedChange ->
Column {
ChannelSettingsNotificationMenu(isChecked = isChecked, onCheckedChange = onCheckedChange)
SettingsMenuDivider()
}
}, membersMenu: @Composable (memberCount: Int, onClick: () -> Unit) -> Unit = { memberCount, onClick ->
Column {
ChannelSettingsMemberMenu(memberCount = memberCount, onClick = onClick)
SettingsMenuDivider()
}
}, leaveChannelMenu: @Composable (onClick: () -> Unit) -> Unit = { onClick ->
Column {
ChannelSettingsLeaveChannelMenu(
onClick = onClick
)
SettingsMenuDivider()
}
}) Represents the screen for channel settings.
Since
1.0.0
Parameters
The url of the channel to display the settings for.
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 the channel is removed.
The handler for when the members menu is clicked.
The state of the dialog to display.
The loading composable to be displayed. Defaults to LoadingScreen.
See also