AI Agent Component Spec
AI Agent Component Spec
Where It Fits
CometChatConversations is a list component. It renders recent conversations and emits the selected Conversation via setOnItemClick. Wire it to CometChatMessageHeader, CometChatMessageList, and CometChatMessageComposer to build a standard chat layout.
- Kotlin
- Java
- XML
ChatActivity.kt
On phones, you’d typically use separate Activities instead of a side-by-side layout — see the Conversation List + Message View getting started guide.
Quick Start
Add the component to your layout XML:layout_activity.xml

CometChatUIKit.init(), a user logged in, and the cometchat-chat-uikit-android dependency added.
To add programmatically in an Activity:
- Kotlin
- Java
YourActivity.kt
- Kotlin
- Java
YourFragment.kt
Filtering Conversations
Pass aConversationsRequest.ConversationsRequestBuilder to setConversationsRequestBuilder. Pass the builder instance — not the result of .build().
- Kotlin
- Java
Filter Recipes
| Recipe | Code |
|---|---|
| Only user conversations | builder.setConversationType(CometChatConstants.CONVERSATION_TYPE_USER) |
| Only group conversations | builder.setConversationType(CometChatConstants.CONVERSATION_TYPE_GROUP) |
| Limit to 10 per page | builder.setLimit(10) |
| With specific tags | builder.setTags(Arrays.asList("vip")) |
| Filter by user tags | builder.withUserAndGroupTags(true); builder.setUserTags(Arrays.asList("premium")) |
| Filter by group tags | builder.withUserAndGroupTags(true); builder.setGroupTags(Arrays.asList("support")) |
Default page size is 30. The component uses infinite scroll — the next page loads as the user scrolls to the bottom. Refer to ConversationsRequestBuilder for the full builder API.
Actions and Events
Callback Methods
setOnItemClick
Fires when a conversation row is tapped. Primary navigation hook — set the active conversation and render the message view.
- Kotlin
- Java
YourActivity.kt
What this does: Replaces the default item-click behavior. When a user taps a conversation, your custom lambda executes instead of the built-in navigation.
setOnItemLongClick
Fires when a conversation row is long-pressed. Use for additional actions like delete or select.
- Kotlin
- Java
YourActivity.kt
What this does: Replaces the default long-press behavior. When a user long-presses a conversation, your custom lambda executes.
setOnBackPressListener
Fires when the user presses the back button in the app bar. Default: navigates to the previous activity.
- Kotlin
- Java
YourActivity.kt
What this does: Overrides the default back-press navigation. When the user taps the back button, your custom logic runs instead.
setOnSelect
Fires when a conversation is checked/unchecked in multi-select mode. Requires setSelectionMode to be set.
- Kotlin
- Java
YourActivity.kt
What this does: Registers a callback that fires when the user selects one or more conversations. The callback receives the list of selected Conversation objects.
setOnError
Fires on internal errors (network failure, auth issue, SDK exception).
- Kotlin
- Java
YourActivity.kt
What this does: Registers an error listener. If the component encounters an error (e.g., network failure), your callback receives the CometChatException.
setOnLoad
Fires when the list is successfully fetched and loaded.
- Kotlin
- Java
YourActivity.kt
What this does: Registers a callback that fires after the conversation list is fetched and rendered. The callback receives the list of loaded Conversation objects.
setOnEmpty
Fires when the list is empty, enabling custom handling such as showing a placeholder.
- Kotlin
- Java
YourActivity.kt
What this does: Registers a callback that fires when the conversation list has no items. Use this to show a custom empty-state message or trigger other logic.
setOnSearchClickListener
Fires when the user taps the search icon in the toolbar.
- Kotlin
- Java
YourActivity.kt
What this does: Overrides the default search icon tap behavior. When the user taps the search icon, your custom logic runs instead.
- Verify: After setting an action callback, trigger the corresponding user interaction (tap, long-press, back, select, search) and confirm your custom logic executes instead of the default behavior.
Global UI Events
CometChatConversationEvents emits events subscribable from anywhere in the application. Add a listener and remove it when no longer needed.
| Event | Fires when | Payload |
|---|---|---|
ccConversationDeleted | A conversation is deleted from the list | Conversation |
- Kotlin
- Java
Add Listener
SDK Events (Real-Time, Automatic)
The component listens to these SDK events internally. No manual attachment needed unless additional side effects are required.| SDK Listener | Internal behavior |
|---|---|
onTextMessageReceived / onMediaMessageReceived / onCustomMessageReceived | Moves conversation to top, updates last message preview and unread count |
onTypingStarted / onTypingEnded | Shows/hides typing indicator in the subtitle |
onMessagesDelivered / onMessagesRead / onMessagesDeliveredToAll / onMessagesReadByAll | Updates receipt ticks (unless setReceiptsVisibility(View.GONE)) |
onUserOnline / onUserOffline | Updates online/offline status dot (unless setUserStatusVisibility(View.GONE)) |
onGroupMemberJoined / onGroupMemberLeft / onGroupMemberKicked / onGroupMemberBanned / onMemberAddedToGroup | Updates group conversation metadata |
Automatic: new messages, typing indicators, receipts, user presence, group membership changes.
Manual: deleting a conversation via the SDK directly (not through the component’s context menu) requires emitting CometChatConversationEvents.ccConversationDeleted for the UI to update.
Functionality
Small functional customizations such as toggling visibility of UI elements, setting custom sounds, and configuring selection modes.| Methods | Description | Code |
|---|---|---|
setBackIconVisibility | Toggles visibility for the back button in the app bar | .setBackIconVisibility(View.VISIBLE); |
setToolbarVisibility | Toggles visibility for the toolbar in the app bar | .setToolbarVisibility(View.GONE); |
setLoadingStateVisibility | Hides the loading state while fetching conversations | .setLoadingStateVisibility(View.GONE); |
setDeleteConversationOptionVisibility | Toggles visibility for the delete option on long press | .setDeleteConversationOptionVisibility(View.GONE); |
setErrorStateVisibility | Hides the error state on fetching conversations | .setErrorStateVisibility(View.GONE); |
setEmptyStateVisibility | Hides the empty state on fetching conversations | .setEmptyStateVisibility(View.GONE); |
setSeparatorVisibility | Controls visibility of separators in the list view | .setSeparatorVisibility(View.GONE); |
setUserStatusVisibility | Controls visibility of the online status indicator | .setUserStatusVisibility(View.GONE); |
setGroupTypeVisibility | Controls visibility of the group type indicator | .setGroupTypeVisibility(View.GONE); |
setReceiptsVisibility | Hides receipts shown in the subtitle without disabling read/delivered marking | .setReceiptsVisibility(View.GONE); |
setSearchBoxVisibility | Controls visibility of the search box in the toolbar | .setSearchBoxVisibility(View.GONE); |
setSearchInputEndIconVisibility | Controls visibility of the end icon in the search bar | .setSearchInputEndIconVisibility(View.GONE); |
hideReceipts | Hides read receipts in the conversation list (adapter-level) | .hideReceipts(true); |
disableSoundForMessages | Disables sound notifications for incoming messages | .disableSoundForMessages(true); |
setCustomSoundForMessages | Sets a custom sound file for incoming message notifications | .setCustomSoundForMessages(com.cometchat.chatuikit.R.raw.cometchat_beep2); |
setSelectionMode | Determines the selection mode (single or multiple) | .setSelectionMode(UIKitConstants.SelectionMode.MULTIPLE); |
setSearchInputText | Sets the text in the search input field | .setSearchInputText("Sample Text"); |
setSearchPlaceholderText | Sets the placeholder text for the search input field | .setSearchPlaceholderText("Enter search term"); |
- Verify: After calling a visibility method, confirm the corresponding UI element is shown or hidden. After calling
disableSoundForMessages(true), confirm no sound plays on incoming messages.
Custom View Slots
Each slot replaces a section of the default UI. Slots that accept aConversation parameter receive the conversation object for that row via the ConversationsViewHolderListener pattern (createView + bindView).
| Slot | Method | Replaces |
|---|---|---|
| Leading view | setLeadingView(ConversationsViewHolderListener) | Avatar / left section |
| Title view | setTitleView(ConversationsViewHolderListener) | Name / title text |
| Subtitle view | setSubtitleView(ConversationsViewHolderListener) | Last message preview |
| Trailing view | setTrailingView(ConversationsViewHolderListener) | Timestamp / badge / right section |
| Item view | setItemView(ConversationsViewHolderListener) | Entire list item row |
| Loading view | setLoadingView(@LayoutRes int) | Loading spinner |
| Empty view | setEmptyView(@LayoutRes int) | Empty state |
| Error view | setErrorView(@LayoutRes int) | Error state |
| Overflow menu | setOverflowMenu(View) | Toolbar menu |
| Options (replace) | setOptions(Function2) | Long-press context menu (replaces defaults) |
| Options (append) | addOptions(Function2) | Long-press context menu (appends to defaults) |
setLeadingView
Replace the avatar / left section. Typing-aware avatar example.
- Kotlin
- Java
What this does: Registers aConversationsViewHolderListenerthat provides a custom view for the leading (left) area of each conversation item.createViewinflates your layout, andbindViewpopulates it with conversation data.

