Skip to main content

Architecture

The UI Kit is a set of independent Android Views that compose into chat layouts. A typical chat layout uses four core components:
  • CometChatConversations — list of recent conversations (users and groups)
  • CometChatMessageHeader — toolbar showing avatar, name, online status, and typing indicator
  • CometChatMessageList — scrollable message feed with reactions, receipts, and threads
  • CometChatMessageComposer — rich input with attachments, mentions, and voice notes
Data flow: selecting a conversation in CometChatConversations yields a User or Group object via setOnItemClick. That object is passed to CometChatMessageHeader, CometChatMessageList, and CometChatMessageComposer using .setUser() or .setGroup(). The message components use the SDK internally — CometChatMessageComposer sends messages, CometChatMessageList receives them via real-time listeners. Components communicate through a publish/subscribe event bus (CometChatMessageEvents, CometChatConversationEvents, CometChatGroupEvents, etc.). A component emits events that other components or application code can subscribe to without direct references. See Events for the full list. Each component accepts callback methods (.setOn<Event>), view slot methods (.set<Slot>View) for replacing UI sections, RequestBuilder methods for data filtering, and @StyleRes overrides via .setStyle().

Component Catalog

All components are from the com.cometchat:chat-uikit-android package.

Conversations and Lists

Messages

Calling

Search and AI


Component API Pattern

All components share a consistent API surface.

Actions

Actions control component behavior. They split into two categories: Predefined actions are built into the component and execute automatically on user interaction (e.g., tapping send dispatches the message). No configuration needed. User-defined actions are callback methods that fire on specific events. Override them to customize behavior:

Events

Events enable decoupled communication between components. A component emits events that other parts of the application can subscribe to without direct references.
Each component page documents its emitted events in the Events section.

Filters

List-based components accept RequestBuilder methods to control which data loads:

Custom View Slots

Components expose named view slot methods to replace sections of the default UI:

Style Overrides

Every component supports a setStyle(@StyleRes int) method for style customization:
styles.xml
See Component Styling for the full styling guide.

Next Steps

Core Features

Chat features included out of the box

Theming

Customize colors, fonts, and styles

Extensions

Add-on features like polls, stickers, and translation

Guides

Task-oriented tutorials for common patterns