agentsclimarketplace

Cometchat android v5 components

Skill cometchat/cometchat-skills/skills/cometchat-android-v5-components

Add CometChat chat & messaging and voice & video calls to any React, Next.js, React Native, Angular, Android, iOS, or Flutter project through your AI coding agent. Works with Claude Code, Cursor, Codex, VS Code Copilot, Windsurf, Cline, Kiro, and 50+ more agents.

Install
npx -y skills add cometchat/cometchat-skills --skill cometchat-android-v5-components

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

What its author says it does

Copied from the file, not written here

Complete catalog of CometChat Android UI Kit v5 components. Reference before writing integration code — never invent component names.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

16.1 KB, as published. Nobody here has run it

Ground truth: com.cometchat:chat-uikit-android:5.x (legacy/maintenance-only) component catalog (javap the AAR) + docs/ui-kit/android. Official docs: https://www.cometchat.com/docs/ui-kit/android/components-overview · Docs MCP: claude mcp add --transport http cometchat-docs https://www.cometchat.com/docs/mcp (or fetch the URL directly without MCP). Verify symbols against the installed package/source before relying on them.

Companion skills: cometchat-android-v5-core covers initialization and login; cometchat-android-v5-placement covers where to put these components; cometchat-android-v5-customization covers how to modify component behavior.

Purpose

This is the single source of truth for CometChat Android UI Kit v5 component names, key methods, and usage. Check this catalog before writing any CometChat view code. If a component is not listed here, it does not exist in the UI Kit.

Most top-level components extend MaterialCardView and can be used in XML layouts or created programmatically. Some lower-level views have different base classes — e.g. CometChatDate extends LinearLayout, CometChatMessageReceipt extends AppCompatImageView, CometChatEmojiKeyboard extends BottomSheetDialogFragment, and CometChatConfirmDialog extends Dialog. The main components follow a consistent pattern: set a User or Group object, configure visibility/style via setters, and attach callbacks for user interactions.


Use this skill when

  • Writing code that uses any CometChat* view
  • Looking up component names, methods, or XML attributes
  • Composing multiple components together (e.g., message header + list + composer)
  • "What components does CometChat have?"
  • "How do I use CometChatConversations?"

Do not use this skill when

  • Setting up init/login → use cometchat-android-v5-core
  • Customizing themes/colors → use cometchat-android-v5-theming
  • Writing custom message templates → use cometchat-android-v5-customization

1. Core messaging components

These are the components you use to build a chat experience. Most integrations use some combination of these.

CometChatConversations

Renders a scrollable list of the logged-in user's conversations (both 1:1 and group).

Key methods:

MethodTypeDescription
setOnItemClick(OnItemClick<Conversation>)CallbackCalled when user taps a conversation
setSelectionMode(UIKitConstants.SelectionMode)ConfigNONE, SINGLE, MULTIPLE
setSearchBoxVisibility(int)VisibilityShow/hide the search bar
setUserStatusVisibility(int)VisibilityShow/hide online status indicators
setReceiptsVisibility(int)VisibilityShow/hide read receipts
setDeleteConversationOptionVisibility(int)VisibilityShow/hide delete option on swipe
setBackIconVisibility(int)VisibilityShow/hide back button
setOnError(OnError)CallbackError handler
setOnLoad(OnLoad<Conversation>)CallbackCalled when conversations are loaded
setOnEmpty(OnEmpty)CallbackCalled when list is empty

XML usage:

<com.cometchat.chatuikit.conversations.CometChatConversations
    android:id="@+id/conversations"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

Java:

CometChatConversations conversations = findViewById(R.id.conversations);
conversations.setOnItemClick((view, position, conversation) -> {
    // Navigate to message screen with conversation.getConversationWith()
});

Kotlin:

val conversations = findViewById<CometChatConversations>(R.id.conversations)
conversations.setOnItemClick { view, position, conversation ->
    // Navigate to message screen with conversation.conversationWith
}

CometChatMessageList

Renders messages for a specific user or group conversation. The main chat area.

Key methods:

MethodTypeDescription
setUser(User)ConfigShow messages with this user (mutually exclusive with setGroup)
setGroup(Group)ConfigShow messages in this group (mutually exclusive with setUser)
setParentMessage(long)ConfigIf set, shows only thread replies (note: list takes the parent ID as long via setParentMessage, NOT setParentMessageId)
setOnThreadRepliesClick(ThreadReplyClick)CallbackCalled when "Reply in Thread" is tapped
setOnError(OnError)CallbackError handler
setOnLoad(OnLoad<BaseMessage>)CallbackCalled when messages are loaded
setReplyInThreadOptionVisibility(int)VisibilityShow/hide thread reply option
setReplyOptionVisibility(int)VisibilityShow/hide reply option
setCopyMessageOptionVisibility(int)VisibilityShow/hide copy option
setEditMessageOptionVisibility(int)VisibilityShow/hide edit option
setDeleteMessageOptionVisibility(int)VisibilityShow/hide delete option
setReceiptsVisibility(int)VisibilityShow/hide read receipts
setAvatarVisibility(int)VisibilityShow/hide sender avatars
setTextFormatters(List<CometChatTextFormatter>)ConfigCustom text formatters
setTemplates(List<CometChatMessageTemplate>)ConfigCustom message bubble templates