drawable/chat_dots.xml
What this does: Defines a vector drawable of a chat bubble with three dots, used as a typing indicator icon in the custom leading view.Create a
leading_view.xml custom layout:
- Kotlin
- Java
setTrailingView
Replace the timestamp / badge / right section.
- Kotlin
- Java
custom_tail_view.xml custom layout file:
What this does: Defines a custom trailing view layout with aInflate and bind with color-coded time badges:MaterialCardViewcontaining twoTextViewelements for displaying the time value and unit (e.g., “5” and “Min ago”).
- Kotlin
- Java

setTitleView
Replace the name / title text.
- Kotlin
- Java
custom_title_view.xml layout:
custom_title_view.xml
What this does: Defines a custom title layout with the conversation name and an inline user status message.
- Kotlin
- Java
What this does: Registers a ConversationsViewHolderListener that provides a custom title view for each conversation item. The example inflates a layout with the conversation name and an inline user status message. For group conversations, the status is hidden.
setSubtitleView
Replace the last message preview text.
- Kotlin
- Java

- Kotlin
- Java
What this does: Registers aConversationsViewHolderListenerthat provides a custom subtitle view for each conversation item. The example creates aTextViewshowing the last active timestamp formatted as “dd/MM/yyyy, HH:mm:ss”.
setItemView
Replace the entire list item row.
- Kotlin
- Java

