Package-level declarations
Types
Link copied to clipboard
Represents the state of the ChannelCreationScreen. This extends UserSelectionState to handle user selection.
Link copied to clipboard
interface ChannelCreationTopBarActionContract
The state interface for the top bar action in ChannelCreationScreen.
Link copied to clipboard
class ChannelCreationViewModel(repository: ChannelCreationScreenResourceRepository, savedStateHandle: SavedStateHandle) : ViewModel, ChannelCreationViewModelContract
ViewModel class for ChannelCreationScreen.
Link copied to clipboard
interface ChannelCreationViewModelContract : SendbirdViewModelContract, ChannelCreationTopBarActionContract
The ViewModel contract for ChannelCreationScreen.
Link copied to clipboard
class ChannelCreationViewModelParams @JvmOverloads constructor(val applicationUserListQueryParams: ApplicationUserListQueryParams = ApplicationUserListQueryParams()) : SendbirdViewModelParams
Represents the parameters for the ChannelCreationViewModel.
Functions
Link copied to clipboard
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
Link copied to clipboard
fun ChannelCreationTopBar(selectedUserCount: Int, modifier: Modifier = Modifier, onNavigationIconClick: () -> Unit = {}, onActionClick: () -> Unit = {}, title: @Composable () -> Unit = {
TopBarTitleText(
stringResource(id = R.string.sb_text_header_create_channel),
modifier = Modifier.padding(12.dp)
)
}, navigationIcon: @Composable () -> Unit = {
BackButton(onClick = onNavigationIconClick)
}, action: @Composable () -> Unit = {
SendbirdTextButton(
text = if (selectedUserCount == 0) {
stringResource(id = R.string.sb_text_button_create)
} else {
"${stringResource(id = R.string.sb_text_button_create)} ($selectedUserCount)"
},
onClick = onActionClick,
enabled = selectedUserCount > 0
)
})
The top bar for the ChannelCreationScreen.
Link copied to clipboard