Package-level declarations

Types

Link copied to clipboard

Visual style for a swipe action slot.

Link copied to clipboard

Coordinates swipe-to-reveal state across multiple channel list items, ensuring only one item is open at a time.

Link copied to clipboard

Represents the state of a swipe-to-reveal action on a channel list item.

Properties

Link copied to clipboard

Provides the SwipeRevealCoordinator to child composables. null means swipe actions are not available in the current composition tree.

Functions

Link copied to clipboard
fun ChannelItem(channelItem: ItemState.ChannelItemState, currentUser: User?, onChannelClick: (Channel) -> Unit, onChannelLongClick: (Channel) -> Unit, modifier: Modifier = Modifier, leadingContent: @Composable RowScope.(ItemState.ChannelItemState) -> Unit = { with(ChatTheme.componentFactory) { ChannelItemLeadingContent( params = ChannelItemLeadingContentParams( channelItem = channelItem, currentUser = currentUser, ), ) } }, centerContent: @Composable RowScope.(ItemState.ChannelItemState) -> Unit = { with(ChatTheme.componentFactory) { ChannelItemCenterContent( params = ChannelItemCenterContentParams( channelItem = channelItem, currentUser = currentUser, ), ) } }, trailingContent: @Composable RowScope.(ItemState.ChannelItemState) -> Unit = { with(ChatTheme.componentFactory) { ChannelItemTrailingContent( params = ChannelItemTrailingContentParams( channelItem = channelItem, currentUser = currentUser, ), ) } })

The basic channel item, that shows the channel in a list and exposes single and long click actions.

Link copied to clipboard
fun ChannelList(modifier: Modifier = Modifier, contentPadding: PaddingValues = PaddingValues(), viewModel: ChannelListViewModel = viewModel( factory = ChannelListViewModelFactory( ChatClient.instance(), QuerySortByField.descByName("last_updated"), filters = null, ), ), lazyListState: LazyListState = rememberLazyListState(), onLastItemReached: () -> Unit = remember(viewModel) { { viewModel.loadMore() } }, onChannelClick: (Channel) -> Unit = {}, onChannelLongClick: (Channel) -> Unit = remember(viewModel) { { viewModel.selectChannel(it) } }, onSearchResultClick: (Message) -> Unit = {}, onStartChatClick: () -> Unit? = null)

Default ChannelList component, that relies on the ChannelListViewModel to load the data and show it on the UI.

fun ChannelList(channelsState: ChannelsState, currentUser: User?, modifier: Modifier = Modifier, contentPadding: PaddingValues = PaddingValues(0.dp), lazyListState: LazyListState = rememberLazyListState(), onLastItemReached: () -> Unit = {}, onChannelClick: (Channel) -> Unit = {}, onChannelLongClick: (Channel) -> Unit = {}, onSearchResultClick: (Message) -> Unit = {}, onStartChatClick: () -> Unit? = null)

Root Channel list component, that represents different UI, based on the current channel state.

Link copied to clipboard

Default swipe actions for a channel list item.

Link copied to clipboard
fun SearchResultItem(searchResultItemState: ItemState.SearchResultItemState, currentUser: User?, modifier: Modifier = Modifier, onSearchResultClick: (Message) -> Unit? = null, leadingContent: @Composable RowScope.(ItemState.SearchResultItemState) -> Unit = { with(ChatTheme.componentFactory) { SearchResultItemLeadingContent( params = SearchResultItemLeadingContentParams(searchResultItem = it, currentUser = currentUser), ) } }, centerContent: @Composable RowScope.(ItemState.SearchResultItemState) -> Unit = { with(ChatTheme.componentFactory) { SearchResultItemCenterContent( params = SearchResultItemCenterContentParams(searchResultItem = it, currentUser = currentUser), ) } }, trailingContent: @Composable RowScope.(ItemState.SearchResultItemState) -> Unit = { with(ChatTheme.componentFactory) { SearchResultItemTrailingContent( params = SearchResultItemTrailingContentParams(searchResultItem = it), ) } })

The basic search result item that show the message and the channel name in a list and expose click actions.

Link copied to clipboard
fun SwipeableChannelItem(channelCid: String, modifier: Modifier = Modifier, enabled: Boolean = true, backgroundColor: Color = Color.Unspecified, swipeActions: @Composable () -> Unit, content: @Composable () -> Unit)

A wrapper that adds swipe-to-reveal actions behind channel list item content.

Link copied to clipboard
fun SwipeActionItem(icon: Painter, label: String, onClick: () -> Unit, style: SwipeActionStyle, modifier: Modifier = Modifier)

A single swipe action button using SwipeActionStyle for slot-based coloring.

fun SwipeActionItem(icon: Painter, label: String, onClick: () -> Unit, backgroundColor: Color, contentColor: Color, modifier: Modifier = Modifier)

A single swipe action button displayed behind a channel list item.