item_converation_list.xml custom layout file:
What this does: Defines a custom list item layout with a CometChatAvatar, status indicator, conversation name, and date — providing a compact, single-line conversation item design.
Inflate the XML and bind:
- Kotlin
- Java
What this does: Registers a ConversationsViewHolderListener that replaces the entire list item row. The example inflates a compact layout with an avatar, name, and date — replacing the default multi-line conversation item.
setDateTimeFormatter
Custom date/time formatting for conversation timestamps. Implement the DateTimeFormatterCallback interface to control how each time range is displayed:
| Method | Called when |
|---|---|
time(long timestamp) | Custom full timestamp format |
today(long timestamp) | Message is from today |
yesterday(long timestamp) | Message is from yesterday |
lastWeek(long timestamp) | Message is from the past week |
otherDays(long timestamp) | Message is older than a week |
minute(long timestamp) | Exactly 1 minute ago |
minutes(long diffInMinutesFromNow, long timestamp) | Multiple minutes ago (e.g., “5 minutes ago”) |
hour(long timestamp) | Exactly 1 hour ago |
hours(long diffInHourFromNow, long timestamp) | Multiple hours ago (e.g., “2 hours ago”) |
- Kotlin
- Java
setOptions
Replace the long-press context menu entirely.
Generic signature:
- Kotlin
- Java

- Kotlin
- Java
addOptions
Append to the long-press context menu without removing defaults.
Generic signature:
- Kotlin
- Java

- Kotlin
- Java
setTextFormatters
Custom text formatters for the conversation subtitle. See the MentionsFormatter Guide for details.

