Channel Creation Screen
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
Parameters
modifier
The modifier to be applied to the view.
channel Creation Screen State
The ChannelCreationScreenState to handle user selection.
view Model Contract
The ChannelCreationViewModelContract to handle the business logic.
on Top Bar Navigation Icon Click
The handler for when the top bar navigation icon is clicked.
on Top Bar Action Click
The handler for when the top bar action is clicked. Defaults to ChannelCreationViewModel.createChannel.
on Channel Created
The handler for when the channel is created.
top Bar
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.
user Item
The item to be shown for each user in LazyColumn. Defaults to ChannelCreationItem.