Skip to main content
CometChatConversations renders a scrollable list of recent conversations with real-time updates for new messages, typing indicators, read receipts, and user presence.

Where It Fits

CometChatConversations is a list component. It renders recent conversations and emits the selected Conversation via onItemClick. Wire it to CometChatMessageHeader, CometChatMessageList, and CometChatMessageComposer to build a standard chat layout.
activity_chat.xml
See the Conversation List + Message View guide for a complete layout.

Quick Start

Add to your layout XML:
Or programmatically:
Prerequisites: CometChat SDK initialized with CometChatUIKit.init(), a user logged in, and the UI Kit dependency added. Or in a Fragment:

Filtering Conversations

Pass a ConversationsRequest.ConversationsRequestBuilder to control what loads:

Filter Recipes

Pass the builder object, not the result of .build(). The component calls .build() internally. Default page size is 30 with infinite scroll.

Actions and Events

Callback Methods

onItemClick

Fires when a conversation row is tapped. Primary navigation hook.
Replaces the default item-click behavior. Your custom lambda executes instead of the built-in navigation.

onItemLongClick

Fires when a conversation row is long-pressed. Use for additional actions like delete or select.

onBackPress

Fires when the user presses the back button in the toolbar.

onSearchClick

Fires when the user taps the search icon in the toolbar.

onSelection

Fires when conversations are selected/deselected in multi-select mode.

onError

Fires on internal errors (network failure, auth issue, SDK exception).

onLoad

Fires when the list is successfully fetched and loaded.

onEmpty

Fires when the list is empty after loading.

Global Events

The component emits events via CometChatEvents that can be subscribed to from anywhere:

SDK Events (Real-Time, Automatic)

The component listens to these SDK events internally. No manual setup needed.

Functionality


Custom View Slots

Leading View

Replace the avatar / left section.

Title View

Replace the name / title text.

Subtitle View

Replace the last message preview.

Trailing View

Replace the timestamp / badge / right section.

State Views

Overflow Menu



Common Patterns

Minimal list — hide all chrome

Users-only conversations

Custom date formatting


Advanced Methods

Programmatic Selection

ViewModel Access

See ViewModel & Data for ListOperations, state observation, and custom repositories.

Style

Define a custom style in themes.xml:
themes.xml

Style Properties

See Component Styling for the full reference.

Next Steps

Conversation List + Message View

Build a full chat layout with this component

Component Styling

Detailed styling reference with screenshots

ViewModel & Data

Custom ViewModels, repositories, and ListOperations

View Slots

Replace specific UI regions across all components