themes.xml
- Kotlin
- Java
setLoadingView
Sets a custom loading view displayed when data is being fetched.
- Kotlin
- Java
What this does: Replaces the default loading spinner with your custom layout resource. The custom view displays while conversations are being fetched.
setEmptyView
Configures a custom view displayed when there are no conversations in the list.
- Kotlin
- Java
What this does: Replaces the default empty state with your custom layout resource. The custom view displays when the conversation list has no items.
setErrorView
Defines a custom error state view that appears when an issue occurs while loading conversations.
- Kotlin
- Java
What this does: Replaces the default error state with your custom layout resource. The custom view displays when the component encounters an error during data fetching.
setDateFormat
Customizes the date format used for displaying timestamps in conversations.
Generic signature:
- Kotlin
- Java

- Kotlin
- Java
What this does: Sets the conversation date format to “dd MMM, hh:mm a” (e.g., “10 Jul, 02:30 PM”) using the device’s default locale.
setOverflowMenu
Replace the toolbar overflow menu.
Generic signature:
- Kotlin
- Java

user_profile_popup_menu_layout.xml custom view file:
user_profile_popup_menu_layout.xml
What this does: Defines a popup menu layout with options for creating a conversation, viewing the user profile, logging out, and displaying the app version.Inflate the view and pass it to
setOverflowMenu:
- Kotlin
- Java
What this does: Creates a complete overflow menu implementation. An avatar of the logged-in user is set as the overflow menu view. When tapped, it shows a popup window with options for creating a conversation, viewing the user profile, logging out, and displaying the app version.
- Verify: After setting any custom view slot, confirm the custom view renders in the correct position within the conversation list item, and the data binding populates correctly for each conversation.
Common Patterns
Custom empty state with action button
layout/empty_conversations.xml
- Kotlin
- Java
Hide all chrome — minimal list
- Kotlin
- Java
Filter to user conversations only
- Kotlin
- Java
Advanced Methods
Programmatic Selection
selectConversation
Programmatically selects or deselects a conversation. Works with both SINGLE and MULTIPLE selection modes.
- Kotlin
- Java
InSINGLEmode, selecting a new conversation replaces the previous selection. InMULTIPLEmode, calling this on an already-selected conversation deselects it (toggle behavior).
clearSelection
Clears all selected conversations and resets the selection UI.
- Kotlin
- Java
getSelectedConversations
Returns the list of currently selected Conversation objects.
- Kotlin
- Java
Selected Conversations List
When using multi-select mode, a horizontal list of selected conversations can be shown above the main list.| Method | Type | Description |
|---|---|---|
setSelectedConversationsListVisibility | int (View.VISIBLE / View.GONE) | Show or hide the selected conversations strip |
setSelectedConversationAvatarStyle | @StyleRes int | Avatar style for selected conversation chips |
setSelectedConversationItemTextColor | @ColorInt int | Text color for selected conversation names |
setSelectedConversationItemTextAppearance | @StyleRes int | Text appearance for selected conversation names |
setSelectedConversationItemRemoveIcon | Drawable | Icon for the remove button on each chip |
setSelectedConversationItemRemoveIconTint | @ColorInt int | Tint color for the remove icon |
Search Input Customization
The built-in search box can be customized programmatically:| Method | Type | Description |
|---|---|---|
setSearchInputText | String | Sets the search input text programmatically |
setSearchPlaceholderText | String | Sets the placeholder text for the search input |
setSearchInputTextColor | @ColorInt int | Text color of the search input |
setSearchInputTextAppearance | @StyleRes int | Text appearance of the search input |
setSearchInputPlaceHolderTextColor | @ColorInt int | Placeholder text color |
setSearchInputPlaceHolderTextAppearance | @StyleRes int | Placeholder text appearance |
setSearchInputStartIcon | Drawable | Leading icon in the search box |
setSearchInputStartIconTint | @ColorInt int | Tint for the leading icon |
setSearchInputEndIcon | Drawable | Trailing icon in the search box |
setSearchInputEndIconTint | @ColorInt int | Tint for the trailing icon |
setSearchInputEndIconVisibility | int | Visibility of the trailing icon |
setSearchInputStrokeWidth | @Dimension int | Stroke width of the search box border |
setSearchInputStrokeColor | @ColorInt int | Stroke color of the search box border |
setSearchInputBackgroundColor | @ColorInt int | Background color of the search box |
setSearchInputCornerRadius | @Dimension int | Corner radius of the search box |
Internal Access
These methods provide direct access to internal components for advanced use cases.| Method | Returns | Description |
|---|---|---|
getRecyclerView() | RecyclerView | The underlying RecyclerView displaying conversations |
getViewModel() | ConversationsViewModel | The ViewModel managing conversation data and state |
getConversationsAdapter() | ConversationsAdapter | The adapter powering the RecyclerView |
setAdapter(ConversationsAdapter) | void | Replaces the default adapter with a custom one |
getBinding() | CometchatConversationsListViewBinding | The ViewBinding for the component’s root layout |
Use these only when the standard API is insufficient. Directly manipulating the adapter or ViewModel may conflict with the component’s internal state management.
Other Methods
| Method | Type | Description |
|---|---|---|
setMentionAllLabelId(String id, String mentionAllLabel) | void | Sets the label used for “mention all” in conversation subtitles |
setDateStyle(@StyleRes int) | void | Sets the style for the date label in conversation items |
setOptionListStyle(@StyleRes int) | void | Sets the style for the long-press popup menu |
Style
The component uses XML theme styles. Define a custom style with parentCometChatConversationsStyle in themes.xml, then apply with setStyle().

