ChannelCreationScreen

fun ChannelCreationScreen(navController: NavController?, modifier: Modifier = Modifier, channelCreationScreenState: ChannelCreationScreenState = rememberChannelCreationScreenState(), viewModel: ChannelCreationViewModel = viewModel( factory = ChannelCreationViewModel.factory( ChannelCreationViewModelParams() ) ), onTopBarNavigationIconClick: () -> Unit = { navController?.popBackStack() }, onTopBarActionClick: (ChannelCreationScreenState, ChannelCreationViewModel) -> Unit = { state, vm -> vm.createChannel(state.selectedUserIds) }, onChannelCreated: (channel: UikitGroupChannel) -> Unit = { channel -> navController?.popBackStack() navController?.navigateToChannel(channel.channelUrl) }, topBar: @Composable (selectedUserCount: Int, onNavigationIconClick: () -> Unit, onActionClick: () -> Unit) -> Unit = { selectedUserCount, onNavigationIconClick, onActionClick -> ChannelCreationTopBar( selectedUserCount, 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_members), text = stringResource(id = R.string.sb_text_user_list_empty) ) }, userItem: @Composable (user: UikitUser, isSelected: Boolean, onCheckedChange: (user: UikitUser) -> Unit) -> Unit = { user, isSelected, onCheckedChange -> ChannelCreationItem( user, isSelected, modifier = Modifier.clickable { onCheckedChange(user) }, ) { onCheckedChange(it) } HorizontalDivider( modifier = Modifier.padding(start = 68.dp), color = MaterialTheme.colorScheme.onBackground.copy(alpha = SendbirdOpacity.ExtraLowOpacity) ) })

Represents the screen for creating a UikitGroupChannel

Since

1.0.0-beta.1

Parameters

modifier

The modifier to be applied to the view.

channelCreationScreenState

The ChannelCreationScreenState to handle user selection.

viewModel

The ChannelCreationViewModel to handle the business logic.

onTopBarNavigationIconClick

The handler for when the top bar navigation icon is clicked.

onTopBarActionClick

The handler for when the top bar action is clicked. Defaults to ChannelCreationViewModel.createChannel.

onChannelCreated

The handler for when the channel is created.

topBar

The top bar to be shown. Defaults to ChannelCreationTopBar.

loading

The loading screen to be shown. Defaults to LoadingScreen.

failure

The failure screen to be shown. Defaults to FailurePlaceholder.

empty

The empty screen to be shown. Defaults to ScreenPlaceholder.

userItem

The item to be shown for each user in LazyColumn. Defaults to ChannelCreationItem.

See also