Package-level declarations
Types
Link copied to clipboard
class MembersViewModel(repository: MembersScreenResourceRepository, savedStateHandle: SavedStateHandle) : ViewModel, MembersViewModelContract
ViewModel class for MembersScreen.
Link copied to clipboard
The ViewModel contract for MembersScreen.
Link copied to clipboard
class MembersViewModelParams @JvmOverloads constructor(val channelUrl: String, val queryParams: MemberListQueryParams = MemberListQueryParams()) : SendbirdViewModelParams
Represents the parameters for the MembersViewModel.
Functions
Link copied to clipboard
fun MemberItem(member: UikitMember, modifier: Modifier = Modifier, onClick: (UikitMember) -> Unit = {}, onLongClick: (UikitMember) -> Unit = {})
Represents the member item in the list of members.
Link copied to clipboard
fun MembersScreen(navController: NavController?, channelUrl: String, modifier: Modifier = Modifier, onTopBarNavigationIconClick: () -> Unit = { navController?.popBackStack() }, onTopBarActionClick: () -> Unit = { navController?.navigateToUserInvitation(channelUrl) }, onChannelRemoved: (channelUrl: String) -> Unit = {
navController?.popBackStack(SendbirdNavigationRoute.Channels.route, inclusive = false)
}, onMemberItemClick: (user: UikitMember) -> Unit = {}, onMemberItemLongClick: (user: UikitMember) -> Unit = {}, snackbarHostState: SnackbarHostState = remember { SnackbarHostState() }, viewModelContract: MembersViewModelContract = viewModel<MembersViewModel>(
factory = MembersViewModel.factory(
MembersViewModelParams(
channelUrl = channelUrl
)
)
), topBar: @Composable (onNavigationIconClick: () -> Unit, onActionClick: () -> Unit) -> Unit = { onNavigationIconClick, onActionClick ->
MembersTopBar(
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_empty_no_member)
)
}, memberItem: @Composable (member: UikitMember, onClick: (member: UikitMember) -> Unit, onLongClick: (member: UikitMember) -> Unit) -> Unit = { member, onClick, onLongClick ->
MemberItem(
member,
modifier = Modifier,
onClick = onClick,
onLongClick = onLongClick
)
UserItemDivider()
})
Represents the screen that displays the list of UikitMember in a UikitGroupChannel.
Link copied to clipboard
fun MembersTopBar(modifier: Modifier = Modifier, onNavigationIconClick: () -> Unit = {}, onActionClick: () -> Unit = {}, title: @Composable () -> Unit = {
TopBarTitleText(
stringResource(id = R.string.sb_text_header_member_list),
modifier = Modifier.padding(12.dp)
)
}, navigationIcon: @Composable () -> Unit = {
BackButton(onClick = onNavigationIconClick)
}, action: @Composable () -> Unit = {
SendbirdIconButton(
icon = painterResource(id = R.drawable.icon_plus),
contentDescription = stringResource(id = R.string.sb_view_header_right_button_description),
modifier = Modifier.size(32.dp),
onClick = onActionClick
)
})
Represents the top bar for the MembersScreen.