AI Agent Component Spec
AI Agent Component Spec
Where It Fits
CometChatMessageList is a message display component. It requires either a User or Group object to fetch and render messages. Wire it with CometChatMessageHeader and CometChatMessageComposer to build a complete messaging layout.
- Kotlin
- Java
ChatActivity.kt
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.
Set a User or Group object in your Activity:
- Kotlin
- Java
YourActivity.kt
.setGroup(group) with a Group object instead of .setUser(user).
Filtering Messages
Pass aMessagesRequest.MessagesRequestBuilder to setMessagesRequestBuilder. Pass the builder instance — not the result of .build().
- Kotlin
- Java
Filter Recipes
| Recipe | Code |
|---|---|
| Search by keyword | builder.setSearchKeyword("hello") |
| Filter by UID | builder.setUID("user_uid") |
| Filter by GUID | builder.setGUID("group_guid") |
| Limit per page | builder.setLimit(30) |
| Filter by category | builder.setCategory("message") |
| Filter by type | builder.setType("text") |
| Unread only | builder.setUnread(true) |
| Hide deleted messages | builder.hideDeletedMessages(true) |
The following parameters in
MessagesRequestBuilder will always be altered inside the message list:- UID
- GUID
- types
- categories
The component uses infinite scroll — older messages load as the user scrolls up. Refer to MessagesRequestBuilder for the full builder API.
Reactions Request Builder
UsesetReactionsRequestBuilder to customize how reactions are fetched:
- Kotlin
- Java
Actions and Events
Callback Methods
setOnThreadRepliesClick
Fires when a user taps a threaded message bubble. No predefined behavior.
- Kotlin
- Java
YourActivity.kt
What this does: Registers a callback that fires when a user taps a threaded message bubble. The callback receives thecontext, thebaseMessage, and thecometchatMessageTemplate.
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 message list is fetched and rendered. The callback receives the list of loaded BaseMessage 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 message list has no items. Use this to show a custom empty-state message or trigger other logic.
setOnReactionClick
Fires when a reaction is tapped, enabling custom reaction interactions.
- Kotlin
- Java
YourActivity.kt
What this does: Replaces the default reaction-click behavior. When a user taps a reaction, your custom lambda executes with theemojiandbaseMessage.
setOnReactionLongClick
Fires when a user long-presses on a reaction pill.
- Kotlin
- Java
YourActivity.kt
What this does: Replaces the default reaction long-press behavior. When a user long-presses a reaction pill, your custom lambda executes with theemojiandbaseMessage.
setOnAddMoreReactionsClick
Fires when a user clicks the “Add More Reactions” button.
- Kotlin
- Java
YourActivity.kt
What this does: Replaces the default “Add More Reactions” button behavior. Your callback receives the baseMessage that the user wants to react to.
setOnReactionListItemClick
Fires when a reaction list item is clicked in CometChatReactionsList.
- Kotlin
- Java
YourActivity.kt
What this does: Replaces the default reaction list item click behavior. Your callback receives thereactionandmessageobjects.
- Verify: After setting an action callback, trigger the corresponding user interaction (thread reply tap, reaction click, reaction long-press) and confirm your custom logic executes instead of the default behavior.
Global UI Events
The MessageList component does not emit any global UI events of its own.SDK Events (Real-Time, Automatic)
The component listens to SDK message events internally. No manual attachment needed unless additional side effects are required.Automatic: new messages, edits, deletions, and reactions update the list in real time.
Functionality
Small functional customizations such as toggling visibility of UI elements, setting custom sounds, configuring alignment, and enabling AI features.- Kotlin
- Java

