跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
设计与 UI

cometchat-android-v5-components

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

cometchat · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

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

技能说明


name: cometchat-android-v5-components description: "Complete catalog of CometChat Android UI Kit v5 components. Reference before writing integration code — never invent component names." license: "MIT" compatibility: "Android 7.0+; Java 8+; Kotlin 1.8+; com.cometchat:chat-uikit-android:5.x" metadata: author: "CometChat" version: "3.0.0" tags: "chat cometchat android components catalog reference ui-kit views"

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)
mess
阅读完整来源 ↗