Package-level declarations
Types
Link copied to clipboard
Represents the state of the UserInvitationScreen. This extends UserSelectionState to handle user selection.
Link copied to clipboard
interface UserInvitationTopBarActionContract
The state interface for the top bar action in UserInvitationScreen.
Link copied to clipboard
class UserInvitationViewModel(repository: UserInvitationScreenResourceRepository, savedStateHandle: SavedStateHandle) : ViewModel, UserInvitationViewModelContract
ViewModel class for UserInvitationScreen.
Link copied to clipboard
interface UserInvitationViewModelContract : SendbirdViewModelContract, UserInvitationTopBarActionContract
The ViewModel contract for UserInvitationScreen.
Link copied to clipboard
class UserInvitationViewModelParams @JvmOverloads constructor(val channelUrl: String, val applicationUserListQueryParams: ApplicationUserListQueryParams = ApplicationUserListQueryParams()) : SendbirdViewModelParams
Represents the parameters for the UserInvitationViewModel.
Functions
Link copied to clipboard
Link copied to clipboard
fun UserInvitationScreen(navController: NavController?, channelUrl: String, modifier: Modifier = Modifier, userInvitationScreenState: UserInvitationScreenState = rememberUserInvitationScreenState(), snackbarHostState: SnackbarHostState = remember { SnackbarHostState() }, viewModelContract: UserInvitationViewModelContract = viewModel<UserInvitationViewModel>(
factory = UserInvitationViewModel.factory(
UserInvitationViewModelParams(channelUrl)
)
), onTopBarNavigationIconClick: () -> Unit = { navController?.popBackStack() }, onTopBarActionClick: (UserInvitationScreenState, UserInvitationTopBarActionContract) -> Unit = { state, topBarActionContract ->
topBarActionContract.invite(state.selectedUserIds)
}, onInvited: (channelUrl: String) -> Unit = {
navController?.popBackStack(SendbirdNavigationRoute.Channel(it).route, inclusive = false)
}, onChannelRemoved: (channelUrl: String) -> Unit = {
navController?.popBackStack(SendbirdNavigationRoute.Channels.route, inclusive = false)
}, topBar: @Composable (selectedUserCount: Int, onNavigationIconClick: () -> Unit, onActionClick: () -> Unit) -> Unit = { selectedUserCount, onNavigationIconClick, onActionClick ->
UserInvitationTopBar(
selectedUserCount,
onNavigationIconClick = onNavigationIconClick,
onActionClick = onActionClick
)
}, loading: @Composable () -> Unit = {
LoadingScreen()
}, failure: @Composable (e: Throwable) -> Unit = { e ->
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, isMember: Boolean, onCheckedChange: (user: UikitUser) -> Unit) -> Unit = { user, isSelected, isMember, onCheckedChange ->
UserInvitationItem(
user,
isSelected,
isMember = isMember
) {
onCheckedChange(it)
}
UserItemDivider()
})
Represents the screen for inviting users to a channel.
Link copied to clipboard
fun UserInvitationTopBar(selectedUserCount: Int, modifier: Modifier = Modifier, onNavigationIconClick: () -> Unit = {}, onActionClick: () -> Unit = {}, title: @Composable () -> Unit = {
TopBarTitleText(
stringResource(id = R.string.sb_text_header_invite_member),
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_invite)
} else {
"${stringResource(id = R.string.sb_text_button_invite)} ($selectedUserCount)"
},
onClick = onActionClick,
enabled = selectedUserCount > 0
)
})
The top bar for the UserInvitationScreen.