Skip to main content
FieldValue
Packagecom.cometchat:chat-uikit-android
Required setupCometChatUIKit.init() + CometChatUIKit.login() before rendering any component
Callback actions.setOn<Event> { } or .setOn<Event>(listener)
Data filtering.set<Entity>RequestBuilder(builder)
Toggle features.set<Feature>Visibility(View.VISIBLE / View.GONE)
Custom rendering.set<Slot>View(ViewHolderListener) or .set<Slot>View(@LayoutRes int)
Style overrides.setStyle(@StyleRes int) targeting CometChat<Component>Style
CallingRequires separate com.cometchat:calls-sdk-android package

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

ComponentPurposeKey MethodsPage
CometChatConversationsScrollable list of recent conversationssetConversationsRequestBuilder, setOnItemClick, setOnErrorConversations
CometChatUsersScrollable list of userssetUsersRequestBuilder, setOnItemClick, setOnErrorUsers
CometChatGroupsScrollable list of groupssetGroupsRequestBuilder, setOnItemClick, setOnErrorGroups
CometChatGroupMembersScrollable list of group memberssetGroup, setGroupMembersRequestBuilder, setOnItemClickGroup Members

Messages

ComponentPurposeKey MethodsPage
CometChatMessageHeaderToolbar with avatar, name, status, typing indicatorsetUser, setGroup, setOnBackButtonPressedMessage Header
CometChatMessageListScrollable message list with reactions, receipts, threadssetUser, setGroup, setMessagesRequestBuilderMessage List
CometChatMessageComposerRich input with attachments, mentions, voice notessetUser, setGroup, setOnSendButtonClickMessage Composer
CometChatThreadHeaderParent message bubble and reply count for threaded viewsetParentMessageThreaded Messages Header

Calling

ComponentPurposeKey MethodsPage
CometChatCallButtonsVoice and video call initiation buttonssetUser, setGroup, setOnVoiceCallClick, setOnVideoCallClickCall Buttons
CometChatIncomingCallIncoming call notification with accept/rejectsetCall, setOnAcceptClick, setOnRejectClickIncoming Call
CometChatOutgoingCallOutgoing call screen with end-call controlsetCall, setOnEndCallClickOutgoing Call
CometChatCallLogsScrollable list of call historysetCallLogRequestBuilder, setOnItemClickCall Logs

Search and AI

ComponentPurposeKey MethodsPage
CometChatSearchReal-time search across conversations and messagessetOnConversationClicked, setOnMessageClicked, setUid, setGuidSearch
CometChatAIAssistantChatHistoryAI assistant conversation historysetOnItemClick, setNewChatButtonClickAI Assistant Chat History

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:
messageList.setOnThreadRepliesClick { message, context, view ->
    openThreadPanel(message)
}
messageList.setOnError { error ->
    logError(error)
}

Events

Events enable decoupled communication between components. A component emits events that other parts of the application can subscribe to without direct references.
CometChatMessageEvents.addListener("LISTENER_ID", object : CometChatMessageEvents() {
    override fun ccMessageSent(message: BaseMessage, status: Int) {
        // react to sent message
    }
})

// cleanup
CometChatMessageEvents.removeListener("LISTENER_ID")
Each component page documents its emitted events in the Events section.

Filters

List-based components accept RequestBuilder methods to control which data loads:
messageList.setMessagesRequestBuilder(
    MessagesRequest.MessagesRequestBuilder().setLimit(20)
)

Custom View Slots

Components expose named view slot methods to replace sections of the default UI:
messageHeader.setTitleView { context, user, group ->
    // return custom View
}
messageHeader.setSubtitleView { context, user, group ->
    // return custom View
}

Style Overrides

Every component supports a setStyle(@StyleRes int) method for style customization:
styles.xml
<style name="CustomConversationsStyle" parent="CometChatConversationsStyle">
    <item name="cometchatSeparatorColor">@color/your_color</item>
</style>
See Component Styling for the full styling guide.

Next Steps