fun MentionList(viewModel: MentionListViewModel, modifier: Modifier = Modifier, currentUser: User? = ChatClient.instance().getCurrentUser(), onItemClick: (message: Message) -> Unit? = null, onEvent: (event: Any) -> Unit = {}, pullToRefreshEnabled: Boolean = true, itemContent: @Composable LazyItemScope.(MessageResult) -> Unit = { mention ->
with(ChatTheme.componentFactory) {
MentionListItem(
mention = mention,
modifier = Modifier,
currentUser = currentUser,
onClick = onItemClick,
)
}
}, loadingIndicator: @Composable BoxScope.() -> Unit = {
with(ChatTheme.componentFactory) {
MentionListLoadingIndicator(
modifier = Modifier,
)
}
}, emptyContent: @Composable BoxScope.() -> Unit = {
with(ChatTheme.componentFactory) {
MentionListEmptyContent(
modifier = Modifier,
)
}
}, loadingItemContent: @Composable LazyItemScope.() -> Unit = {
with(ChatTheme.componentFactory) {
MentionListLoadingItem(
modifier = Modifier,
)
}
}, pullToRefreshIndicator: @Composable BoxScope.(pullToRefreshState: PullToRefreshState, isRefreshing: Boolean) -> Unit = { pullToRefreshState, isRefreshing ->
if (pullToRefreshEnabled) {
with(ChatTheme.componentFactory) {
MentionListPullToRefreshIndicator(
modifier = Modifier,
pullToRefreshState = pullToRefreshState,
isRefreshing = isRefreshing,
)
}
}
}) The default stateful component that is bound to MentionListViewModel to display a list of mentions for the current user.
Parameters
The modifier to apply to this layout.
The current user to use for the mentions.
The callback to be called when an item is clicked.
If true, the pull-to-refresh functionality is enabled. Defaults to true.
The content displayed by a single item.
The content displayed during the initial loading.
The content displayed when the list is empty.
The content displayed when loading more items.
The custom indicator to be displayed during the pull-to-refresh action.
See also
fun MentionList(state: MentionListState, modifier: Modifier = Modifier, currentUser: User? = ChatClient.instance().getCurrentUser(), onItemClick: (message: Message) -> Unit? = null, onLoadMore: () -> Unit = {}, pullToRefreshEnabled: Boolean = true, onRefresh: () -> Unit = {}, itemContent: @Composable LazyItemScope.(MessageResult) -> Unit = { mention ->
with(ChatTheme.componentFactory) {
MentionListItem(
mention = mention,
modifier = Modifier,
currentUser = currentUser,
onClick = onItemClick,
)
}
}, loadingIndicator: @Composable BoxScope.() -> Unit = {
with(ChatTheme.componentFactory) {
MentionListLoadingIndicator(
modifier = Modifier,
)
}
}, emptyContent: @Composable BoxScope.() -> Unit = {
with(ChatTheme.componentFactory) {
MentionListEmptyContent(
modifier = Modifier,
)
}
}, loadingItemContent: @Composable LazyItemScope.() -> Unit = {
with(ChatTheme.componentFactory) {
MentionListLoadingItem(
modifier = Modifier,
)
}
}, pullToRefreshIndicator: @Composable BoxScope.(pullToRefreshState: PullToRefreshState, isRefreshing: Boolean) -> Unit = { pullToRefreshState, isRefreshing ->
if (pullToRefreshEnabled) {
with(ChatTheme.componentFactory) {
MentionListPullToRefreshIndicator(
modifier = Modifier,
pullToRefreshState = pullToRefreshState,
isRefreshing = isRefreshing,
)
}
}
}) The default stateless component that displays a list of mentions for the current user.
This component is useful when you want to manage the state of the list yourself.
Parameters
The state of the list to display.
The modifier to apply to this layout.
The current user to use for the mentions.
The callback to be called when an item is clicked.
The callback to be called when more items should be loaded.
If true, the pull-to-refresh functionality is enabled. Defaults to true.
The callback to be invoked when the user performs a pull-to-refresh action.
The content displayed by a single item.
The content displayed during the initial loading.
The content displayed when the list is empty.
The content displayed when loading more items.
The custom indicator to be displayed during the pull-to-refresh action.