Java:

CometChatMessageList messageList = findViewById(R.id.messageList);
messageList.setUser(user);  // or messageList.setGroup(group);

Kotlin:

val messageList = findViewById<CometChatMessageList>(R.id.messageList)
messageList.setUser(user)  // or messageList.setGroup(group)

CometChatMessageComposer

A text input with send button, attachment options, emoji, and voice note support. Sends messages to the specified user or group.

Key methods:

MethodTypeDescription
setUser(User)ConfigSend messages to this user
setGroup(Group)ConfigSend messages to this group
setParentMessageId(long)ConfigThread mode — sends replies to this message
setOnSendButtonClick(SendButtonClick)CallbackCustom send button handler
setOnError(OnError)CallbackError handler
setAttachmentButtonVisibility(int)VisibilityShow/hide attachment button
setVoiceNoteButtonVisibility(int)VisibilityShow/hide voice note button
setSendButtonVisibility(int)VisibilityShow/hide send button
setHeaderView(View)Custom viewCustom view above the composer
setFooterView(View)Custom viewCustom view below the composer
setAuxiliaryButtonView(View)Custom viewCustom auxiliary button (takes a plain View)
disableTypingEvents(boolean)ConfigDisable typing indicators (note: no set prefix)
setDisableMentions(boolean)ConfigDisable @mentions

Java:

CometChatMessageComposer composer = findViewById(R.id.composer);
composer.setUser(user);  // or composer.setGroup(group);

Kotlin:

val composer = findViewById<CometChatMessageComposer>(R.id.composer)
composer.setUser(user)  // or composer.setGroup(group)

CometChatMessageHeader

Displays the name, avatar, and status of the user or group at the top of a message view.

Key methods:

MethodTypeDescription
setUser(User)ConfigShow header for this user
setGroup(Group)ConfigShow header for this group
setBackIconVisibility(int)VisibilityShow/hide back button
setOnBackPress(OnBackPress)CallbackBack button handler
setUserStatusVisibility(int)VisibilityShow/hide online status
setVideoCallButtonVisibility(int)VisibilityShow/hide video call button
setVoiceCallButtonVisibility(int)VisibilityShow/hide voice call button
setSubtitleView(Function3)Custom viewCustom subtitle view
setTrailingView(Function3)Custom viewCustom trailing view
setLeadingView(Function3)Custom viewCustom leading view

Java:

CometChatMessageHeader header = findViewById(R.id.header);
header.setUser(user);
header.setBackIconVisibility(View.VISIBLE);
header.setOnBackPress(() -> finish());

Kotlin:

val header = findViewById<CometChatMessageHeader>(R.id.header)
header.setUser(user)
header.setBackIconVisibility(View.VISIBLE)
header.setOnBackPress { finish() }

2. List components

CometChatUsers

Renders a scrollable list of users with alphabetical sticky headers.

Key methods:

MethodTypeDescription
setOnItemClick(OnItemClick<User>)CallbackCalled when user taps a user
setSelectionMode(UIKitConstants.SelectionMode)ConfigNONE, SINGLE, MULTIPLE
setSearchBoxVisibility(int)VisibilityShow/hide search bar
setUserStatusVisibility(int)VisibilityShow/hide online status
setOnSelect(OnSelection<User>)CallbackCalled when selection changes (note: setOnSelect for Users + Conversations; setOnSelection for Groups + GroupMembers)

CometChatGroups

Renders a scrollable list of groups.

Key methods:

MethodTypeDescription
setOnItemClick(OnItemClick<Group>)CallbackCalled when user taps a group
setSelectionMode(UIKitConstants.SelectionMode)ConfigNONE, SINGLE, MULTIPLE
setSearchBoxVisibility(int)VisibilityShow/hide search bar
setOnSelection(OnSelection<Group>)CallbackCalled when selection changes

CometChatGroupMembers

Renders the member list for a specific group.

Key methods:

MethodTypeDescription
setGroup(Group)ConfigRequired — the group to show members for
setOnItemClick(OnItemClick<GroupMember>)CallbackCalled when user taps a member
setSelectionMode(UIKitConstants.SelectionMode)ConfigNONE, SINGLE, MULTIPLE

3. Call components

CometChatCallLogs

Renders a list of past calls with duration, type, and timestamp.

CometChatIncomingCall

Incoming call notification banner with accept/reject buttons. Typically added to your root Activity layout.

CometChatOutgoingCall

Outgoing call screen with ringing indicator.

