ChannelCreationScreen

fun ChannelCreationScreen(navController: NavController?, modifier: Modifier = Modifier, channelCreationScreenState: ChannelCreationScreenState = rememberChannelCreationScreenState(), snackbarHostState: SnackbarHostState = remember { SnackbarHostState() }, viewModelContract: ChannelCreationViewModelContract = viewModel<ChannelCreationViewModel>( factory = ChannelCreationViewModel.factory() ), onTopBarNavigationIconClick: () -> Unit = { navController?.popBackStack() }, onTopBarActionClick: (ChannelCreationScreenState, ChannelCreationTopBarActionContract) -> Unit = { state, topBarActionContract -> topBarActionContract.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 = { viewModelContract.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 ) { onCheckedChange(it) } UserItemDivider() })

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.

viewModelContract

The ChannelCreationViewModelContract 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