| Method | Description | Code |
|---|---|---|
setUser | Sets the user object to fetch messages for a one-on-one conversation | .setUser(user); |
setGroup | Sets the group object to fetch messages for a group conversation | .setGroup(group); |
setMessageAlignment | Sets the alignment of messages (leftAligned or standard) | .setMessageAlignment(UIKitConstants.MessageListAlignment.STANDARD); |
setErrorStateVisibility | Toggles visibility of the error state | .setErrorStateVisibility(View.GONE); |
disableSoundForMessages | Enables/disables sound for incoming/outgoing messages, default false | .disableSoundForMessages(false); |
setCustomSoundForMessages | Sets a custom sound for outgoing messages | .setCustomSoundForMessages(@RawRes resource); |
setAvatarVisibility | Toggles visibility for avatar | .setAvatarVisibility(View.GONE); |
scrollToBottomOnNewMessage | If true, scrolls to bottom on new message. Default is false | .scrollToBottomOnNewMessage(true); |
setReceiptsVisibility | Controls visibility of read receipts without disabling marking messages as read/delivered | .setReceiptsVisibility(View.GONE); |
setQuickReactions | Replaces the predefined set of quick reactions | .setQuickReactions(Arrays.asList("👻","😈","🙀","🤡","❤️")); |
setStickyDateVisibility | Toggles visibility for sticky date header | .setStickyDateVisibility(View.GONE); |
setReplyInThreadOptionVisibility | Toggles visibility for thread reply option | .setReplyInThreadOptionVisibility(View.GONE); |
setTranslateMessageOptionVisibility | Toggles visibility for translate option | .setTranslateMessageOptionVisibility(View.GONE); |
setEditMessageOptionVisibility | Toggles visibility for edit option | .setEditMessageOptionVisibility(View.GONE); |
setDeleteMessageOptionVisibility | Toggles visibility for delete option | .setDeleteMessageOptionVisibility(View.GONE); |
setMessageReactionOptionVisibility | Toggles visibility for reaction option | .setMessageReactionOptionVisibility(View.GONE); |
setMessagePrivatelyOptionVisibility | Toggles visibility for private message option | .setMessagePrivatelyOptionVisibility(View.GONE); |
setCopyMessageOptionVisibility | Toggles visibility for copy option | .setCopyMessageOptionVisibility(View.GONE); |
setMessageInfoOptionVisibility | Toggles visibility for info option | .setMessageInfoOptionVisibility(View.GONE); |
setGroupActionMessageVisibility | Toggles visibility for group action messages | .setGroupActionMessageVisibility(View.GONE); |
setReplyOptionVisibility | Toggles visibility for the reply option in the action sheet | .setReplyOptionVisibility(View.GONE); |
setShareMessageOptionVisibility | Toggles visibility for the share message option | .setShareMessageOptionVisibility(View.GONE); |
setMarkAsUnreadOptionVisibility | Toggles visibility for the mark-as-unread option | .setMarkAsUnreadOptionVisibility(View.GONE); |
setFlagOptionVisibility | Toggles visibility for the flag/report option | .setFlagOptionVisibility(View.GONE); |
setModerationViewVisibility | Toggles visibility for the moderation view | .setModerationViewVisibility(View.GONE); |
setSwipeToReplyEnabled | Enables or disables swipe-to-reply gesture. Default is true | .setSwipeToReplyEnabled(false); |
setStartFromUnreadMessages | When true, scrolls to the first unread message on load | .setStartFromUnreadMessages(true); |
setEnableConversationSummary | Controls whether AI conversation summary is generated for conversations with many unread messages | .setEnableConversationSummary(true); |
setEnableConversationStarter | Controls whether conversation starters are generated in new conversations | .setEnableConversationStarter(true); |
setEnableSmartReplies | Enables smart replies for quick responses | .setEnableSmartReplies(true); |
setAISmartRepliesKeywords | Defines keywords in incoming messages that trigger Smart Replies | .setAISmartRepliesKeywords(Arrays.asList("hello", "hi")); |
setSmartRepliesDelayDuration | Sets the delay before Smart Replies are fetched after a message is received | .setSmartRepliesDelayDuration(5000); |
setUnreadMessageThreshold | Sets the threshold for unread messages before triggering conversation summary | .setUnreadMessageThreshold(10); |
setFlagRemarkInputFieldVisibility | Toggles visibility for the remark input field in the flag/report dialog | .setFlagRemarkInputFieldVisibility(View.GONE); |
setFlagReasonLocalization | Sets localization map for flag/report reason labels | .setFlagReasonLocalization(map); |
setStreamingSpeed | Sets the streaming speed for AI-generated content | .setStreamingSpeed(100); |
refreshStyle | Refreshes the style of the message list | .refreshStyle(); |
- 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.| Slot | Method | Replaces |
|---|---|---|
| Header view | setHeaderView(View) | Custom view above the message list |
| Footer view | setFooterView(View) | Custom view below the message list |
| Loading view | setLoadingStateView(@LayoutRes int) | Loading spinner |
| Empty view | setEmptyStateView(@LayoutRes int) | Empty state |
| Error view | setErrorStateView(@LayoutRes int) | Error state |
| New message indicator | setNewMessageIndicatorView(View) | New message indicator |
| AI greeting view | setAIAssistantEmptyChatGreetingView(@LayoutRes int) | AI assistant empty chat greeting |
| Message templates | setTemplates(List<CometChatMessageTemplate>) | Message bubble templates |
| Text formatters | setTextFormatters(List<CometChatTextFormatter>) | Text formatters (mentions, etc.) |
setHeaderView
Sets a custom header view displayed at the top of the message list.