CometChatOngoingCall

Active call view (video/audio, controls).


4. Other components

CometChatSearch

Search component for finding conversations and messages.

CometChatReactionList

Full reaction list showing who reacted with which emoji.

CometChatThreadHeader

Thread header with parent message preview and reply count.


5. Shared views (building blocks)

These are lower-level views used inside the main components:

ViewDescription
CometChatAvatarUser/group avatar (image + fallback initials)
CometChatBadgeUnread count badge
CometChatStatusIndicatorOnline/offline status dot
CometChatMessageReceiptMessage delivery/read receipt icons
CometChatDateFormatted date display
CometChatMessageBubbleMessage bubble container
CometChatEmojiKeyboardEmoji picker grid
CometChatConfirmDialogConfirmation dialog
CometChatPopupMenuContext menu / popup menu

6. Composition patterns

Two-pane chat (conversation list + message view)

The most common pattern — conversation list on one side, active chat on the other. On phones, this is typically two Activities or Fragments with navigation between them.

Java:

// In ConversationsFragment or Activity
CometChatConversations conversations = findViewById(R.id.conversations);
conversations.setOnItemClick((view, position, conversation) -> {
    Intent intent = new Intent(this, MessagesActivity.class);
    if (conversation.getConversationType().equals("user")) {
        intent.putExtra("uid", ((User) conversation.getConversationWith()).getUid());
    } else {
        intent.putExtra("guid", ((Group) conversation.getConversationWith()).getGuid());
    }
    startActivity(intent);
});

// In MessagesActivity
CometChatMessageHeader header = findViewById(R.id.header);
CometChatMessageList messageList = findViewById(R.id.messageList);
CometChatMessageComposer composer = findViewById(R.id.composer);

String uid = getIntent().getStringExtra("uid");
if (uid != null) {
    CometChat.getUser(uid, new CometChat.CallbackListener<User>() {
        @Override
        public void onSuccess(User user) {
            header.setUser(user);
            messageList.setUser(user);
            composer.setUser(user);
        }

        @Override
        public void onError(CometChatException e) { }
    });
}

Kotlin:

// In ConversationsFragment or Activity
val conversations = findViewById<CometChatConversations>(R.id.conversations)
conversations.setOnItemClick { view, position, conversation ->
    val intent = Intent(this, MessagesActivity::class.java)
    when (conversation.conversationType) {
        "user" -> intent.putExtra("uid", (conversation.conversationWith as User).uid)
        "group" -> intent.putExtra("guid", (conversation.conversationWith as Group).guid)
    }
    startActivity(intent)
}

// In MessagesActivity
val header = findViewById<CometChatMessageHeader>(R.id.header)
val messageList = findViewById<CometChatMessageList>(R.id.messageList)
val composer = findViewById<CometChatMessageComposer>(R.id.composer)

val uid = intent.getStringExtra("uid")
uid?.let {
    CometChat.getUser(it, object : CometChat.CallbackListener<User>() {
        override fun onSuccess(user: User) {
            header.setUser(user)
            messageList.setUser(user)
            composer.setUser(user)
        }
        override fun onError(e: CometChatException) { }
    })
}

Messages Activity XML layout

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.cometchat.chatuikit.messageheader.CometChatMessageHeader
        android:id="@+id/header"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <com.cometchat.chatuikit.messagelist.CometChatMessageList
        android:id="@+id/messageList"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />

    <com.cometchat.chatuikit.messagecomposer.CometChatMessageComposer
        android:id="@+id/composer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

</LinearLayout>

Bottom navigation with tabs (Conversations + Users + Groups + Calls)

// In HomeActivity — switch fragments based on bottom nav selection
binding.bottomNavigationView.setOnItemSelectedListener(item -> {
    Fragment fragment;
    if (item.getItemId() == R.id.nav_chats) {
        fragment = new ChatsFragment();
    } else if (item.getItemId() == R.id.nav_users) {
        fragment = new UsersFragment();
    } else if (item.getItemId() == R.id.nav_groups) {
        fragment = new GroupsFragment();
    } else if (item.getItemId() == R.id.nav_calls) {
        fragment = new CallsFragment();
    } else {
        return false;
    }
    getSupportFragmentManager().beginTransaction()
        .replace(R.id.fragment_container, fragment)
        .commit();
    return true;
});

Hard rules

  • Never invent component names. If it's not in this catalog, it doesn't exist.
  • setUser() and setGroup() are mutually exclusive. Set one or the other, never both.
  • Components require a logged-in user. Always verify CometChatUIKit.getLoggedInUser() != null before mounting.
  • All components extend MaterialCardView. They can be used in XML or created programmatically.
  • Thread modeCometChatMessageList.setParentMessage(long) (no Id suffix on the list) and CometChatMessageComposer.setParentMessageId(long). Both must point to the same parent message ID. Without them, the list and composer show the main conversation, not the thread.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.