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-corecovers initialization and login;cometchat-android-v5-placementcovers where to put these components;cometchat-android-v5-customizationcovers 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:
| Method | Type | Description |
|---|---|---|
setOnItemClick(OnItemClick<Conversation>) | Callback | Called when user taps a conversation |
setSelectionMode(UIKitConstants.SelectionMode) | Config | NONE, SINGLE, MULTIPLE |
setSearchBoxVisibility(int) | Visibility | Show/hide the search bar |
setUserStatusVisibility(int) | Visibility | Show/hide online status indicators |
setReceiptsVisibility(int) | Visibility | Show/hide read receipts |
setDeleteConversationOptionVisibility(int) | Visibility | Show/hide delete option on swipe |
setBackIconVisibility(int) | Visibility | Show/hide back button |
setOnError(OnError) | Callback | Error handler |
setOnLoad(OnLoad<Conversation>) | Callback | Called when conversations are loaded |
setOnEmpty(OnEmpty) | Callback | Called 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:
| Method | Type | Description |
|---|---|---|
setUser(User) | Config | Show messages with this user (mutually exclusive with setGroup) |
setGroup(Group) | Config | Show messages in this group (mutually exclusive with setUser) |
setParentMessage(long) | Config | If set, shows only thread replies (note: list takes the parent ID as long via setParentMessage, NOT setParentMessageId) |
setOnThreadRepliesClick(ThreadReplyClick) | Callback | Called when "Reply in Thread" is tapped |
setOnError(OnError) | Callback | Error handler |
setOnLoad(OnLoad<BaseMessage>) | Callback | Called when messages are loaded |
setReplyInThreadOptionVisibility(int) | Visibility | Show/hide thread reply option |
setReplyOptionVisibility(int) | Visibility | Show/hide reply option |
setCopyMessageOptionVisibility(int) | Visibility | Show/hide copy option |
setEditMessageOptionVisibility(int) | Visibility | Show/hide edit option |
setDeleteMessageOptionVisibility(int) | Visibility | Show/hide delete option |
setReceiptsVisibility(int) | Visibility | Show/hide read receipts |
setAvatarVisibility(int) | Visibility | Show/hide sender avatars |
setTextFormatters(List<CometChatTextFormatter>) | Config | Custom text formatters |
setTemplates(List<CometChatMessageTemplate>) | Config | Custom 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
阅读完整来源 ↗