custom_header_layout.xml layout:
custom_header_layout.xml
What this does: Defines a custom header layout with three pill-shaped buttons: “Notes”, “Pinned Messages”, and “Saved Links”. Each button uses a MaterialCardView with an icon and label styled with the primary color.
- Kotlin
- Java
What this does: Inflates the custom_header_layout.xml and sets it as the header view of the message list. The three pill buttons display above the messages.
setFooterView
Sets a custom footer view displayed at the bottom of the message list.

custom_footer_layout.xml
What this does: Defines a custom footer layout with three pill-shaped buttons: “Notes”, “Pinned Messages”, and “Saved Links”. Each button uses a MaterialCardView with an icon and label styled with the primary color.
- Kotlin
- Java
What this does: Inflates the custom_footer_layout.xml and sets it as the footer view of the message list. The three pill buttons display below the messages.
setLoadingStateView
Customizes the loading indicator when messages are being fetched.
- Kotlin
- Java
What this does: Replaces the default loading spinner with your custom layout resource. The custom view displays while messages are being fetched.
setEmptyStateView
Defines a custom view displayed when no messages are available.
- Kotlin
- Java
What this does: Replaces the default empty state with your custom layout resource. The custom view displays when the message list has no items.
setErrorStateView
Custom error state view displayed when fetching messages fails.
- 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 message fetching.
setNewMessageIndicatorView
Replaces the default “new messages” indicator that appears when new messages arrive while the user has scrolled up.
- Kotlin
- Java
YourActivity.kt
What this does: Replaces the default new message indicator with a custom layout. The indicator appears when new messages arrive while the user is scrolled up in the message list.
setTemplates
CometChatMessageTemplate is a pre-defined structure for creating message views (message bubbles). For more information, refer to CometChatMessageTemplate.
setTextFormatters
Assigns the list of text formatters. If the provided list is not null, it sets the list. Otherwise, it assigns the default text formatters retrieved from the data source. To configure the existing Mentions look and feel check out MentionsFormatter Guide.

