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
class ChannelCreationViewModel(repository: ChannelCreationScreenResourceRepository, savedStateHandle: SavedStateHandle) : ViewModel, SendbirdViewModelContract
ViewModel class 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(), 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
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