themes.xml
- Kotlin
- Java
Programmatic Style Properties
In addition to XML theme styles, the component exposes programmatic setters for fine-grained control:| Method | Type | Description |
|---|---|---|
setBackgroundColor | @ColorInt int | Background color of the component |
setBackIconTint | @ColorInt int | Tint color for the back icon |
setBackIcon | Drawable | Custom back icon drawable |
setTitleTextColor | @ColorInt int | Title text color in the toolbar |
setTitleTextAppearance | @StyleRes int | Title text appearance in the toolbar |
setItemTitleTextColor | @ColorInt int | Text color for conversation item titles |
setItemTitleTextAppearance | @StyleRes int | Text appearance for conversation item titles |
setItemSubtitleTextColor | @ColorInt int | Text color for conversation item subtitles |
setItemSubtitleTextAppearance | @StyleRes int | Text appearance for conversation item subtitles |
setItemMessageTypeIconTint | @ColorInt int | Tint for message type icons in subtitles |
setSeparatorColor | @ColorInt int | Color of list item separators |
setSeparatorHeight | @Dimension int | Height of list item separators |
setStrokeColor | @ColorInt int | Stroke color of the component border |
setStrokeWidth | @Dimension int | Stroke width of the component border |
setCornerRadius | @Dimension int | Corner radius of the component |
setEmptyStateTitleTextColor | @ColorInt int | Title text color for the empty state |
setEmptyStateSubtitleTextColor | @ColorInt int | Subtitle text color for the empty state |
setEmptyStateTextTitleAppearance | @StyleRes int | Title text appearance for the empty state |
setEmptyStateTextSubtitleAppearance | @StyleRes int | Subtitle text appearance for the empty state |
setErrorStateTitleTextColor | @ColorInt int | Title text color for the error state |
setErrorStateSubtitleTextColor | @ColorInt int | Subtitle text color for the error state |
setErrorStateTextTitleAppearance | @StyleRes int | Title text appearance for the error state |
setErrorStateTextSubtitleAppearance | @StyleRes int | Subtitle text appearance for the error state |
setDeleteOptionIcon | Drawable | Icon for the delete option in the context menu |
setDeleteOptionIconTint | int | Tint for the delete option icon |
setDeleteOptionTextColor | int | Text color for the delete option |
setDeleteOptionTextAppearance | int | Text appearance for the delete option |
setAvatarStyle | @StyleRes int | Style for conversation avatars |
setStatusIndicatorStyle | @StyleRes int | Style for online/offline status indicators |
setBadgeStyle | @StyleRes int | Style for unread badge counts |
setReceiptStyle | @StyleRes int | Style for read/delivered receipt icons |
setTypingIndicatorStyle | @StyleRes int | Style for typing indicator text |
setMentionsStyle | @StyleRes int | Style for @mention text in subtitles |
setItemBackgroundColor | @ColorInt int | Background color for list items |
setItemSelectedBackgroundColor | @ColorInt int | Background color for selected list items |
Checkbox Style Properties (Selection Mode)
When usingSINGLE or MULTIPLE selection mode, checkboxes appear on each item:
| Method | Type | Description |
|---|---|---|
setCheckBoxStrokeWidth | @Dimension int | Stroke width of the checkbox border |
setCheckBoxCornerRadius | @Dimension int | Corner radius of the checkbox |
setCheckBoxStrokeColor | @ColorInt int | Stroke color of the checkbox border |
setCheckBoxBackgroundColor | @ColorInt int | Background color of unchecked checkbox |
setCheckBoxCheckedBackgroundColor | @ColorInt int | Background color of checked checkbox |
setCheckBoxSelectIcon | Drawable | Icon shown when checkbox is checked |
setCheckBoxSelectIconTint | @ColorInt int | Tint for the checkbox select icon |
setDiscardSelectionIcon | Drawable | Icon for the discard selection button |
setDiscardSelectionIconTint | @ColorInt int | Tint for the discard selection icon |
setSubmitSelectionIcon | Drawable | Icon for the submit selection button |
setSubmitSelectionIconTint | @ColorInt int | Tint for the submit selection icon |
Customization Matrix
| What to change | Where | Property/API | Example |
|---|---|---|---|
| Override behavior on user interaction | Activity/Fragment | setOn<Event> callbacks | setOnItemClick((v, pos, c) -> { ... }) |
| Filter which conversations appear | Activity/Fragment | setConversationsRequestBuilder | setConversationsRequestBuilder(builder) |
| Toggle visibility of UI elements | Activity/Fragment | set<Feature>Visibility(int) | setReceiptsVisibility(View.GONE) |
| Replace a section of the list item | Activity/Fragment | set<Slot>View | setLeadingView(listener) |
| Change colors, fonts, spacing | themes.xml | CometChatConversationsStyle | <item name="cometchatConversationsBadgeStyle">@style/...</item> |
| Avatar style (corner radius, background) | themes.xml | cometchatConversationsAvatarStyle | <item name="cometchatAvatarStrokeRadius">8dp</item> |
| Badge count style (background, text color) | themes.xml | cometchatConversationsBadgeStyle | <item name="cometchatBadgeBackgroundColor">#F76808</item> |
| Apply a custom style | Activity/Fragment | setStyle(int styleRes) | cometChatConversations.setStyle(R.style.CustomConversationsStyle); |
| Back button visibility | Activity/Fragment | setBackIconVisibility(int) | .setBackIconVisibility(View.VISIBLE); |
| Toolbar visibility | Activity/Fragment | setToolbarVisibility(int) | .setToolbarVisibility(View.GONE); |
| Loading state visibility | Activity/Fragment | setLoadingStateVisibility(int) | .setLoadingStateVisibility(View.GONE); |
| Delete option visibility on long press | Activity/Fragment | setDeleteConversationOptionVisibility(int) | .setDeleteConversationOptionVisibility(View.GONE); |
| Error state visibility | Activity/Fragment | setErrorStateVisibility(int) | .setErrorStateVisibility(View.GONE); |
| Empty state visibility | Activity/Fragment | setEmptyStateVisibility(int) | .setEmptyStateVisibility(View.GONE); |
| Separator visibility | Activity/Fragment | setSeparatorVisibility(int) | .setSeparatorVisibility(View.GONE); |
| User online status visibility | Activity/Fragment | setUserStatusVisibility(int) | .setUserStatusVisibility(View.GONE); |
| Group type indicator visibility | Activity/Fragment | setGroupTypeVisibility(int) | .setGroupTypeVisibility(View.GONE); |
| Read/delivered receipts visibility | Activity/Fragment | setReceiptsVisibility(int) | .setReceiptsVisibility(View.GONE); |
| Incoming message sound | Activity/Fragment | disableSoundForMessages(boolean) | .disableSoundForMessages(true); |
| Custom message sound | Activity/Fragment | setCustomSoundForMessages(int) | .setCustomSoundForMessages(R.raw.cometchat_beep2); |
| Selection mode (single/multiple) | Activity/Fragment | setSelectionMode(SelectionMode) | .setSelectionMode(UIKitConstants.SelectionMode.MULTIPLE); |
| Date/time formatting | Activity/Fragment | setDateTimeFormatter(DateTimeFormatterCallback) | See setDateTimeFormatter code above |
| Date format | Activity/Fragment | setDateFormat(SimpleDateFormat) | .setDateFormat(new SimpleDateFormat("dd MMM, hh:mm a", Locale.getDefault())); |
| Long-press options (replace) | Activity/Fragment | setOptions(Function2) | See setOptions code above |
| Long-press options (append) | Activity/Fragment | addOptions(Function2) | See addOptions code above |
| Loading view | Activity/Fragment | setLoadingView(int) | .setLoadingView(R.layout.your_loading_view); |
| Empty view | Activity/Fragment | setEmptyView(int) | .setEmptyView(R.layout.your_empty_view); |
| Error view | Activity/Fragment | setErrorView(int) | .setErrorView(R.layout.your_error_view); |
| Leading view (avatar area) | Activity/Fragment | setLeadingView(ConversationsViewHolderListener) | See setLeadingView code above |
| Title view | Activity/Fragment | setTitleView(ConversationsViewHolderListener) | See setTitleView code above |
| Trailing view | Activity/Fragment | setTrailingView(ConversationsViewHolderListener) | See setTrailingView code above |
| Entire list item | Activity/Fragment | setItemView(ConversationsViewHolderListener) | See setItemView code above |
| Subtitle view | Activity/Fragment | setSubtitleView(ConversationsViewHolderListener) | See setSubtitleView code above |
| Text formatters (mentions) | Activity/Fragment | setTextFormatters(List<CometChatTextFormatter>) | See setTextFormatters code above |
| Overflow menu | Activity/Fragment | setOverflowMenu(View) | cometChatConversations.setOverflowMenu(view); |
| Filter conversations | Activity/Fragment | setConversationsRequestBuilder(ConversationsRequestBuilder) | See Filters code above |
| Search box visibility | Activity/Fragment | setSearchBoxVisibility(int) | .setSearchBoxVisibility(View.GONE); |
| Search input text | Activity/Fragment | setSearchInputText(String) | .setSearchInputText("search term"); |
| Search placeholder text | Activity/Fragment | setSearchPlaceholderText(String) | .setSearchPlaceholderText("Search..."); |
| Search input colors | Activity/Fragment | setSearchInputTextColor, setSearchInputBackgroundColor | .setSearchInputTextColor(Color.BLACK); |
| Search input icons | Activity/Fragment | setSearchInputStartIcon, setSearchInputEndIcon | .setSearchInputStartIcon(drawable); |
| Hide receipts (adapter) | Activity/Fragment | hideReceipts(boolean) | .hideReceipts(true); |
| Programmatic selection | Activity/Fragment | selectConversation(Conversation, SelectionMode) | .selectConversation(conv, SelectionMode.SINGLE); |
| Clear selection | Activity/Fragment | clearSelection() | .clearSelection(); |
| Selected conversations strip | Activity/Fragment | setSelectedConversationsListVisibility(int) | .setSelectedConversationsListVisibility(View.VISIBLE); |
| Selected conversation avatar style | Activity/Fragment | setSelectedConversationAvatarStyle(int) | .setSelectedConversationAvatarStyle(R.style.CustomAvatarStyle); |
| Internal adapter access | Activity/Fragment | getConversationsAdapter() / setAdapter() | Advanced use only |
| Internal ViewModel access | Activity/Fragment | getViewModel() | Advanced use only |
| Mention-all label | Activity/Fragment | setMentionAllLabelId(String, String) | .setMentionAllLabelId("all", "Everyone"); |
Accessibility
The component renders a scrollableRecyclerView of interactive conversation items. Each conversation row responds to tap and long-press gestures. The unread badge count is rendered as a TextView with the count as text content, accessible to TalkBack. Avatar images include the conversation name as content description.
For custom views provided via setLeadingView, setTitleView, setTrailingView, or setItemView, ensure you set android:contentDescription on visual-only elements (status indicators, icons) so TalkBack can announce them. The default views handle this automatically.
Group type indicators and online/offline status dots are visual-only by default. If screen reader descriptions are needed for these, provide them via a custom view with appropriate contentDescription attributes.