themes.xml
What this does: Defines custom mention styles for incoming and outgoing message bubbles. Incoming mentions appear in pink (#D6409F) and outgoing mentions appear in white (#FFFFFF), both with green self-mentions (#30A46C).
- Kotlin
- Java
What this does: Creates a CometChatMentionsFormatter, applies custom outgoing and incoming mention styles, adds it to a list of text formatters, and passes that list to the message list component. Mentions in message bubbles render with the custom colors.
setDateFormat
Specifies a custom format for displaying sticky date separators in the chat.
- Kotlin
- Java
What this does: Sets the sticky date separator format to “MMM dd, yyyy” (e.g., “Jul 10, 2024”) using the device’s default locale.
setTimeFormat
Defines the format in which time appears for each message bubble.
- Kotlin
- Java
What this does: Sets the message bubble time format to “hh:mm a” (e.g., “02:30 PM”) using the device’s default locale.
setDateTimeFormatter
Provides a custom implementation of DateTimeFormatterCallback to configure how time and date values are displayed. Each method corresponds to a specific case:
time(long timestamp)— Custom full timestamp formattoday(long timestamp)— Called when a message is from todayyesterday(long timestamp)— Called for yesterday’s messageslastWeek(long timestamp)— Messages from the past weekotherDays(long timestamp)— Older messagesminutes(long diffInMinutesFromNow, long timestamp)— e.g., “5 minutes ago”hours(long diffInHourFromNow, long timestamp)— e.g., “2 hours ago”
- Kotlin
- Java
What this does: Overrides the default date/time formatting for message timestamps. Today’s messages show “Today”, yesterday’s show “Yesterday”, recent messages show “X mins ago” or “X hrs ago”, last week’s show “Last Week”, and older messages show the full date in “dd MMM yyyy” format.
- Verify: After setting any custom view slot, confirm the custom view renders in the correct position within the message list, and the data binding populates correctly.
Common Patterns
Hide all chrome — minimal message list
- Kotlin
- Java
Hide all message action options
- Kotlin
- Java
Enable AI features
- Kotlin
- Java
Custom quick reactions
- Kotlin
- Java
Start from unread messages
- Kotlin
- Java
Advanced Methods
Scroll and Navigation
scrollToBottom
Programmatically scrolls to the bottom of the message list.
- Kotlin
- Java
scrollToMessageId
Scrolls to a specific message by its ID and highlights it.
- Kotlin
- Java
gotoMessage
Navigates to a specific message by ID.
- Kotlin
- Java
Message Manipulation
addMessage
Programmatically adds a message to the list.
- Kotlin
- Java
setList
Replaces the entire message list with a new list.
- Kotlin
- Java
updateMessage
Updates a message at a given index.
- Kotlin
- Java
Threaded Messages
setParentMessage
Sets the parent message ID for threaded message view.
- Kotlin
- Java
AI Features
generateConversationSummary
Triggers the generation of a conversation summary by fetching it from the ViewModel.
- Kotlin
- Java
setAIAssistantSuggestedMessages
Sets suggested messages for the AI assistant.
- Kotlin
- Java
setAiAssistantTools
Registers custom AI assistant tool call listeners.
- Kotlin
- Java
Bubble Margins
| Method | Description |
|---|---|
setLeftBubbleMargin(top, bottom, left, right) | Sets margins for incoming (left) message bubbles |
setRightBubbleMargin(top, bottom, left, right) | Sets margins for outgoing (right) message bubbles |
setBubbleMargin(top, bottom, left, right) | Sets margins for all message bubbles |
Internal Access
These methods provide direct access to internal components for advanced use cases.| Method | Returns | Description |
|---|---|---|
getAdapter() | MessageAdapter | The adapter powering the RecyclerView |
setAdapter(MessageAdapter) | void | Replaces the default adapter with a custom one |
getViewModel() | MessageListViewModel | The ViewModel managing message data and state |
getRecyclerView() | RecyclerView | The internal RecyclerView |
getView() | LinearLayout | The root view of the component |
getNewMessageLayout() | MaterialCardView | The new message indicator layout |
getNewMessageImageView() | ImageView | The new message indicator image |
getStickyHeaderDecoration() | StickyHeaderDecoration | The sticky date header decoration |
getParentMessageId() | long | The parent message ID for threaded view |
getMentionsFormatter() | CometChatMentionsFormatter | The mentions formatter instance |
atBottom() | boolean | Whether the list is scrolled to the bottom |
isHasMore() | boolean | Whether more messages are available to load |
setAutoFetch(boolean) | void | Controls automatic message fetching |
setMentionAllLabelId(String, String) | void | Sets the mention-all label ID and display text |
Use these only when the standard API is insufficient. Directly manipulating the adapter or ViewModel may conflict with the component’s internal state management.
Style
The component uses XML theme styles. Define a custom style with parentCometChatMessageListStyle in themes.xml, then apply with setStyle().

themes.xml
What this does: Defines two custom styles:CustomOutgoingMessageBubbleStylesets the outgoing message bubble background to orange (#F76808);CustomCometChatMessageListStylesets the message list background to light peach (#FEEDE1) and applies the custom outgoing bubble style.
- Kotlin
- Java
Programmatic Style Properties
In addition to XML theme styles, the component exposes programmatic setters for fine-grained control:| Method | Type | Description |
|---|---|---|
setIncomingMessageBubbleStyle | @StyleRes int | Style for incoming message bubbles |
setOutgoingMessageBubbleStyle | @StyleRes int | Style for outgoing message bubbles |
setDateSeparatorStyle | @StyleRes int | Style for date separator headers |
setDeleteDialogStyle | @StyleRes int | Style for the delete confirmation dialog |
setMessageInformationStyle | @StyleRes int | Style for the message information sheet |
setMessageOptionSheetStyle | @StyleRes int | Style for the message option action sheet |
setReactionListStyle | @StyleRes int | Style for the reaction list bottom sheet |
setModerationViewStyle | @StyleRes int | Style for the moderation view |
setFlagMessageStyle | @StyleRes int | Style for the flag/report message dialog |
setBadgeStyle | @StyleRes int | Style for the unread message badge |
setAISmartRepliesStyle | @StyleRes int | Style for AI smart replies |
setAIConversationStarterStyle | @StyleRes int | Style for AI conversation starters |
setAIConversationSummaryStyle | @StyleRes int | Style for AI conversation summary |
setErrorStateTitleTextColor | @ColorInt int | Title text color for the error state |
setErrorStateTitleTextAppearance | @StyleRes int | Title text appearance for the error state |
setErrorStateSubtitleTextColor | @ColorInt int | Subtitle text color for the error state |
setErrorStateSubtitleTextAppearance | @StyleRes int | Subtitle text appearance for the error state |
setNewMessageIndicatorIconTint | @ColorInt int | Tint color for the new message indicator icon |
setAddReactionIcon | int | Custom icon for the add reaction button |
Customization Matrix
| What to change | Where | Property/API | Example |
|---|---|---|---|
| Override behavior on user interaction | Activity/Fragment | setOn<Event> callbacks | setOnThreadRepliesClick((ctx, msg, tpl) -> { ... }) |
| Filter which messages appear | Activity/Fragment | setMessagesRequestBuilder | setMessagesRequestBuilder(builder) |
| Customize reactions fetching | Activity/Fragment | setReactionsRequestBuilder | setReactionsRequestBuilder(builder) |
| Toggle visibility of UI elements | Activity/Fragment | set<Feature>Visibility(int) | setReceiptsVisibility(View.GONE) |
| Replace header/footer views | Activity/Fragment | setHeaderView / setFooterView | setHeaderView(view) |
| Change colors, fonts, spacing | themes.xml | CometChatMessageListStyle | <item name="cometchatMessageListBackgroundColor">#FEEDE1</item> |
| Outgoing bubble style | themes.xml | cometchatMessageListOutgoingMessageBubbleStyle | <item name="cometchatMessageBubbleBackgroundColor">#F76808</item> |
| Apply a custom style | Activity/Fragment | setStyle(int styleRes) | cometChatMessageList.setStyle(R.style.CustomCometChatMessageListStyle); |
| Set user for messages | Activity/Fragment | setUser(User) | .setUser(user); |
| Set group for messages | Activity/Fragment | setGroup(Group) | .setGroup(group); |
| Message alignment | Activity/Fragment | setMessageAlignment(UIKitConstants.MessageListAlignment) | .setMessageAlignment(UIKitConstants.MessageListAlignment.STANDARD); |
| Error state visibility | Activity/Fragment | setErrorStateVisibility(int) | .setErrorStateVisibility(View.GONE); |
| Incoming/outgoing message sound | Activity/Fragment | disableSoundForMessages(boolean) | .disableSoundForMessages(true); |
| Custom message sound | Activity/Fragment | setCustomSoundForMessages(int) | .setCustomSoundForMessages(@RawRes resource); |
| Avatar visibility | Activity/Fragment | setAvatarVisibility(int) | .setAvatarVisibility(View.GONE); |
| Scroll to bottom on new message | Activity/Fragment | scrollToBottomOnNewMessage(boolean) | .scrollToBottomOnNewMessage(true); |
| Read/delivered receipts visibility | Activity/Fragment | setReceiptsVisibility(int) | .setReceiptsVisibility(View.GONE); |
| Quick reactions list | Activity/Fragment | setQuickReactions(List) | .setQuickReactions(Arrays.asList("👻","😈","🙀","🤡","❤️")); |
| Sticky date visibility | Activity/Fragment | setStickyDateVisibility(int) | .setStickyDateVisibility(View.GONE); |
| Thread reply option visibility | Activity/Fragment | setReplyInThreadOptionVisibility(int) | .setReplyInThreadOptionVisibility(View.GONE); |
| Translate option visibility | Activity/Fragment | setTranslateMessageOptionVisibility(int) | .setTranslateMessageOptionVisibility(View.GONE); |
| Edit option visibility | Activity/Fragment | setEditMessageOptionVisibility(int) | .setEditMessageOptionVisibility(View.GONE); |
| Delete option visibility | Activity/Fragment | setDeleteMessageOptionVisibility(int) | .setDeleteMessageOptionVisibility(View.GONE); |
| Reaction option visibility | Activity/Fragment | setMessageReactionOptionVisibility(int) | .setMessageReactionOptionVisibility(View.GONE); |
| Private message option visibility | Activity/Fragment | setMessagePrivatelyOptionVisibility(int) | .setMessagePrivatelyOptionVisibility(View.GONE); |
| Copy option visibility | Activity/Fragment | setCopyMessageOptionVisibility(int) | .setCopyMessageOptionVisibility(View.GONE); |
| Message info option visibility | Activity/Fragment | setMessageInfoOptionVisibility(int) | .setMessageInfoOptionVisibility(View.GONE); |
| Group action message visibility | Activity/Fragment | setGroupActionMessageVisibility(int) | .setGroupActionMessageVisibility(View.GONE); |
| Reply option visibility | Activity/Fragment | setReplyOptionVisibility(int) | .setReplyOptionVisibility(View.GONE); |
| Share option visibility | Activity/Fragment | setShareMessageOptionVisibility(int) | .setShareMessageOptionVisibility(View.GONE); |
| Mark as unread option | Activity/Fragment | setMarkAsUnreadOptionVisibility(int) | .setMarkAsUnreadOptionVisibility(View.GONE); |
| Flag/report option | Activity/Fragment | setFlagOptionVisibility(int) | .setFlagOptionVisibility(View.GONE); |
| Moderation view visibility | Activity/Fragment | setModerationViewVisibility(int) | .setModerationViewVisibility(View.GONE); |
| Swipe to reply | Activity/Fragment | setSwipeToReplyEnabled(boolean) | .setSwipeToReplyEnabled(false); |
| Start from unread messages | Activity/Fragment | setStartFromUnreadMessages(boolean) | .setStartFromUnreadMessages(true); |
| Conversation starters | Activity/Fragment | setEnableConversationStarter(boolean) | .setEnableConversationStarter(true); |
| Smart replies | Activity/Fragment | setEnableSmartReplies(boolean) | .setEnableSmartReplies(true); |
| Smart replies keywords | Activity/Fragment | setAISmartRepliesKeywords(List) | .setAISmartRepliesKeywords(Arrays.asList("hello", "hi")); |
| Smart replies delay | Activity/Fragment | setSmartRepliesDelayDuration(int) | .setSmartRepliesDelayDuration(5000); |
| Conversation summary | Activity/Fragment | setEnableConversationSummary(boolean) | .setEnableConversationSummary(true); |
| Unread message threshold | Activity/Fragment | setUnreadMessageThreshold(int) | .setUnreadMessageThreshold(10); |
| Date/time formatting | Activity/Fragment | setDateTimeFormatter(DateTimeFormatterCallback) | See setDateTimeFormatter code above |
| Sticky date format | Activity/Fragment | setDateFormat(SimpleDateFormat) | messageList.setDateFormat(new SimpleDateFormat("MMM dd, yyyy", Locale.getDefault())); |
| Message bubble time format | Activity/Fragment | setTimeFormat(SimpleDateFormat) | messageList.setTimeFormat(new SimpleDateFormat("hh:mm a", Locale.getDefault())); |
| Loading view | Activity/Fragment | setLoadingStateView(int) | cometchatMessageList.setLoadingStateView(R.layout.your_loading_view); |
| Empty view | Activity/Fragment | setEmptyStateView(int) | cometchatMessageList.setEmptyStateView(R.layout.your_empty_view); |
| Error view | Activity/Fragment | setErrorStateView(int) | cometchatMessageList.setErrorStateView(R.layout.your_error_view); |
| Header view | Activity/Fragment | setHeaderView(View) | cometChatMessageList.setHeaderView(view); |
| Footer view | Activity/Fragment | setFooterView(View) | cometChatMessageList.setFooterView(view); |
| New message indicator view | Activity/Fragment | setNewMessageIndicatorView(View) | cometchatMessageList.setNewMessageIndicatorView(view); |
| Text formatters (mentions) | Activity/Fragment | setTextFormatters(List<CometChatTextFormatter>) | See setTextFormatters code above |
| Message templates | Activity/Fragment | setTemplates(List<CometChatMessageTemplate>) | See CometChatMessageTemplate |
| Refresh style | Activity/Fragment | refreshStyle() | .refreshStyle(); |
| Streaming speed | Activity/Fragment | setStreamingSpeed(Integer) | .setStreamingSpeed(100); |
| Bubble margins | Activity/Fragment | setLeftBubbleMargin / setRightBubbleMargin / setBubbleMargin | .setBubbleMargin(4, 4, 8, 8); |
| Internal adapter access | Activity/Fragment | getAdapter() / setAdapter() | Advanced use only |
Accessibility
The component renders a scrollableRecyclerView of message bubbles. Each message bubble responds to tap and long-press gestures. Avatar images include the user name as content description. Date separators and sticky headers provide temporal navigation context for screen readers.
For custom views provided via setHeaderView, setFooterView, or setNewMessageIndicatorView, ensure you set android:contentDescription on visual-only elements so TalkBack can announce them. The default views handle this automatically.
Read receipt indicators and reaction pills are visual-only by default. If screen reader descriptions are needed, provide them via custom views with appropriate contentDescription attributes.