@cometchat/skills 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +44 -17
- package/bin/install.js +389 -43
- package/package.json +19 -9
- package/skills/cometchat/SKILL.md +1066 -265
- package/skills/cometchat-android-v5/SKILL.md +120 -0
- package/skills/cometchat-android-v5-components/SKILL.md +430 -0
- package/skills/cometchat-android-v5-core/SKILL.md +468 -0
- package/skills/cometchat-android-v5-customization/SKILL.md +305 -0
- package/skills/cometchat-android-v5-extensions/SKILL.md +124 -0
- package/skills/cometchat-android-v5-features/SKILL.md +130 -0
- package/skills/cometchat-android-v5-placement/SKILL.md +276 -0
- package/skills/cometchat-android-v5-production/SKILL.md +94 -0
- package/skills/cometchat-android-v5-push/SKILL.md +620 -0
- package/skills/cometchat-android-v5-testing/SKILL.md +187 -0
- package/skills/cometchat-android-v5-theming/SKILL.md +166 -0
- package/skills/cometchat-android-v5-troubleshooting/SKILL.md +73 -0
- package/skills/cometchat-android-v6/SKILL.md +107 -0
- package/skills/cometchat-android-v6-builder-settings/SKILL.md +145 -0
- package/skills/cometchat-android-v6-compose-components/SKILL.md +202 -0
- package/skills/cometchat-android-v6-compose-customization/SKILL.md +280 -0
- package/skills/cometchat-android-v6-compose-placement/SKILL.md +213 -0
- package/skills/cometchat-android-v6-compose-theming/SKILL.md +224 -0
- package/skills/cometchat-android-v6-core/SKILL.md +354 -0
- package/skills/cometchat-android-v6-events/SKILL.md +212 -0
- package/skills/cometchat-android-v6-extensions/SKILL.md +191 -0
- package/skills/cometchat-android-v6-features/SKILL.md +130 -0
- package/skills/cometchat-android-v6-kotlin-components/SKILL.md +197 -0
- package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +268 -0
- package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +248 -0
- package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +202 -0
- package/skills/cometchat-android-v6-production/SKILL.md +187 -0
- package/skills/cometchat-android-v6-push/SKILL.md +274 -0
- package/skills/cometchat-android-v6-testing/SKILL.md +279 -0
- package/skills/cometchat-android-v6-troubleshooting/SKILL.md +249 -0
- package/skills/cometchat-angular-components/SKILL.md +706 -0
- package/skills/cometchat-angular-core/SKILL.md +444 -0
- package/skills/cometchat-angular-customization/SKILL.md +424 -0
- package/skills/cometchat-angular-features/SKILL.md +447 -0
- package/skills/cometchat-angular-patterns/SKILL.md +447 -0
- package/skills/cometchat-angular-placement/SKILL.md +685 -0
- package/skills/cometchat-angular-production/SKILL.md +415 -0
- package/skills/cometchat-angular-theming/SKILL.md +365 -0
- package/skills/cometchat-angular-troubleshooting/SKILL.md +329 -0
- package/skills/cometchat-astro-patterns/SKILL.md +3 -3
- package/skills/cometchat-components/SKILL.md +11 -0
- package/skills/cometchat-core/SKILL.md +11 -6
- package/skills/cometchat-customization/references/component-catalog.md +1 -1
- package/skills/cometchat-features/SKILL.md +176 -108
- package/skills/cometchat-flutter-v5/SKILL.md +167 -0
- package/skills/cometchat-flutter-v5-calls/SKILL.md +192 -0
- package/skills/cometchat-flutter-v5-conversations/SKILL.md +117 -0
- package/skills/cometchat-flutter-v5-core/SKILL.md +221 -0
- package/skills/cometchat-flutter-v5-customization/SKILL.md +227 -0
- package/skills/cometchat-flutter-v5-events/SKILL.md +155 -0
- package/skills/cometchat-flutter-v5-messages/SKILL.md +258 -0
- package/skills/cometchat-flutter-v5-production/SKILL.md +207 -0
- package/skills/cometchat-flutter-v5-push/SKILL.md +284 -0
- package/skills/cometchat-flutter-v5-theming/SKILL.md +160 -0
- package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +129 -0
- package/skills/cometchat-flutter-v5-users-groups/SKILL.md +151 -0
- package/skills/cometchat-flutter-v6/SKILL.md +445 -0
- package/skills/cometchat-flutter-v6-calls/SKILL.md +333 -0
- package/skills/cometchat-flutter-v6-components/SKILL.md +365 -0
- package/skills/cometchat-flutter-v6-conversations/SKILL.md +210 -0
- package/skills/cometchat-flutter-v6-core/SKILL.md +305 -0
- package/skills/cometchat-flutter-v6-customization/SKILL.md +666 -0
- package/skills/cometchat-flutter-v6-events/SKILL.md +216 -0
- package/skills/cometchat-flutter-v6-features/SKILL.md +406 -0
- package/skills/cometchat-flutter-v6-messages/SKILL.md +333 -0
- package/skills/cometchat-flutter-v6-migration/SKILL.md +381 -0
- package/skills/cometchat-flutter-v6-placement/SKILL.md +398 -0
- package/skills/cometchat-flutter-v6-production/SKILL.md +632 -0
- package/skills/cometchat-flutter-v6-theming/SKILL.md +260 -0
- package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +726 -0
- package/skills/cometchat-flutter-v6-users-groups/SKILL.md +216 -0
- package/skills/cometchat-ios/SKILL.md +323 -0
- package/skills/cometchat-ios-components/SKILL.md +651 -0
- package/skills/cometchat-ios-core/SKILL.md +822 -0
- package/skills/cometchat-ios-customization/SKILL.md +825 -0
- package/skills/cometchat-ios-features/SKILL.md +725 -0
- package/skills/cometchat-ios-placement/SKILL.md +750 -0
- package/skills/cometchat-ios-production/SKILL.md +730 -0
- package/skills/cometchat-ios-push/SKILL.md +582 -0
- package/skills/cometchat-ios-theming/SKILL.md +631 -0
- package/skills/cometchat-ios-troubleshooting/SKILL.md +983 -0
- package/skills/cometchat-native-bare-patterns/SKILL.md +470 -0
- package/skills/cometchat-native-components/SKILL.md +594 -0
- package/skills/cometchat-native-core/SKILL.md +407 -0
- package/skills/cometchat-native-customization/SKILL.md +594 -0
- package/skills/cometchat-native-expo-patterns/SKILL.md +485 -0
- package/skills/cometchat-native-features/SKILL.md +608 -0
- package/skills/cometchat-native-placement/SKILL.md +500 -0
- package/skills/cometchat-native-production/SKILL.md +694 -0
- package/skills/cometchat-native-push/SKILL.md +593 -0
- package/skills/cometchat-native-testing/SKILL.md +583 -0
- package/skills/cometchat-native-theming/SKILL.md +656 -0
- package/skills/cometchat-native-troubleshooting/SKILL.md +433 -0
- package/skills/cometchat-nextjs-patterns/SKILL.md +5 -5
- package/skills/cometchat-production/SKILL.md +60 -0
- package/skills/cometchat-react-router-patterns/SKILL.md +23 -21
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cometchat-android-v5
|
|
3
|
+
description: "Entry-point dispatcher for CometChat Android UI Kit v5. Detects project setup, understands what the dev is building, and routes to the right sub-skills."
|
|
4
|
+
license: "MIT"
|
|
5
|
+
compatibility: "Android 7.0+; Java 8+; Kotlin 1.8+; com.cometchat:chat-uikit-android:5.x"
|
|
6
|
+
allowed-tools: "executeBash, readFile, fileSearch, listDirectory"
|
|
7
|
+
metadata:
|
|
8
|
+
author: "CometChat"
|
|
9
|
+
version: "3.0.0"
|
|
10
|
+
tags: "chat cometchat android dispatcher entry-point integration"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Purpose
|
|
14
|
+
|
|
15
|
+
This is the entry-point skill for CometChat Android UI Kit v5. It helps you understand what the developer is building, detects their project setup, and routes to the correct sub-skill for the task at hand.
|
|
16
|
+
|
|
17
|
+
**All skills are designed to work with both Java and Kotlin projects.** Code examples in each skill are provided in both languages.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Use this skill when
|
|
22
|
+
|
|
23
|
+
- A developer asks to "add chat to my Android app"
|
|
24
|
+
- Starting a new CometChat integration
|
|
25
|
+
- Unsure which skill to use for a specific task
|
|
26
|
+
- Need an overview of what CometChat Android UI Kit v5 offers
|
|
27
|
+
|
|
28
|
+
## Do not use this skill when
|
|
29
|
+
|
|
30
|
+
- You already know which specific skill is needed (go directly to it)
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 1. Project detection
|
|
35
|
+
|
|
36
|
+
Before writing any code, detect the project setup:
|
|
37
|
+
|
|
38
|
+
| Check | How | Why |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| Language | Look for `.kt` files in `src/main/java/` or `src/main/kotlin/` | Determines Java vs Kotlin code examples |
|
|
41
|
+
| Gradle version | Check `gradle-wrapper.properties` for `distributionUrl` | Affects dependency syntax (Groovy vs Kotlin DSL) |
|
|
42
|
+
| Min SDK | Check `build.gradle` for `minSdkVersion` | Must be 24+ for CometChat |
|
|
43
|
+
| Existing CometChat | Search for `com.cometchat` in `build.gradle` | Avoid duplicate setup |
|
|
44
|
+
| Calling SDK | Search for `com.cometchat:calls-sdk-android` | Determines if voice/video is already available |
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 2. What are you building?
|
|
49
|
+
|
|
50
|
+
Ask the developer what they're building to recommend the right placement:
|
|
51
|
+
|
|
52
|
+
| Intent | Recommended placement | Components |
|
|
53
|
+
|---|---|---|
|
|
54
|
+
| Messaging app | Dedicated Activity with bottom tabs | `CometChatConversations` + `CometChatMessageList` + `CometChatMessageComposer` + `CometChatMessageHeader` |
|
|
55
|
+
| Marketplace / platform | Chat button on product screen + inbox Activity | Single thread (button trigger) + multi-conversation (inbox) |
|
|
56
|
+
| SaaS / dashboard | Chat Fragment in existing Activity | `CometChatConversations` in a Fragment |
|
|
57
|
+
| Social / community | Full messenger with tabs | Conversations + Users + Groups + Calls in ViewPager/BottomNav |
|
|
58
|
+
| Support / helpdesk | BottomSheet or Dialog overlay | `CometChatMessageList` + `CometChatMessageComposer` in BottomSheet |
|
|
59
|
+
| Just exploring | Minimal single-Activity demo | `CometChatConversations` with pre-logged-in test user |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 3. Skill routing reference
|
|
64
|
+
|
|
65
|
+
| Skill | When to load |
|
|
66
|
+
|---|---|
|
|
67
|
+
| `cometchat-android-v5-core` | **Always** — before any integration code. Init, login, builder, dependencies. |
|
|
68
|
+
| `cometchat-android-v5-components` | **Always** — before writing component code. Full catalog of all CometChat views. |
|
|
69
|
+
| `cometchat-android-v5-placement` | When integrating — Activity, Fragment, BottomSheet, Dialog, Tab patterns. |
|
|
70
|
+
| `cometchat-android-v5-theming` | When customizing look and feel — colors, fonts, dark mode, style classes. |
|
|
71
|
+
| `cometchat-android-v5-features` | When adding features — calls, reactions, polls, AI, extensions. |
|
|
72
|
+
| `cometchat-android-v5-customization` | When writing custom templates, events, DataSource decorators. |
|
|
73
|
+
| `cometchat-android-v5-production` | When setting up production auth or user management. |
|
|
74
|
+
| `cometchat-android-v5-troubleshooting` | When diagnosing problems — Gradle errors, crashes, rendering issues. |
|
|
75
|
+
| `cometchat-android-v5-extensions` | When working with extensions (polls, stickers, collaborative, etc.). |
|
|
76
|
+
| `cometchat-android-v5-push` | When setting up push notifications (FCM, token lifecycle, deep-link). |
|
|
77
|
+
| `cometchat-android-v5-testing` | When adding tests (unit, UI, instrumented, E2E, CI). |
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 4. Integration order
|
|
82
|
+
|
|
83
|
+
Every integration follows this sequence:
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
1. Dependencies (Gradle) → cometchat-android-v5-core §1
|
|
87
|
+
2. Manifest permissions → cometchat-android-v5-core §5
|
|
88
|
+
3. App theme setup → cometchat-android-v5-core §5b (must inherit CometChatTheme.DayNight — Material 2 parent)
|
|
89
|
+
4. Init + Login → cometchat-android-v5-core §2-3
|
|
90
|
+
5. Place components in your app → cometchat-android-v5-placement
|
|
91
|
+
6. Customize appearance → cometchat-android-v5-theming
|
|
92
|
+
7. Add features → cometchat-android-v5-features
|
|
93
|
+
8. Production hardening → cometchat-android-v5-production
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 5. Iteration menu
|
|
99
|
+
|
|
100
|
+
After the initial integration, the developer can:
|
|
101
|
+
|
|
102
|
+
1. **Customize look and feel** — Theme presets, brand colors, dark mode
|
|
103
|
+
2. **Add a feature** — Calls, reactions, polls, AI smart replies, file sharing
|
|
104
|
+
3. **Customize a component** — Custom message bubbles, headers, composer actions
|
|
105
|
+
4. **Set up production auth** — Replace dev Auth Key with server-side tokens
|
|
106
|
+
5. **Set up push notifications** — FCM setup, token lifecycle, deep-link on tap
|
|
107
|
+
6. **Add tests** — Unit tests, UI tests, E2E with Maestro
|
|
108
|
+
7. **Troubleshoot an issue** — Gradle errors, runtime crashes, rendering problems
|
|
109
|
+
|
|
110
|
+
Route each choice to the appropriate skill.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Hard rules
|
|
115
|
+
|
|
116
|
+
- **Always read `cometchat-android-v5-core` first.** It covers init, login, and dependencies — prerequisites for everything else.
|
|
117
|
+
- **Always read `cometchat-android-v5-components` before writing component code.** Never invent component names or method signatures from memory.
|
|
118
|
+
- **Provide both Java and Kotlin examples.** The v5 UIKit is written in Java but is fully interoperable with Kotlin. Client devs use both.
|
|
119
|
+
- **Ask, don't assume.** Every integration decision (placement, features, auth mode) should be confirmed with the developer.
|
|
120
|
+
- **Always read existing files before modifying them.** Never blindly overwrite project files.
|
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cometchat-android-v5-components
|
|
3
|
+
description: "Complete catalog of CometChat Android UI Kit v5 components. Reference before writing integration code — never invent component names."
|
|
4
|
+
license: "MIT"
|
|
5
|
+
compatibility: "Android 7.0+; Java 8+; Kotlin 1.8+; com.cometchat:chat-uikit-android:5.x"
|
|
6
|
+
allowed-tools: "executeBash, readFile, fileSearch, listDirectory"
|
|
7
|
+
metadata:
|
|
8
|
+
author: "CometChat"
|
|
9
|
+
version: "3.0.0"
|
|
10
|
+
tags: "chat cometchat android components catalog reference ui-kit views"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
> **Companion skills:** `cometchat-android-v5-core` covers initialization and login;
|
|
14
|
+
> `cometchat-android-v5-placement` covers where to put these components;
|
|
15
|
+
> `cometchat-android-v5-customization` covers how to modify component behavior.
|
|
16
|
+
|
|
17
|
+
## Purpose
|
|
18
|
+
|
|
19
|
+
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.
|
|
20
|
+
|
|
21
|
+
All components extend `MaterialCardView` and can be used in XML layouts or created programmatically. They follow a consistent pattern: set a `User` or `Group` object, configure visibility/style via setters, and attach callbacks for user interactions.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Use this skill when
|
|
27
|
+
|
|
28
|
+
- Writing code that uses any `CometChat*` view
|
|
29
|
+
- Looking up component names, methods, or XML attributes
|
|
30
|
+
- Composing multiple components together (e.g., message header + list + composer)
|
|
31
|
+
- "What components does CometChat have?"
|
|
32
|
+
- "How do I use CometChatConversations?"
|
|
33
|
+
|
|
34
|
+
## Do not use this skill when
|
|
35
|
+
|
|
36
|
+
- Setting up init/login → use `cometchat-android-v5-core`
|
|
37
|
+
- Customizing themes/colors → use `cometchat-android-v5-theming`
|
|
38
|
+
- Writing custom message templates → use `cometchat-android-v5-customization`
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 1. Core messaging components
|
|
43
|
+
|
|
44
|
+
These are the components you use to build a chat experience. Most integrations use some combination of these.
|
|
45
|
+
|
|
46
|
+
### CometChatConversations
|
|
47
|
+
|
|
48
|
+
Renders a scrollable list of the logged-in user's conversations (both 1:1 and group).
|
|
49
|
+
|
|
50
|
+
**Key methods:**
|
|
51
|
+
|
|
52
|
+
| Method | Type | Description |
|
|
53
|
+
|---|---|---|
|
|
54
|
+
| `setOnItemClick(OnItemClick<Conversation>)` | Callback | Called when user taps a conversation |
|
|
55
|
+
| `setSelectionMode(UIKitConstants.SelectionMode)` | Config | `NONE`, `SINGLE`, `MULTIPLE` |
|
|
56
|
+
| `setSearchBoxVisibility(int)` | Visibility | Show/hide the search bar |
|
|
57
|
+
| `setUserStatusVisibility(int)` | Visibility | Show/hide online status indicators |
|
|
58
|
+
| `setReceiptsVisibility(int)` | Visibility | Show/hide read receipts |
|
|
59
|
+
| `setDeleteConversationOptionVisibility(int)` | Visibility | Show/hide delete option on swipe |
|
|
60
|
+
| `setBackIconVisibility(int)` | Visibility | Show/hide back button |
|
|
61
|
+
| `setOnError(OnError)` | Callback | Error handler |
|
|
62
|
+
| `setOnLoad(OnLoad<Conversation>)` | Callback | Called when conversations are loaded |
|
|
63
|
+
| `setOnEmpty(OnEmpty)` | Callback | Called when list is empty |
|
|
64
|
+
|
|
65
|
+
**XML usage:**
|
|
66
|
+
```xml
|
|
67
|
+
<com.cometchat.chatuikit.conversations.CometChatConversations
|
|
68
|
+
android:id="@+id/conversations"
|
|
69
|
+
android:layout_width="match_parent"
|
|
70
|
+
android:layout_height="match_parent" />
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Java:**
|
|
74
|
+
```java
|
|
75
|
+
CometChatConversations conversations = findViewById(R.id.conversations);
|
|
76
|
+
conversations.setOnItemClick((view, position, conversation) -> {
|
|
77
|
+
// Navigate to message screen with conversation.getConversationWith()
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Kotlin:**
|
|
82
|
+
```kotlin
|
|
83
|
+
val conversations = findViewById<CometChatConversations>(R.id.conversations)
|
|
84
|
+
conversations.setOnItemClick { view, position, conversation ->
|
|
85
|
+
// Navigate to message screen with conversation.conversationWith
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
### CometChatMessageList
|
|
92
|
+
|
|
93
|
+
Renders messages for a specific user or group conversation. The main chat area.
|
|
94
|
+
|
|
95
|
+
**Key methods:**
|
|
96
|
+
|
|
97
|
+
| Method | Type | Description |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| `setUser(User)` | Config | Show messages with this user (mutually exclusive with `setGroup`) |
|
|
100
|
+
| `setGroup(Group)` | Config | Show messages in this group (mutually exclusive with `setUser`) |
|
|
101
|
+
| `setParentMessage(long)` | Config | If set, shows only thread replies (note: list takes the parent ID as `long` via `setParentMessage`, NOT `setParentMessageId`) |
|
|
102
|
+
| `setOnThreadRepliesClick(ThreadReplyClick)` | Callback | Called when "Reply in Thread" is tapped |
|
|
103
|
+
| `setOnError(OnError)` | Callback | Error handler |
|
|
104
|
+
| `setOnLoad(OnLoad<BaseMessage>)` | Callback | Called when messages are loaded |
|
|
105
|
+
| `setReplyInThreadOptionVisibility(int)` | Visibility | Show/hide thread reply option |
|
|
106
|
+
| `setReplyOptionVisibility(int)` | Visibility | Show/hide reply option |
|
|
107
|
+
| `setCopyMessageOptionVisibility(int)` | Visibility | Show/hide copy option |
|
|
108
|
+
| `setEditMessageOptionVisibility(int)` | Visibility | Show/hide edit option |
|
|
109
|
+
| `setDeleteMessageOptionVisibility(int)` | Visibility | Show/hide delete option |
|
|
110
|
+
| `setReceiptsVisibility(int)` | Visibility | Show/hide read receipts |
|
|
111
|
+
| `setAvatarVisibility(int)` | Visibility | Show/hide sender avatars |
|
|
112
|
+
| `setTextFormatters(List<CometChatTextFormatter>)` | Config | Custom text formatters |
|
|
113
|
+
| `setTemplates(List<CometChatMessageTemplate>)` | Config | Custom message bubble templates |
|
|
114
|
+
|
|
115
|
+
**Java:**
|
|
116
|
+
```java
|
|
117
|
+
CometChatMessageList messageList = findViewById(R.id.messageList);
|
|
118
|
+
messageList.setUser(user); // or messageList.setGroup(group);
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Kotlin:**
|
|
122
|
+
```kotlin
|
|
123
|
+
val messageList = findViewById<CometChatMessageList>(R.id.messageList)
|
|
124
|
+
messageList.setUser(user) // or messageList.setGroup(group)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### CometChatMessageComposer
|
|
130
|
+
|
|
131
|
+
A text input with send button, attachment options, emoji, and voice note support. Sends messages to the specified user or group.
|
|
132
|
+
|
|
133
|
+
**Key methods:**
|
|
134
|
+
|
|
135
|
+
| Method | Type | Description |
|
|
136
|
+
|---|---|---|
|
|
137
|
+
| `setUser(User)` | Config | Send messages to this user |
|
|
138
|
+
| `setGroup(Group)` | Config | Send messages to this group |
|
|
139
|
+
| `setParentMessageId(long)` | Config | Thread mode — sends replies to this message |
|
|
140
|
+
| `setOnSendButtonClick(SendButtonClick)` | Callback | Custom send button handler |
|
|
141
|
+
| `setOnError(OnError)` | Callback | Error handler |
|
|
142
|
+
| `setAttachmentButtonVisibility(int)` | Visibility | Show/hide attachment button |
|
|
143
|
+
| `setVoiceNoteButtonVisibility(int)` | Visibility | Show/hide voice note button |
|
|
144
|
+
| `setSendButtonVisibility(int)` | Visibility | Show/hide send button |
|
|
145
|
+
| `setHeaderView(View)` | Custom view | Custom view above the composer |
|
|
146
|
+
| `setFooterView(View)` | Custom view | Custom view below the composer |
|
|
147
|
+
| `setAuxiliaryButtonView(View)` | Custom view | Custom auxiliary button (takes a plain `View`) |
|
|
148
|
+
| `disableTypingEvents(boolean)` | Config | Disable typing indicators (note: no `set` prefix) |
|
|
149
|
+
| `setDisableMentions(boolean)` | Config | Disable @mentions |
|
|
150
|
+
|
|
151
|
+
**Java:**
|
|
152
|
+
```java
|
|
153
|
+
CometChatMessageComposer composer = findViewById(R.id.composer);
|
|
154
|
+
composer.setUser(user); // or composer.setGroup(group);
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Kotlin:**
|
|
158
|
+
```kotlin
|
|
159
|
+
val composer = findViewById<CometChatMessageComposer>(R.id.composer)
|
|
160
|
+
composer.setUser(user) // or composer.setGroup(group)
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
### CometChatMessageHeader
|
|
166
|
+
|
|
167
|
+
Displays the name, avatar, and status of the user or group at the top of a message view.
|
|
168
|
+
|
|
169
|
+
**Key methods:**
|
|
170
|
+
|
|
171
|
+
| Method | Type | Description |
|
|
172
|
+
|---|---|---|
|
|
173
|
+
| `setUser(User)` | Config | Show header for this user |
|
|
174
|
+
| `setGroup(Group)` | Config | Show header for this group |
|
|
175
|
+
| `setBackIconVisibility(int)` | Visibility | Show/hide back button |
|
|
176
|
+
| `setOnBackPress(OnBackPress)` | Callback | Back button handler |
|
|
177
|
+
| `setUserStatusVisibility(int)` | Visibility | Show/hide online status |
|
|
178
|
+
| `setVideoCallButtonVisibility(int)` | Visibility | Show/hide video call button |
|
|
179
|
+
| `setVoiceCallButtonVisibility(int)` | Visibility | Show/hide voice call button |
|
|
180
|
+
| `setSubtitleView(Function3)` | Custom view | Custom subtitle view |
|
|
181
|
+
| `setTrailingView(Function3)` | Custom view | Custom trailing view |
|
|
182
|
+
| `setLeadingView(Function3)` | Custom view | Custom leading view |
|
|
183
|
+
|
|
184
|
+
**Java:**
|
|
185
|
+
```java
|
|
186
|
+
CometChatMessageHeader header = findViewById(R.id.header);
|
|
187
|
+
header.setUser(user);
|
|
188
|
+
header.setBackIconVisibility(View.VISIBLE);
|
|
189
|
+
header.setOnBackPress(() -> finish());
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Kotlin:**
|
|
193
|
+
```kotlin
|
|
194
|
+
val header = findViewById<CometChatMessageHeader>(R.id.header)
|
|
195
|
+
header.setUser(user)
|
|
196
|
+
header.setBackIconVisibility(View.VISIBLE)
|
|
197
|
+
header.setOnBackPress { finish() }
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## 2. List components
|
|
203
|
+
|
|
204
|
+
### CometChatUsers
|
|
205
|
+
|
|
206
|
+
Renders a scrollable list of users with alphabetical sticky headers.
|
|
207
|
+
|
|
208
|
+
**Key methods:**
|
|
209
|
+
|
|
210
|
+
| Method | Type | Description |
|
|
211
|
+
|---|---|---|
|
|
212
|
+
| `setOnItemClick(OnItemClick<User>)` | Callback | Called when user taps a user |
|
|
213
|
+
| `setSelectionMode(UIKitConstants.SelectionMode)` | Config | `NONE`, `SINGLE`, `MULTIPLE` |
|
|
214
|
+
| `setSearchBoxVisibility(int)` | Visibility | Show/hide search bar |
|
|
215
|
+
| `setUserStatusVisibility(int)` | Visibility | Show/hide online status |
|
|
216
|
+
| `setOnSelection(OnSelection<User>)` | Callback | Called when selection changes |
|
|
217
|
+
|
|
218
|
+
### CometChatGroups
|
|
219
|
+
|
|
220
|
+
Renders a scrollable list of groups.
|
|
221
|
+
|
|
222
|
+
**Key methods:**
|
|
223
|
+
|
|
224
|
+
| Method | Type | Description |
|
|
225
|
+
|---|---|---|
|
|
226
|
+
| `setOnItemClick(OnItemClick<Group>)` | Callback | Called when user taps a group |
|
|
227
|
+
| `setSelectionMode(UIKitConstants.SelectionMode)` | Config | `NONE`, `SINGLE`, `MULTIPLE` |
|
|
228
|
+
| `setSearchBoxVisibility(int)` | Visibility | Show/hide search bar |
|
|
229
|
+
| `setOnSelection(OnSelection<Group>)` | Callback | Called when selection changes |
|
|
230
|
+
|
|
231
|
+
### CometChatGroupMembers
|
|
232
|
+
|
|
233
|
+
Renders the member list for a specific group.
|
|
234
|
+
|
|
235
|
+
**Key methods:**
|
|
236
|
+
|
|
237
|
+
| Method | Type | Description |
|
|
238
|
+
|---|---|---|
|
|
239
|
+
| `setGroup(Group)` | Config | Required — the group to show members for |
|
|
240
|
+
| `setOnItemClick(OnItemClick<GroupMember>)` | Callback | Called when user taps a member |
|
|
241
|
+
| `setSelectionMode(UIKitConstants.SelectionMode)` | Config | `NONE`, `SINGLE`, `MULTIPLE` |
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## 3. Call components
|
|
246
|
+
|
|
247
|
+
### CometChatCallLogs
|
|
248
|
+
|
|
249
|
+
Renders a list of past calls with duration, type, and timestamp.
|
|
250
|
+
|
|
251
|
+
### CometChatIncomingCall
|
|
252
|
+
|
|
253
|
+
Incoming call notification banner with accept/reject buttons. Typically added to your root Activity layout.
|
|
254
|
+
|
|
255
|
+
### CometChatOutgoingCall
|
|
256
|
+
|
|
257
|
+
Outgoing call screen with ringing indicator.
|
|
258
|
+
|
|
259
|
+
### CometChatOngoingCall
|
|
260
|
+
|
|
261
|
+
Active call view (video/audio, controls).
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## 4. Other components
|
|
266
|
+
|
|
267
|
+
### CometChatSearch
|
|
268
|
+
|
|
269
|
+
Search component for finding conversations and messages.
|
|
270
|
+
|
|
271
|
+
### CometChatReactionList
|
|
272
|
+
|
|
273
|
+
Full reaction list showing who reacted with which emoji.
|
|
274
|
+
|
|
275
|
+
### CometChatThreadHeader
|
|
276
|
+
|
|
277
|
+
Thread header with parent message preview and reply count.
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## 5. Shared views (building blocks)
|
|
282
|
+
|
|
283
|
+
These are lower-level views used inside the main components:
|
|
284
|
+
|
|
285
|
+
| View | Description |
|
|
286
|
+
|---|---|
|
|
287
|
+
| `CometChatAvatar` | User/group avatar (image + fallback initials) |
|
|
288
|
+
| `CometChatBadge` | Unread count badge |
|
|
289
|
+
| `CometChatStatusIndicator` | Online/offline status dot |
|
|
290
|
+
| `CometChatMessageReceipt` | Message delivery/read receipt icons |
|
|
291
|
+
| `CometChatDate` | Formatted date display |
|
|
292
|
+
| `CometChatMessageBubble` | Message bubble container |
|
|
293
|
+
| `CometChatEmojiKeyboard` | Emoji picker grid |
|
|
294
|
+
| `CometChatConfirmDialog` | Confirmation dialog |
|
|
295
|
+
| `CometChatPopupMenu` | Context menu / popup menu |
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## 6. Composition patterns
|
|
300
|
+
|
|
301
|
+
### Two-pane chat (conversation list + message view)
|
|
302
|
+
|
|
303
|
+
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.
|
|
304
|
+
|
|
305
|
+
**Java:**
|
|
306
|
+
```java
|
|
307
|
+
// In ConversationsFragment or Activity
|
|
308
|
+
CometChatConversations conversations = findViewById(R.id.conversations);
|
|
309
|
+
conversations.setOnItemClick((view, position, conversation) -> {
|
|
310
|
+
Intent intent = new Intent(this, MessagesActivity.class);
|
|
311
|
+
if (conversation.getConversationType().equals("user")) {
|
|
312
|
+
intent.putExtra("uid", ((User) conversation.getConversationWith()).getUid());
|
|
313
|
+
} else {
|
|
314
|
+
intent.putExtra("guid", ((Group) conversation.getConversationWith()).getGuid());
|
|
315
|
+
}
|
|
316
|
+
startActivity(intent);
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
// In MessagesActivity
|
|
320
|
+
CometChatMessageHeader header = findViewById(R.id.header);
|
|
321
|
+
CometChatMessageList messageList = findViewById(R.id.messageList);
|
|
322
|
+
CometChatMessageComposer composer = findViewById(R.id.composer);
|
|
323
|
+
|
|
324
|
+
String uid = getIntent().getStringExtra("uid");
|
|
325
|
+
if (uid != null) {
|
|
326
|
+
CometChat.getUser(uid, new CometChat.CallbackListener<User>() {
|
|
327
|
+
@Override
|
|
328
|
+
public void onSuccess(User user) {
|
|
329
|
+
header.setUser(user);
|
|
330
|
+
messageList.setUser(user);
|
|
331
|
+
composer.setUser(user);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
@Override
|
|
335
|
+
public void onError(CometChatException e) { }
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
**Kotlin:**
|
|
341
|
+
```kotlin
|
|
342
|
+
// In ConversationsFragment or Activity
|
|
343
|
+
val conversations = findViewById<CometChatConversations>(R.id.conversations)
|
|
344
|
+
conversations.setOnItemClick { view, position, conversation ->
|
|
345
|
+
val intent = Intent(this, MessagesActivity::class.java)
|
|
346
|
+
when (conversation.conversationType) {
|
|
347
|
+
"user" -> intent.putExtra("uid", (conversation.conversationWith as User).uid)
|
|
348
|
+
"group" -> intent.putExtra("guid", (conversation.conversationWith as Group).guid)
|
|
349
|
+
}
|
|
350
|
+
startActivity(intent)
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// In MessagesActivity
|
|
354
|
+
val header = findViewById<CometChatMessageHeader>(R.id.header)
|
|
355
|
+
val messageList = findViewById<CometChatMessageList>(R.id.messageList)
|
|
356
|
+
val composer = findViewById<CometChatMessageComposer>(R.id.composer)
|
|
357
|
+
|
|
358
|
+
val uid = intent.getStringExtra("uid")
|
|
359
|
+
uid?.let {
|
|
360
|
+
CometChat.getUser(it, object : CometChat.CallbackListener<User>() {
|
|
361
|
+
override fun onSuccess(user: User) {
|
|
362
|
+
header.setUser(user)
|
|
363
|
+
messageList.setUser(user)
|
|
364
|
+
composer.setUser(user)
|
|
365
|
+
}
|
|
366
|
+
override fun onError(e: CometChatException) { }
|
|
367
|
+
})
|
|
368
|
+
}
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
### Messages Activity XML layout
|
|
372
|
+
|
|
373
|
+
```xml
|
|
374
|
+
<LinearLayout
|
|
375
|
+
android:layout_width="match_parent"
|
|
376
|
+
android:layout_height="match_parent"
|
|
377
|
+
android:orientation="vertical">
|
|
378
|
+
|
|
379
|
+
<com.cometchat.chatuikit.messageheader.CometChatMessageHeader
|
|
380
|
+
android:id="@+id/header"
|
|
381
|
+
android:layout_width="match_parent"
|
|
382
|
+
android:layout_height="wrap_content" />
|
|
383
|
+
|
|
384
|
+
<com.cometchat.chatuikit.messagelist.CometChatMessageList
|
|
385
|
+
android:id="@+id/messageList"
|
|
386
|
+
android:layout_width="match_parent"
|
|
387
|
+
android:layout_height="0dp"
|
|
388
|
+
android:layout_weight="1" />
|
|
389
|
+
|
|
390
|
+
<com.cometchat.chatuikit.messagecomposer.CometChatMessageComposer
|
|
391
|
+
android:id="@+id/composer"
|
|
392
|
+
android:layout_width="match_parent"
|
|
393
|
+
android:layout_height="wrap_content" />
|
|
394
|
+
|
|
395
|
+
</LinearLayout>
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### Bottom navigation with tabs (Conversations + Users + Groups + Calls)
|
|
399
|
+
|
|
400
|
+
```java
|
|
401
|
+
// In HomeActivity — switch fragments based on bottom nav selection
|
|
402
|
+
binding.bottomNavigationView.setOnItemSelectedListener(item -> {
|
|
403
|
+
Fragment fragment;
|
|
404
|
+
if (item.getItemId() == R.id.nav_chats) {
|
|
405
|
+
fragment = new ChatsFragment();
|
|
406
|
+
} else if (item.getItemId() == R.id.nav_users) {
|
|
407
|
+
fragment = new UsersFragment();
|
|
408
|
+
} else if (item.getItemId() == R.id.nav_groups) {
|
|
409
|
+
fragment = new GroupsFragment();
|
|
410
|
+
} else if (item.getItemId() == R.id.nav_calls) {
|
|
411
|
+
fragment = new CallsFragment();
|
|
412
|
+
} else {
|
|
413
|
+
return false;
|
|
414
|
+
}
|
|
415
|
+
getSupportFragmentManager().beginTransaction()
|
|
416
|
+
.replace(R.id.fragment_container, fragment)
|
|
417
|
+
.commit();
|
|
418
|
+
return true;
|
|
419
|
+
});
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
---
|
|
423
|
+
|
|
424
|
+
## Hard rules
|
|
425
|
+
|
|
426
|
+
- **Never invent component names.** If it's not in this catalog, it doesn't exist.
|
|
427
|
+
- **`setUser()` and `setGroup()` are mutually exclusive.** Set one or the other, never both.
|
|
428
|
+
- **Components require a logged-in user.** Always verify `CometChatUIKit.getLoggedInUser() != null` before mounting.
|
|
429
|
+
- **All components extend `MaterialCardView`.** They can be used in XML or created programmatically.
|
|
430
|
+
- **Thread mode** — `CometChatMessageList.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.
|