@cometchat/skills 4.3.0 → 4.4.1
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/bin/install.js +27 -0
- package/package.json +14 -1
- package/skills/cometchat/SKILL.md +233 -69
- package/skills/cometchat/references/asking-questions.md +48 -0
- package/skills/cometchat-a11y/SKILL.md +3 -2
- package/skills/cometchat-android-v5/SKILL.md +2 -1
- package/skills/cometchat-android-v5-calls/SKILL.md +36 -22
- package/skills/cometchat-android-v5-calls/references/README.md +1 -1
- package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +7 -5
- package/skills/cometchat-android-v5-calls/references/audio-controls.md +4 -4
- package/skills/cometchat-android-v5-calls/references/call-layouts.md +33 -25
- package/skills/cometchat-android-v5-calls/references/call-session.md +2 -2
- package/skills/cometchat-android-v5-calls/references/custom-ui.md +5 -5
- package/skills/cometchat-android-v5-calls/references/event-listeners.md +2 -2
- package/skills/cometchat-android-v5-calls/references/idle-timeout.md +20 -14
- package/skills/cometchat-android-v5-calls/references/in-call-chat.md +1 -1
- package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +43 -27
- package/skills/cometchat-android-v5-calls/references/participant-management.md +3 -3
- package/skills/cometchat-android-v5-calls/references/raise-hand.md +25 -19
- package/skills/cometchat-android-v5-calls/references/recording.md +2 -2
- package/skills/cometchat-android-v5-calls/references/ringing-integration.md +1 -1
- package/skills/cometchat-android-v5-calls/references/screen-sharing.md +5 -9
- package/skills/cometchat-android-v5-calls/references/session-settings.md +3 -3
- package/skills/cometchat-android-v5-calls/references/setup.md +1 -1
- package/skills/cometchat-android-v5-calls/references/share-invite.md +9 -4
- package/skills/cometchat-android-v5-calls/references/video-controls.md +4 -4
- package/skills/cometchat-android-v5-calls/references/voip-calling.md +2 -2
- package/skills/cometchat-android-v5-components/SKILL.md +4 -3
- package/skills/cometchat-android-v5-core/SKILL.md +5 -3
- package/skills/cometchat-android-v5-customization/SKILL.md +171 -7
- package/skills/cometchat-android-v5-extensions/SKILL.md +7 -4
- package/skills/cometchat-android-v5-features/SKILL.md +5 -4
- package/skills/cometchat-android-v5-placement/SKILL.md +2 -1
- package/skills/cometchat-android-v5-production/SKILL.md +2 -1
- package/skills/cometchat-android-v5-push/SKILL.md +2 -3
- package/skills/cometchat-android-v5-testing/SKILL.md +2 -1
- package/skills/cometchat-android-v5-theming/SKILL.md +2 -1
- package/skills/cometchat-android-v5-troubleshooting/SKILL.md +3 -2
- package/skills/cometchat-android-v6/SKILL.md +2 -1
- package/skills/cometchat-android-v6-builder-settings/SKILL.md +11 -7
- package/skills/cometchat-android-v6-calls/SKILL.md +79 -18
- package/skills/cometchat-android-v6-calls/references/advanced-features.md +87 -0
- package/skills/cometchat-android-v6-calls/references/call-layouts.md +24 -15
- package/skills/cometchat-android-v6-calls/references/call-session.md +2 -2
- package/skills/cometchat-android-v6-calls/references/device-management.md +17 -16
- package/skills/cometchat-android-v6-calls/references/idle-timeout.md +7 -4
- package/skills/cometchat-android-v6-calls/references/in-call-chat.md +13 -8
- package/skills/cometchat-android-v6-calls/references/raise-hand.md +6 -4
- package/skills/cometchat-android-v6-compose-components/SKILL.md +52 -29
- package/skills/cometchat-android-v6-compose-customization/SKILL.md +156 -1
- package/skills/cometchat-android-v6-compose-placement/SKILL.md +129 -40
- package/skills/cometchat-android-v6-compose-theming/SKILL.md +27 -1
- package/skills/cometchat-android-v6-core/SKILL.md +208 -28
- package/skills/cometchat-android-v6-events/SKILL.md +4 -1
- package/skills/cometchat-android-v6-extensions/SKILL.md +2 -1
- package/skills/cometchat-android-v6-features/SKILL.md +26 -2
- package/skills/cometchat-android-v6-kotlin-components/SKILL.md +31 -1
- package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +172 -1
- package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +20 -5
- package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +36 -5
- package/skills/cometchat-android-v6-migration/SKILL.md +44 -42
- package/skills/cometchat-android-v6-production/SKILL.md +6 -3
- package/skills/cometchat-android-v6-push/SKILL.md +43 -2
- package/skills/cometchat-android-v6-testing/SKILL.md +11 -8
- package/skills/cometchat-android-v6-troubleshooting/SKILL.md +26 -5
- package/skills/cometchat-angular-calls/SKILL.md +256 -389
- package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +3 -2
- package/skills/cometchat-angular-calls/references/call-layouts.md +29 -12
- package/skills/cometchat-angular-calls/references/call-session.md +2 -2
- package/skills/cometchat-angular-calls/references/custom-ui.md +18 -10
- package/skills/cometchat-angular-calls/references/device-management.md +53 -34
- package/skills/cometchat-angular-calls/references/group-calls.md +45 -24
- package/skills/cometchat-angular-calls/references/idle-timeout.md +31 -15
- package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +7 -6
- package/skills/cometchat-angular-calls/references/raise-hand.md +9 -4
- package/skills/cometchat-angular-calls/references/recording-screen-share.md +32 -39
- package/skills/cometchat-angular-calls/references/ringing-integration.md +3 -1
- package/skills/cometchat-angular-calls/references/share-invite.md +11 -5
- package/skills/cometchat-angular-calls/references/virtual-background.md +29 -0
- package/skills/cometchat-angular-components/SKILL.md +149 -620
- package/skills/cometchat-angular-core/SKILL.md +232 -312
- package/skills/cometchat-angular-customization/SKILL.md +415 -223
- package/skills/cometchat-angular-features/SKILL.md +216 -334
- package/skills/cometchat-angular-patterns/SKILL.md +168 -359
- package/skills/cometchat-angular-placement/SKILL.md +189 -560
- package/skills/cometchat-angular-production/SKILL.md +241 -92
- package/skills/cometchat-angular-push/SKILL.md +280 -294
- package/skills/cometchat-angular-testing/SKILL.md +430 -158
- package/skills/cometchat-angular-theming/SKILL.md +190 -265
- package/skills/cometchat-angular-troubleshooting/SKILL.md +192 -157
- package/skills/cometchat-astro-patterns/SKILL.md +3 -2
- package/skills/cometchat-calls/SKILL.md +25 -19
- package/skills/cometchat-calls/references/use-case-broadcast.md +15 -10
- package/skills/cometchat-calls/references/use-case-marketplace.md +2 -3
- package/skills/cometchat-calls/references/use-case-support.md +3 -4
- package/skills/cometchat-calls/references/use-case-team.md +23 -12
- package/skills/cometchat-calls/references/use-case-telehealth.md +3 -4
- package/skills/cometchat-components/SKILL.md +163 -25
- package/skills/cometchat-core/SKILL.md +258 -20
- package/skills/cometchat-customization/SKILL.md +50 -25
- package/skills/cometchat-features/SKILL.md +314 -35
- package/skills/cometchat-flutter-v5/SKILL.md +10 -4
- package/skills/cometchat-flutter-v5-calls/SKILL.md +188 -158
- package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +48 -24
- package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +20 -15
- package/skills/cometchat-flutter-v5-calls/references/call-session.md +100 -145
- package/skills/cometchat-flutter-v5-calls/references/device-management.md +12 -8
- package/skills/cometchat-flutter-v5-calls/references/group-calls.md +30 -36
- package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +15 -13
- package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +12 -9
- package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +115 -65
- package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +41 -30
- package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +17 -14
- package/skills/cometchat-flutter-v5-calls/references/share-invite.md +8 -2
- package/skills/cometchat-flutter-v5-conversations/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-core/SKILL.md +5 -4
- package/skills/cometchat-flutter-v5-customization/SKILL.md +136 -5
- package/skills/cometchat-flutter-v5-events/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-messages/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-production/SKILL.md +15 -6
- package/skills/cometchat-flutter-v5-push/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-testing/SKILL.md +17 -6
- package/skills/cometchat-flutter-v5-theming/SKILL.md +2 -1
- package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +7 -6
- package/skills/cometchat-flutter-v5-users-groups/SKILL.md +3 -2
- package/skills/cometchat-flutter-v6/SKILL.md +17 -16
- package/skills/cometchat-flutter-v6-calls/SKILL.md +72 -57
- package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +5 -3
- package/skills/cometchat-flutter-v6-calls/references/advanced-features.md +89 -0
- package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +15 -12
- package/skills/cometchat-flutter-v6-calls/references/call-session.md +2 -2
- package/skills/cometchat-flutter-v6-calls/references/device-management.md +9 -3
- package/skills/cometchat-flutter-v6-calls/references/group-calls.md +10 -10
- package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +15 -7
- package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +6 -3
- package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +23 -16
- package/skills/cometchat-flutter-v6-components/SKILL.md +32 -11
- package/skills/cometchat-flutter-v6-conversations/SKILL.md +39 -11
- package/skills/cometchat-flutter-v6-core/SKILL.md +182 -21
- package/skills/cometchat-flutter-v6-customization/SKILL.md +97 -25
- package/skills/cometchat-flutter-v6-events/SKILL.md +3 -2
- package/skills/cometchat-flutter-v6-features/SKILL.md +15 -6
- package/skills/cometchat-flutter-v6-messages/SKILL.md +111 -60
- package/skills/cometchat-flutter-v6-migration/SKILL.md +18 -25
- package/skills/cometchat-flutter-v6-placement/SKILL.md +79 -50
- package/skills/cometchat-flutter-v6-production/SKILL.md +13 -12
- package/skills/cometchat-flutter-v6-push/SKILL.md +41 -19
- package/skills/cometchat-flutter-v6-testing/SKILL.md +4 -4
- package/skills/cometchat-flutter-v6-theming/SKILL.md +38 -5
- package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +182 -17
- package/skills/cometchat-flutter-v6-users-groups/SKILL.md +12 -4
- package/skills/cometchat-i18n/SKILL.md +140 -79
- package/skills/cometchat-ios/SKILL.md +4 -2
- package/skills/cometchat-ios-calls/SKILL.md +225 -95
- package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +11 -9
- package/skills/cometchat-ios-calls/references/audio-modes-and-controls.md +45 -0
- package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +6 -7
- package/skills/cometchat-ios-calls/references/call-layouts.md +31 -91
- package/skills/cometchat-ios-calls/references/call-session.md +51 -54
- package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +33 -29
- package/skills/cometchat-ios-calls/references/custom-ui.md +38 -38
- package/skills/cometchat-ios-calls/references/group-calls.md +33 -70
- package/skills/cometchat-ios-calls/references/idle-timeout.md +24 -25
- package/skills/cometchat-ios-calls/references/in-call-chat.md +19 -23
- package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +128 -70
- package/skills/cometchat-ios-calls/references/picture-in-picture.md +20 -20
- package/skills/cometchat-ios-calls/references/raise-hand.md +14 -227
- package/skills/cometchat-ios-calls/references/recording-screen-share.md +35 -122
- package/skills/cometchat-ios-calls/references/ringing-integration.md +17 -16
- package/skills/cometchat-ios-calls/references/share-invite.md +8 -12
- package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +4 -4
- package/skills/cometchat-ios-components/SKILL.md +200 -12
- package/skills/cometchat-ios-core/SKILL.md +173 -45
- package/skills/cometchat-ios-customization/SKILL.md +276 -110
- package/skills/cometchat-ios-features/SKILL.md +64 -36
- package/skills/cometchat-ios-placement/SKILL.md +15 -12
- package/skills/cometchat-ios-production/SKILL.md +12 -4
- package/skills/cometchat-ios-push/SKILL.md +53 -19
- package/skills/cometchat-ios-testing/SKILL.md +14 -9
- package/skills/cometchat-ios-theming/SKILL.md +39 -3
- package/skills/cometchat-ios-troubleshooting/SKILL.md +41 -21
- package/skills/cometchat-native-bare-patterns/SKILL.md +36 -19
- package/skills/cometchat-native-calls/SKILL.md +29 -17
- package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +2 -2
- package/skills/cometchat-native-calls/references/call-layouts.md +15 -14
- package/skills/cometchat-native-calls/references/call-session.md +2 -2
- package/skills/cometchat-native-calls/references/custom-ui.md +12 -8
- package/skills/cometchat-native-calls/references/device-management.md +53 -30
- package/skills/cometchat-native-calls/references/group-calls.md +35 -30
- package/skills/cometchat-native-calls/references/idle-timeout.md +6 -6
- package/skills/cometchat-native-calls/references/in-call-chat.md +10 -8
- package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +2 -2
- package/skills/cometchat-native-calls/references/raise-hand.md +15 -13
- package/skills/cometchat-native-calls/references/recording-screen-share.md +49 -170
- package/skills/cometchat-native-calls/references/share-invite.md +7 -5
- package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +4 -2
- package/skills/cometchat-native-components/SKILL.md +84 -52
- package/skills/cometchat-native-core/SKILL.md +102 -33
- package/skills/cometchat-native-customization/SKILL.md +150 -28
- package/skills/cometchat-native-expo-patterns/SKILL.md +60 -29
- package/skills/cometchat-native-features/SKILL.md +24 -17
- package/skills/cometchat-native-placement/SKILL.md +19 -10
- package/skills/cometchat-native-production/SKILL.md +9 -3
- package/skills/cometchat-native-push/SKILL.md +2 -1
- package/skills/cometchat-native-testing/SKILL.md +1 -2
- package/skills/cometchat-native-theming/SKILL.md +54 -29
- package/skills/cometchat-native-troubleshooting/SKILL.md +11 -5
- package/skills/cometchat-nextjs-patterns/SKILL.md +22 -8
- package/skills/cometchat-placement/SKILL.md +42 -3
- package/skills/cometchat-production/SKILL.md +12 -5
- package/skills/cometchat-react-calls/SKILL.md +220 -10
- package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +4 -3
- package/skills/cometchat-react-calls/references/call-layouts.md +5 -6
- package/skills/cometchat-react-calls/references/call-session.md +1 -1
- package/skills/cometchat-react-calls/references/custom-ui.md +61 -15
- package/skills/cometchat-react-calls/references/device-management.md +55 -51
- package/skills/cometchat-react-calls/references/group-calls.md +18 -23
- package/skills/cometchat-react-calls/references/idle-timeout.md +25 -12
- package/skills/cometchat-react-calls/references/in-call-chat.md +7 -7
- package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +9 -11
- package/skills/cometchat-react-calls/references/raise-hand.md +14 -14
- package/skills/cometchat-react-calls/references/recording-screen-share.md +39 -38
- package/skills/cometchat-react-calls/references/ringing-integration.md +2 -2
- package/skills/cometchat-react-calls/references/share-invite.md +4 -5
- package/skills/cometchat-react-calls/references/testing-calls-on-web.md +20 -2
- package/skills/cometchat-react-calls/references/virtual-background.md +32 -0
- package/skills/cometchat-react-patterns/SKILL.md +45 -5
- package/skills/cometchat-react-push/SKILL.md +258 -72
- package/skills/cometchat-react-router-patterns/SKILL.md +12 -6
- package/skills/cometchat-react-testing/SKILL.md +14 -5
- package/skills/cometchat-theming/SKILL.md +181 -18
- package/skills/cometchat-troubleshooting/SKILL.md +40 -20
|
@@ -3,13 +3,14 @@ name: cometchat-android-v6-kotlin-customization
|
|
|
3
3
|
description: "CometChat Android UIKit v6 Kotlin Views customization — BubbleFactory abstract class, BubbleViewProvider, style classes, and per-slot overrides"
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "Android 9.0+ (API 28); Kotlin 1.9+; com.cometchat:chatuikit-kotlin-android:6.x"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "cometchat, android, kotlin-views, customization, bubble-factory, bubble-view-provider, style"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **Ground truth:** `com.cometchat:chatuikit-{compose,kotlin}-android:6.x` (+ `calls-sdk-android:5.x`) — resolved AAR (javap) + `ui-kit/android/v6`. **Official docs:** https://www.cometchat.com/docs/ui-kit/android/v6/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.
|
|
13
|
+
|
|
13
14
|
> **Companion skills:** cometchat-android-v6-compose-customization (Compose equivalent), cometchat-android-v6-kotlin-components, cometchat-android-v6-kotlin-theming, cometchat-android-v6-extensions (DataSource layer), cometchat-android-v6-events
|
|
14
15
|
|
|
15
16
|
## Purpose
|
|
@@ -156,6 +157,157 @@ val key = BubbleFactory.getFactoryKey(message) // "category_type" or "deleted"
|
|
|
156
157
|
val key = BubbleFactory.getKey("custom", "location") // "custom_location"
|
|
157
158
|
```
|
|
158
159
|
|
|
160
|
+
### 1.8 Registering a factory is already additive — built-ins are NOT in the map
|
|
161
|
+
|
|
162
|
+
`CometChatMessageList` exposes exactly two factory APIs (`CometChatMessageList.kt:3376 / :3395`):
|
|
163
|
+
|
|
164
|
+
- `setBubbleFactories(factories: List<BubbleFactory>)` — sets the custom factory map
|
|
165
|
+
- `getBubbleFactories(): Map<String, BubbleFactory>` — returns an immutable copy
|
|
166
|
+
|
|
167
|
+
There is **NO** settable `bubbleFactories` property and **NO** `removeBubbleFactory(...)` on `CometChatMessageList` (`removeBubbleFactory` exists only on the internal `MessageAdapter`, `MessageAdapter.kt:1534` — not public API).
|
|
168
|
+
|
|
169
|
+
`setBubbleFactories` does NOT wipe built-in bubbles, because **built-in types are never stored as factory entries.** The adapter starts with an empty factory map (`MessageAdapter.kt:153` "The adapter starts with an empty bubbleFactories map"); when a message's `"category_type"` key has no factory, the bubble falls back to `InternalContentRenderer`. So passing only your custom factories is correct and safe:
|
|
170
|
+
|
|
171
|
+
```kotlin
|
|
172
|
+
messageList.setBubbleFactories(listOf(
|
|
173
|
+
LocationBubbleFactory(), // custom_location
|
|
174
|
+
PaymentBubbleFactory() // custom_payment
|
|
175
|
+
))
|
|
176
|
+
// text/image/video/etc. still render via InternalContentRenderer — untouched
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
`setBubbleFactories` replaces the *custom* factory set, so include every custom factory you want active in the single list. `BubbleFactory.getKey(category, type)` and `BubbleFactory.getFactoryKey(message)` (companion, `BubbleFactory.kt:441 / :425`) are still available if you need the key string.
|
|
180
|
+
|
|
181
|
+
### 1.9 Custom attachment options (Scenario 3)
|
|
182
|
+
|
|
183
|
+
`CometChatMessageComposer` exposes `addAttachmentOption(action)` (append one) and `setAttachmentOptions(list)` (set the custom list) — `CometChatMessageComposer.kt:4951 / :4930`, both delegate to the shared `CometChatMessageComposerViewModel`.
|
|
184
|
+
|
|
185
|
+
**Neither call drops the built-in options.** Both touch only the *custom* options list (`_customAttachmentOptions`); the defaults (camera/image/video/audio/document/poll/collab-doc/collab-whiteboard) are rebuilt every time by `getDefaultAttachmentOptions(...)` and the custom ones are appended at the end (`CometChatMessageComposerViewModel.kt:646-649`). So `setAttachmentOptions(listOf(location))` keeps the defaults too — it just replaces any *previously-set custom* options. Use `addAttachmentOption` to add one without disturbing other custom options:
|
|
186
|
+
|
|
187
|
+
```kotlin
|
|
188
|
+
val location = CometChatMessageComposerAction(
|
|
189
|
+
id = "location",
|
|
190
|
+
title = "Send Location",
|
|
191
|
+
icon = R.drawable.ic_location,
|
|
192
|
+
onClick = OnClick { /* pick + send (see 1.10) */ }
|
|
193
|
+
)
|
|
194
|
+
messageComposer.addAttachmentOption(location) // appends one custom option
|
|
195
|
+
// setAttachmentOptions(listOf(location)) also keeps camera/image/etc. — it only resets the custom list
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
> To hide a built-in option, use the composer visibility setters (e.g. `setPollOptionVisibility(View.GONE)`), which flip the `_show*Option` flags `getDefaultAttachmentOptions` checks. The built-in IDs are constants on `CometChatMessageComposerAction` (`ID_CAMERA`…`ID_COLLABORATIVE_WHITEBOARD`, `CometChatMessageComposerAction.kt:42-49`).
|
|
199
|
+
|
|
200
|
+
### 1.10 Sending a custom message — use the UIKit path, not the raw SDK
|
|
201
|
+
|
|
202
|
+
```kotlin
|
|
203
|
+
val message = CustomMessage(
|
|
204
|
+
receiverId,
|
|
205
|
+
CometChatConstants.RECEIVER_TYPE_USER, // or RECEIVER_TYPE_GROUP
|
|
206
|
+
"location", // matches the BubbleFactory type
|
|
207
|
+
customData // org.json.JSONObject
|
|
208
|
+
)
|
|
209
|
+
// ✅ kit path — sets muid + sender, fires ccMessageSent → list APPENDS
|
|
210
|
+
CometChatUIKit.sendCustomMessage(message, object : CometChat.CallbackListener<CustomMessage>() {
|
|
211
|
+
override fun onSuccess(p0: CustomMessage) {}
|
|
212
|
+
override fun onError(p0: CometChatException) {}
|
|
213
|
+
})
|
|
214
|
+
// ❌ CometChat.sendCustomMessage(...) — no muid/sender/event → recipient error + realtime replace
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Verified (v6 Kotlin Views): `CometChatMessageList.setBubbleFactories(List) / getBubbleFactories(): Map` (`CometChatMessageList.kt:3376 / :3395`), `CometChatMessageComposer.addAttachmentOption / setAttachmentOptions` (`:4951 / :4930`), `CometChatUIKit.sendCustomMessage(CustomMessage, CallbackListener)` (`CometChatUIKit.kt:472`). Note: `messageList.bubbleFactories = …` (property) and `CometChatMessageList.removeBubbleFactory(...)` are NOT public — do not use.
|
|
218
|
+
|
|
219
|
+
### 1.11 Override an EXISTING type's bubble (Scenario 2)
|
|
220
|
+
|
|
221
|
+
To replace a built-in type's rendering, subclass `BubbleFactory` with `getCategory()`/`getType()` set to the built-in identifiers, then register it. As in §1.8, built-ins are not factory entries — a matching factory simply takes priority over `InternalContentRenderer`.
|
|
222
|
+
|
|
223
|
+
```kotlin
|
|
224
|
+
import com.cometchat.chat.constants.CometChatConstants
|
|
225
|
+
|
|
226
|
+
class MyTextBubbleFactory : BubbleFactory() {
|
|
227
|
+
override fun getCategory(): String = CometChatConstants.CATEGORY_MESSAGE // "message"
|
|
228
|
+
override fun getType(): String = CometChatConstants.MESSAGE_TYPE_TEXT // "text"
|
|
229
|
+
|
|
230
|
+
override fun createContentView(context: Context): View = MyTextContentView(context)
|
|
231
|
+
|
|
232
|
+
override fun bindContentView(
|
|
233
|
+
view: View,
|
|
234
|
+
message: BaseMessage,
|
|
235
|
+
alignment: UIKitConstants.MessageBubbleAlignment,
|
|
236
|
+
holder: RecyclerView.ViewHolder?,
|
|
237
|
+
position: Int
|
|
238
|
+
) {
|
|
239
|
+
(view as MyTextContentView).bind(message as TextMessage)
|
|
240
|
+
}
|
|
241
|
+
// …or override createBubbleView()/bindBubbleView() (see 1.3) to replace the whole bubble
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
messageList.setBubbleFactories(listOf(MyTextBubbleFactory()))
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Only `message_text` is overridden; other types keep their internal rendering.
|
|
248
|
+
|
|
249
|
+
### 1.12 Add a long-press message option (Scenario 4 — Forward-style)
|
|
250
|
+
|
|
251
|
+
`CometChatMessageList` resolves the long-press option sheet through the shared view model. Two public setters control it (`CometChatMessageList.kt:3697 / :3709`):
|
|
252
|
+
|
|
253
|
+
- `setOptions(callback: (BaseMessage) -> List<CometChatMessageOption>?)` — **replaces** defaults when the callback returns non-null (return `null` to keep them); takes precedence over `addOptions`.
|
|
254
|
+
- `addOptions(callback: (BaseMessage) -> List<CometChatMessageOption>)` — **appends** after the defaults; invoked only when `setOptions` is unset or returns `null`.
|
|
255
|
+
|
|
256
|
+
Use `addOptions` so the built-in Reply/Copy/Edit/Delete survive:
|
|
257
|
+
|
|
258
|
+
```kotlin
|
|
259
|
+
import com.cometchat.uikit.core.domain.model.CometChatMessageOption
|
|
260
|
+
|
|
261
|
+
messageList.addOptions { message -> // ✅ appended to defaults
|
|
262
|
+
listOf(
|
|
263
|
+
CometChatMessageOption(
|
|
264
|
+
id = "forward",
|
|
265
|
+
title = "Forward",
|
|
266
|
+
icon = R.drawable.ic_forward,
|
|
267
|
+
onClick = { /* open forward picker for `message` */ }
|
|
268
|
+
)
|
|
269
|
+
)
|
|
270
|
+
}
|
|
271
|
+
// ❌ messageList.setOptions { listOf(forward) } // would DROP reply/copy/edit/delete
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
For the click handler use `setMessageOptionClickListener(MessageOptionClickListener)` (`CometChatMessageList.kt:3671`). Resolution order verified in `CometChatMessageListViewModel.resolveMessageOptions` (`:817-827`): `setOptions` non-null wins, else `defaultOptions + addOptions`. `CometChatMessageOption(id, title, …, onClick)` is a data class at `CometChatMessageOption.kt:21`.
|
|
275
|
+
|
|
276
|
+
### 1.13 MessageTemplate via the DataSource (docs-taught alternative to BubbleFactory)
|
|
277
|
+
|
|
278
|
+
> ⚠️ **Verify before using — symbols not found in the GA v6 Kotlin-Views source.** `CometChatUIKit.getDataSource()`, `getMessageTemplates()`, `CometChatMessageTemplate`, `setTemplates(...)`, and `MessagesViewHolderListener` appear in the Android **docs** but are **absent from the verified `com.cometchat.uikit.kotlin` / `chatuikit-core` GA source** (they're the legacy `com.cometchat.chatuikit` v5-shaped API). Treat this section as a docs reference that may not compile against your installed v6 kit — **prefer `BubbleFactory` / `BubbleViewProvider` (the confirmed v6-native path) for all new code.**
|
|
279
|
+
|
|
280
|
+
The `BubbleFactory` / `BubbleViewProvider` surface above is the primary v6 customization path. The Android docs also teach a **`MessageTemplate`** path through the data source ([message-template](https://www.cometchat.com/docs/ui-kit/android/v6/message-template)) — fetch the existing templates, mutate the one you want via the `MessagesViewHolderListener` create/bind pair, then re-apply with `setTemplates(...)` (append, never replace with a single-item list):
|
|
281
|
+
|
|
282
|
+
```kotlin
|
|
283
|
+
// 1. fetch existing templates from the data source
|
|
284
|
+
val templates = CometChatUIKit.getDataSource()
|
|
285
|
+
.getMessageTemplates(messageList.additionParameter)
|
|
286
|
+
.toMutableList()
|
|
287
|
+
|
|
288
|
+
// 2. mutate the matched template (or build a new one for a custom type)
|
|
289
|
+
templates.find { it.type == UIKitConstants.MessageType.TEXT }
|
|
290
|
+
?.setContentView(object : MessagesViewHolderListener() {
|
|
291
|
+
override fun createView(context: Context, bubble: CometChatMessageBubble,
|
|
292
|
+
alignment: UIKitConstants.MessageBubbleAlignment): View =
|
|
293
|
+
LayoutInflater.from(context).inflate(R.layout.your_custom_layout, null)
|
|
294
|
+
override fun bindView(context: Context, view: View, message: BaseMessage,
|
|
295
|
+
alignment: UIKitConstants.MessageBubbleAlignment,
|
|
296
|
+
viewHolder: RecyclerView.ViewHolder, list: List<BaseMessage>, i: Int) { /* bind */ }
|
|
297
|
+
})
|
|
298
|
+
// new custom type:
|
|
299
|
+
val contact = CometChatMessageTemplate().apply {
|
|
300
|
+
setType("contact"); setCategory(UIKitConstants.MessageCategory.CUSTOM)
|
|
301
|
+
setContentView(/* MessagesViewHolderListener */)
|
|
302
|
+
}
|
|
303
|
+
templates.add(contact)
|
|
304
|
+
|
|
305
|
+
// 3. re-apply — Views uses setTemplates(...)
|
|
306
|
+
messageList.setTemplates(templates)
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
Views templates expose listener-based slot setters (`setContentView`, `setHeaderView`, `setFooterView`, `setBottomView`, `setStatusInfoView`, `setBubbleView`, `setOptions`) mirroring §1.4's slots. Prefer `BubbleFactory` for new code; use `getMessageTemplates(...)` + `setTemplates(...)` when you want to start from the kit's defaults and tweak one type. (This overlaps the custom-message topic.)
|
|
310
|
+
|
|
159
311
|
## 2. BubbleViewProvider (Per-Slot Overrides)
|
|
160
312
|
|
|
161
313
|
`BubbleViewProvider` is a simpler interface for overriding individual slots across ALL message types.
|
|
@@ -257,6 +409,21 @@ messageList.setStyle(style)
|
|
|
257
409
|
| No bubble replacement | `createBubbleView()` for complete replacement |
|
|
258
410
|
| Theme-level styling only | Per-factory `getBubbleStyle()` |
|
|
259
411
|
|
|
412
|
+
## Text formatters (inline mentions / URLs / custom tokens)
|
|
413
|
+
|
|
414
|
+
Style/transform message text inline via `setTextFormatters(...)` on the composer and message list. The kit ships `CometChatMentionsFormatter` + `CometChatRichTextFormatter` (subclasses of the abstract `CometChatTextFormatter`) in `com.cometchat.uikit.kotlin.shared.formatters`. To ADD a custom one, include the defaults too (a bare list replaces them).
|
|
415
|
+
|
|
416
|
+
```kotlin
|
|
417
|
+
import com.cometchat.uikit.kotlin.shared.formatters.CometChatMentionsFormatter
|
|
418
|
+
import com.cometchat.uikit.kotlin.shared.formatters.CometChatTextFormatter
|
|
419
|
+
|
|
420
|
+
val formatters = listOf<CometChatTextFormatter>(CometChatMentionsFormatter(context) /* , YourFormatter(context) */)
|
|
421
|
+
composer.setTextFormatters(formatters) // fun setTextFormatters(List<CometChatTextFormatter>?)
|
|
422
|
+
messageList.setTextFormatters(formatters)
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
For a custom @/#/! token: subclass `CometChatTextFormatter(trackingCharacter)` and implement its `search()` + view hooks (the kit's `shared/formatters/README.md` shows the mentions example: `setMentionLimit` / `setMentionsType` / `setOnMentionClick` / `setMentionStyle`).
|
|
426
|
+
|
|
260
427
|
## Hard rules
|
|
261
428
|
|
|
262
429
|
- BubbleFactory is an `abstract class` — extend it with `BubbleFactory()`
|
|
@@ -266,3 +433,7 @@ messageList.setStyle(style)
|
|
|
266
433
|
- For per-type content customization, use BubbleFactory. For cross-type slot overrides, use BubbleViewProvider
|
|
267
434
|
- `onViewRecycled()` is critical for cleaning up image loads, animations, or media playback
|
|
268
435
|
- Do NOT confuse BubbleFactory (UI rendering) with DataSource (data fetching) — they are separate layers
|
|
436
|
+
|
|
437
|
+
## Sound (in-app message + call sounds)
|
|
438
|
+
|
|
439
|
+
Sound is a customization sub-dimension. The UI Kit plays incoming/outgoing message + call sounds via `CometChatSoundManager` — mute it, swap custom audio, or play a specific sound. The full API + recipe lives in **`cometchat-android-v6-kotlin-theming`** (Sound section). Verify the access path against the installed kit before relying on it.
|
|
@@ -3,18 +3,19 @@ name: cometchat-android-v6-kotlin-placement
|
|
|
3
3
|
description: "CometChat Android UIKit v6 Kotlin Views placement — Activity, Fragment, BottomSheet, Tab, and Intent navigation patterns"
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "Android 9.0+ (API 28); Kotlin 1.9+; com.cometchat:chatuikit-kotlin-android:6.x"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.1"
|
|
10
9
|
tags: "cometchat, android, kotlin-views, placement, activity, fragment, navigation, tabs"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **Ground truth:** `com.cometchat:chatuikit-kotlin-android:6.x` Views + `docs/ui-kit/android/v6`. **Official docs:** https://www.cometchat.com/docs/ui-kit/android/v6/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.
|
|
13
|
+
|
|
13
14
|
> **Companion skills:** cometchat-android-v6-compose-placement (Compose equivalent), cometchat-android-v6-kotlin-components, cometchat-android-v6-kotlin-theming
|
|
14
15
|
|
|
15
16
|
## Purpose
|
|
16
17
|
|
|
17
|
-
Place CometChat Kotlin Views components into Activities, Fragments, BottomSheets, and Tab layouts. Patterns derived from `
|
|
18
|
+
Place CometChat Kotlin Views components into Activities, Fragments, BottomSheets, and Tab layouts. Patterns derived from `sample-app-kotlin`.
|
|
18
19
|
|
|
19
20
|
## Use this skill when
|
|
20
21
|
|
|
@@ -50,7 +51,7 @@ class ConversationsActivity : AppCompatActivity() {
|
|
|
50
51
|
|
|
51
52
|
### 1.2 Messages Activity
|
|
52
53
|
|
|
53
|
-
Pattern from `
|
|
54
|
+
Pattern from `sample-app-kotlin/.../ui/messages/MessagesActivity.kt`:
|
|
54
55
|
|
|
55
56
|
```kotlin
|
|
56
57
|
class MessagesActivity : AppCompatActivity() {
|
|
@@ -58,10 +59,21 @@ class MessagesActivity : AppCompatActivity() {
|
|
|
58
59
|
super.onCreate(savedInstanceState)
|
|
59
60
|
setContentView(R.layout.activity_messages)
|
|
60
61
|
|
|
62
|
+
// Pad the root for the status/navigation bars (root has fitsSystemWindows="true").
|
|
63
|
+
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.parent_view)) { view, insets ->
|
|
64
|
+
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
|
65
|
+
view.setPadding(systemBars.left, systemBars.top, systemBars.right, 0)
|
|
66
|
+
insets
|
|
67
|
+
}
|
|
68
|
+
|
|
61
69
|
val header = findViewById<CometChatMessageHeader>(R.id.messageHeader)
|
|
62
70
|
val messageList = findViewById<CometChatMessageList>(R.id.messageList)
|
|
63
71
|
val composer = findViewById<CometChatMessageComposer>(R.id.messageComposer)
|
|
64
72
|
|
|
73
|
+
// Show + wire the back button (the kit does not finish the Activity for you).
|
|
74
|
+
header.setBackButtonVisibility(View.VISIBLE)
|
|
75
|
+
header.setOnBackPress { finish() }
|
|
76
|
+
|
|
65
77
|
// Set user or group
|
|
66
78
|
header.setUser(user)
|
|
67
79
|
messageList.setUser(user)
|
|
@@ -75,13 +87,16 @@ class MessagesActivity : AppCompatActivity() {
|
|
|
75
87
|
}
|
|
76
88
|
```
|
|
77
89
|
|
|
78
|
-
XML layout:
|
|
90
|
+
XML layout — the root carries `android:fitsSystemWindows="true"` (so the inset listener above receives system-bar insets) and `?attr/cometchatBackgroundColor1`:
|
|
79
91
|
|
|
80
92
|
```xml
|
|
81
93
|
<?xml version="1.0" encoding="utf-8"?>
|
|
82
94
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
95
|
+
android:id="@+id/parent_view"
|
|
83
96
|
android:layout_width="match_parent"
|
|
84
97
|
android:layout_height="match_parent"
|
|
98
|
+
android:background="?attr/cometchatBackgroundColor1"
|
|
99
|
+
android:fitsSystemWindows="true"
|
|
85
100
|
android:orientation="vertical">
|
|
86
101
|
|
|
87
102
|
<com.cometchat.uikit.kotlin.presentation.messageheader.ui.CometChatMessageHeader
|
|
@@ -192,7 +207,7 @@ dialog.show()
|
|
|
192
207
|
|
|
193
208
|
## 6. App Flow Pattern
|
|
194
209
|
|
|
195
|
-
|
|
210
|
+
Pattern from `sample-app-kotlin/.../ui/home/HomeActivity.kt` — a single Activity hosts the chat flow via Fragment transactions:
|
|
196
211
|
|
|
197
212
|
```kotlin
|
|
198
213
|
class AppFlowActivity : AppCompatActivity() {
|
|
@@ -3,13 +3,14 @@ name: cometchat-android-v6-kotlin-theming
|
|
|
3
3
|
description: "CometChat Android UIKit v6 Kotlin Views theming — CometChatTheme singleton, XML attributes, programmatic overrides, typography, and dark mode"
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "Android 9.0+ (API 28); Kotlin 1.9+; com.cometchat:chatuikit-kotlin-android:6.x"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "cometchat, android, kotlin-views, theming, xml-attrs, colors, typography, dark-mode"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **Ground truth:** `com.cometchat:chatuikit-{compose,kotlin}-android:6.x` (+ `calls-sdk-android:5.x`) — resolved AAR (javap) + `ui-kit/android/v6`. **Official docs:** https://www.cometchat.com/docs/ui-kit/android/v6/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.
|
|
13
|
+
|
|
13
14
|
> **Companion skills:** cometchat-android-v6-compose-theming (Compose equivalent), cometchat-android-v6-kotlin-components, cometchat-android-v6-kotlin-customization
|
|
14
15
|
|
|
15
16
|
## Purpose
|
|
@@ -47,10 +48,14 @@ CometChatTheme.setErrorColor(Color.RED)
|
|
|
47
48
|
|
|
48
49
|
## 2. XML Theme Attributes
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
> **The app/activity theme MUST extend `CometChatTheme.DayNight` (required — components crash without it).** The kit ships `CometChatTheme.DayNight` (parent `Theme.MaterialComponents.DayNight.NoActionBar`), which defines every `cometchat*` theme attribute the component layouts reference. Parenting a plain `Theme.MaterialComponents` / `Theme.Material3` / `Theme.AppCompat` instead leaves those attrs unresolved and the **first component inflate crashes** — e.g. `CometChatConversations` (which inflates a `MaterialButton`/`MaterialCardView`) throws `java.lang.UnsupportedOperationException: Failed to resolve attribute …` or `IllegalArgumentException: requires your app theme to be Theme.MaterialComponents`. Set it in `AndroidManifest.xml` via `android:theme="@style/AppTheme"` (or `android:theme="@style/CometChatTheme.DayNight"` directly). Verified by building + running on-device, 2026-06-11.
|
|
52
|
+
|
|
53
|
+
Define theme colors in your app's `styles.xml` or `themes.xml`, parenting the kit theme:
|
|
51
54
|
|
|
52
55
|
```xml
|
|
53
|
-
|
|
56
|
+
<!-- parent MUST be CometChatTheme.DayNight (or a descendant) -->
|
|
57
|
+
<style name="AppTheme" parent="CometChatTheme.DayNight">
|
|
58
|
+
<!-- Override only what you want; the parent supplies all defaults. -->
|
|
54
59
|
<!-- Primary -->
|
|
55
60
|
<item name="cometchatPrimaryColor">#6851D6</item>
|
|
56
61
|
|
|
@@ -129,7 +134,7 @@ Extended primary colors auto-generate by blending primary with white (day) or bl
|
|
|
129
134
|
|
|
130
135
|
All follow the same pattern: `get{Token}(ctx)` / `set{Token}(color)` / `cometchat{Token}` XML attr. Defaults fall back to neutral scale values if not explicitly set.
|
|
131
136
|
|
|
132
|
-
Border color aliases: `getBorderColorLight()` = `getStrokeColorLight()`,
|
|
137
|
+
Border color aliases: `getBorderColorLight()` = `getStrokeColorLight()`, `getBorderColorDefault()` = `getStrokeColorDefault()`, `getBorderColorDark()` = `getStrokeColorDark()`. Note: `StrokeColor` also has a `Highlight` variant (`getStrokeColorHighlight()`); there is **no** `getBorderColorHighlight()`.
|
|
133
138
|
|
|
134
139
|
## 4. Typography
|
|
135
140
|
|
|
@@ -138,7 +143,8 @@ Border color aliases: `getBorderColorLight()` = `getStrokeColorLight()`, etc.
|
|
|
138
143
|
val titleBold: Int = CometChatTheme.getTextAppearanceTitleBold(context)
|
|
139
144
|
val bodyRegular: Int = CometChatTheme.getTextAppearanceBodyRegular(context)
|
|
140
145
|
val heading1Medium: Int = CometChatTheme.getTextAppearanceHeading1Medium(context)
|
|
141
|
-
// ...
|
|
146
|
+
// ... combinations: Title, Heading1-4, Body, Caption1-2, Button each have Regular/Medium/Bold.
|
|
147
|
+
// Link is the exception — only getTextAppearanceLinkRegular(context) exists (no Medium/Bold).
|
|
142
148
|
|
|
143
149
|
// Get font resource IDs
|
|
144
150
|
val regularFont: Int = CometChatTheme.getFontRegular(context)
|
|
@@ -193,6 +199,31 @@ val black: Int = CometChatTheme.getColorBlack(context)
|
|
|
193
199
|
val transparent: Int = CometChatTheme.getColorTransparent(context)
|
|
194
200
|
```
|
|
195
201
|
|
|
202
|
+
## Localization
|
|
203
|
+
|
|
204
|
+
To translate the UI, switch the active language, or override individual strings, route to the dedicated **`cometchat-i18n`** skill — the canonical cross-family localization reference. Android uses `CometChatLocalize.setLocale(context, Language.Code.<lang>)` / `getLocale(context)` (a separate method, **not** an `init` object — unlike web/RN). `cometchat-i18n` covers bundled languages, custom translations, and RTL. Docs: https://www.cometchat.com/docs/ui-kit/android/localize
|
|
205
|
+
|
|
206
|
+
## Sound Manager — custom notification & call sounds
|
|
207
|
+
|
|
208
|
+
Sounds are a **behavioral** customization — driven by `CometChatSoundManager`, an **instance** class that needs a `Context`. The UI Kit plays the built-in cues automatically; use this to override a cue with your own raw resource. V6 package (NOT the V5 `com.cometchat.chatuikit.*` path):
|
|
209
|
+
|
|
210
|
+
```kotlin
|
|
211
|
+
import com.cometchat.uikit.core.resources.soundmanager.CometChatSoundManager
|
|
212
|
+
import com.cometchat.uikit.core.resources.soundmanager.Sound
|
|
213
|
+
|
|
214
|
+
val soundManager = CometChatSoundManager(context)
|
|
215
|
+
|
|
216
|
+
// Play a default cue — Sound enum is SCREAMING_SNAKE_CASE: INCOMING_CALL |
|
|
217
|
+
// OUTGOING_CALL | INCOMING_MESSAGE | INCOMING_MESSAGE_FROM_OTHER | OUTGOING_MESSAGE
|
|
218
|
+
soundManager.play(Sound.INCOMING_CALL)
|
|
219
|
+
|
|
220
|
+
// Override with your own raw resource (R.raw.*)
|
|
221
|
+
soundManager.play(Sound.INCOMING_MESSAGE, R.raw.my_ping)
|
|
222
|
+
|
|
223
|
+
// Stop whatever is playing
|
|
224
|
+
soundManager.pause()
|
|
225
|
+
```
|
|
226
|
+
|
|
196
227
|
## Hard rules
|
|
197
228
|
|
|
198
229
|
- ALWAYS pass a valid `Context` to getter methods — they resolve XML attributes from the theme
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cometchat-android-v6-migration
|
|
3
|
-
description: V5→V6 migration recipes for native Android. CometChat ships V5 (chat-uikit-android:5.x — Java + Kotlin Views) and V6
|
|
3
|
+
description: V5→V6 migration recipes for native Android. CometChat ships V5 (chat-uikit-android:5.x — Java + Kotlin Views) and V6 (chatuikit-{compose,kotlin}-android:6.x — GA 2026-05-25 — Compose surface OR Kotlin Views, calls bundled) side-by-side. Covers when to migrate vs stay, the cohort-selection decision (Compose vs Kotlin Views on V6), gradle dependency rewrites, builder API changes (UIKitSettings replaces UIKitSettingsBuilder), theme system rewrite (CometChatTheme.DayNight), calls integration delta (calling UI bundled, but calls-sdk-android:5.0.+ is still a required peer dep), Activity theme rules, side-by-side cohort selection during migration, and a verification checklist.
|
|
4
4
|
license: "MIT"
|
|
5
|
-
compatibility: "Migrating FROM com.cometchat:chat-uikit-android:5.x TO com.cometchat:chatuikit-{compose,kotlin}-android:6.0
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list, ask-user"
|
|
5
|
+
compatibility: "Migrating FROM com.cometchat:chat-uikit-android:5.x TO com.cometchat:chatuikit-{compose,kotlin}-android:6.0.+; minSdk 28+ (V6 raised the floor from 21 to 28); Kotlin >= 1.9 for V6 Compose"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "4.0.0"
|
|
@@ -12,7 +11,7 @@ metadata:
|
|
|
12
11
|
|
|
13
12
|
## Purpose
|
|
14
13
|
|
|
15
|
-
Migration recipes for moving from CometChat Android UIKit V5 (`chat-uikit-android:5.x`) to V6 (`chatuikit-{compose,kotlin}-android:6.0
|
|
14
|
+
Migration recipes for moving from CometChat Android UIKit V5 (`chat-uikit-android:5.x`) to V6 (`chatuikit-{compose,kotlin}-android:6.0.+`). V6 is stable (GA 2026-05-25) and the recommended target for new apps; existing V5 apps can migrate when ready — there's no forced timeline, and V5 remains supported. This skill covers both the decision and the mechanics.
|
|
16
15
|
|
|
17
16
|
V6 is a different SDK, not a drop-in replacement. The migration is roughly the size of jumping from React Native UIKit v5 to v6 — package coordinates, builder APIs, theme system, calls handling all change.
|
|
18
17
|
|
|
@@ -23,9 +22,9 @@ V6 is a different SDK, not a drop-in replacement. The migration is roughly the s
|
|
|
23
22
|
- `cometchat-android-v6-{compose,kotlin}-{components,placement,theming,customization}` — surface-specific destination skills
|
|
24
23
|
- `cometchat-android-v6-calls` — calls migration (calls SDK is bundled in V6)
|
|
25
24
|
|
|
26
|
-
**Ground truth:**
|
|
25
|
+
**Ground truth:** **Official docs:** https://www.cometchat.com/docs/ui-kit/android/v6/overview · **Docs MCP:** `claude mcp add --transport http cometchat-docs https://www.cometchat.com/docs/mcp` (or fetch the URL directly without MCP).
|
|
27
26
|
- V5 source — installed `com.cometchat:chat-uikit-android@5.x` artifacts under `~/.gradle/caches/`
|
|
28
|
-
- V6 source — installed `chatuikit-{compose,kotlin}-android@6.0
|
|
27
|
+
- V6 source — installed `chatuikit-{compose,kotlin}-android@6.0.+` artifacts
|
|
29
28
|
- Sister skill — `cometchat-flutter-v6-migration` (different platform, same migration shape)
|
|
30
29
|
|
|
31
30
|
---
|
|
@@ -44,7 +43,7 @@ V6 is a different SDK, not a drop-in replacement. The migration is roughly the s
|
|
|
44
43
|
- You're starting a new project
|
|
45
44
|
- You're rewriting your existing app's UI to Compose anyway
|
|
46
45
|
- You need V6 features that aren't backported to V5 (e.g. some AI Agent components)
|
|
47
|
-
- You've validated V6
|
|
46
|
+
- You've validated V6 against your use cases on a sample project first
|
|
48
47
|
|
|
49
48
|
**The dispatcher (`cometchat-android-v6`) routes by detected version.** Both V5 and V6 skill sets ship in `npx @cometchat/skills add --family android` — the migration here lives under V6 because that's the destination cohort.
|
|
50
49
|
|
|
@@ -56,8 +55,8 @@ V6 is split into two surfaces:
|
|
|
56
55
|
|
|
57
56
|
| Surface | Package | When to pick |
|
|
58
57
|
|---|---|---|
|
|
59
|
-
| Compose | `com.cometchat:chatuikit-compose-android:6.0
|
|
60
|
-
| Kotlin Views | `com.cometchat:chatuikit-kotlin-android:6.0
|
|
58
|
+
| Compose | `com.cometchat:chatuikit-compose-android:6.0.+` | New apps; existing apps already on Compose |
|
|
59
|
+
| Kotlin Views | `com.cometchat:chatuikit-kotlin-android:6.0.+` | Existing apps on Java + XML layouts; teams not ready for Compose |
|
|
61
60
|
|
|
62
61
|
**You can mix both in the same app**, but a single chat surface is one or the other — not both.
|
|
63
62
|
|
|
@@ -81,7 +80,7 @@ dependencies {
|
|
|
81
80
|
|
|
82
81
|
```kotlin
|
|
83
82
|
dependencies {
|
|
84
|
-
implementation("com.cometchat:chatuikit-compose-android:6.0
|
|
83
|
+
implementation("com.cometchat:chatuikit-compose-android:6.0.+")
|
|
85
84
|
// No separate calls SDK — calls bundled into the same artifact
|
|
86
85
|
// Compose dependencies (if not already present)
|
|
87
86
|
implementation(platform("androidx.compose:compose-bom:2024.02.00"))
|
|
@@ -95,7 +94,7 @@ dependencies {
|
|
|
95
94
|
|
|
96
95
|
```kotlin
|
|
97
96
|
dependencies {
|
|
98
|
-
implementation("com.cometchat:chatuikit-kotlin-android:6.0
|
|
97
|
+
implementation("com.cometchat:chatuikit-kotlin-android:6.0.+")
|
|
99
98
|
// No separate calls SDK
|
|
100
99
|
// Material Components for theming (`CometChatTheme.DayNight` extends Material themes)
|
|
101
100
|
implementation("com.google.android.material:material:1.11.+")
|
|
@@ -135,30 +134,28 @@ CometChatUIKit.init(this, settings, object : CometChat.CallbackListener<String>(
|
|
|
135
134
|
})
|
|
136
135
|
```
|
|
137
136
|
|
|
138
|
-
### V6 — `UIKitSettings.
|
|
137
|
+
### V6 — `UIKitSettings.UIKitSettingsBuilder()`
|
|
139
138
|
|
|
140
139
|
```kotlin
|
|
141
|
-
val settings = UIKitSettings.
|
|
140
|
+
val settings = UIKitSettings.UIKitSettingsBuilder()
|
|
142
141
|
.setAppId(BuildConfig.COMETCHAT_APP_ID)
|
|
143
142
|
.setRegion(BuildConfig.COMETCHAT_REGION)
|
|
144
143
|
.setAuthKey(BuildConfig.COMETCHAT_AUTH_KEY)
|
|
145
144
|
.subscribePresenceForAllUsers()
|
|
146
|
-
.
|
|
145
|
+
.setEnableCalling(true) // ← calls toggled on here, not via separate SDK
|
|
147
146
|
.build()
|
|
148
147
|
|
|
149
|
-
CometChatUIKit.init(this, settings) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
}
|
|
148
|
+
CometChatUIKit.init(this, settings, object : CometChat.CallbackListener<String>() {
|
|
149
|
+
override fun onSuccess(result: String) { /* ... */ }
|
|
150
|
+
override fun onError(e: CometChatException) { /* surface to UI */ }
|
|
151
|
+
})
|
|
155
152
|
```
|
|
156
153
|
|
|
157
154
|
Differences:
|
|
158
155
|
|
|
159
|
-
-
|
|
160
|
-
- Calls: separate SDK init → `.
|
|
161
|
-
- Result: `
|
|
156
|
+
- Builder: unchanged — both V5 and V6 use `UIKitSettings.UIKitSettingsBuilder()` (nested class)
|
|
157
|
+
- Calls: separate SDK init → `.setEnableCalling(true)` flag on the builder
|
|
158
|
+
- Result handling: unchanged — `init()`/`login()` still take `CometChat.CallbackListener<T>` (onSuccess/onError). There is **no** `Result.Success`/`Result.Error` sealed class in V6.
|
|
162
159
|
|
|
163
160
|
For full builder option mapping, see `cometchat-android-v6-builder-settings`.
|
|
164
161
|
|
|
@@ -166,7 +163,7 @@ For full builder option mapping, see `cometchat-android-v6-builder-settings`.
|
|
|
166
163
|
|
|
167
164
|
## 5. Calls integration migration
|
|
168
165
|
|
|
169
|
-
V5 has a separate `calls-sdk-android` artifact + a separate `CometChatCalls.init`. V6 bundles calls into `chatuikit-{compose,kotlin}-android` and toggles via `.
|
|
166
|
+
V5 has a separate `calls-sdk-android` artifact + a separate `CometChatCalls.init`. V6 bundles calls into `chatuikit-{compose,kotlin}-android` and toggles via `.setEnableCalling(true)`.
|
|
170
167
|
|
|
171
168
|
### V5 calls init
|
|
172
169
|
|
|
@@ -184,12 +181,17 @@ CometChatCalls.init(this, callAppSettings, /* callback */)
|
|
|
184
181
|
### V6 calls init
|
|
185
182
|
|
|
186
183
|
```kotlin
|
|
187
|
-
val settings = UIKitSettings.
|
|
184
|
+
val settings = UIKitSettings.UIKitSettingsBuilder()
|
|
188
185
|
// ... appId, region, authKey ...
|
|
189
|
-
.
|
|
186
|
+
.setEnableCalling(true) // ← that's it; calls SDK init happens internally
|
|
190
187
|
.build()
|
|
191
188
|
|
|
192
|
-
|
|
189
|
+
// init takes a CometChat.CallbackListener<String> (an abstract class — NOT a
|
|
190
|
+
// fun interface), so use the object form, not a trailing lambda.
|
|
191
|
+
CometChatUIKit.init(this, settings, object : CometChat.CallbackListener<String>() {
|
|
192
|
+
override fun onSuccess(result: String) { /* ready */ }
|
|
193
|
+
override fun onError(e: CometChatException) { /* handle */ }
|
|
194
|
+
})
|
|
193
195
|
```
|
|
194
196
|
|
|
195
197
|
### Permissions + manifest carry over
|
|
@@ -255,7 +257,7 @@ This is documented in `cometchat-android-v6-troubleshooting` and surfaced in the
|
|
|
255
257
|
1. Audit V5 theme attrs (`grep cometchat res/values/`)
|
|
256
258
|
2. Map each to its V6 equivalent (most are same names; some have been renamed for Material 3 alignment)
|
|
257
259
|
3. Activity manifest: change `android:theme="@style/Theme.AppCompat.*"` → `android:theme="@style/Theme.YourApp"` where the new theme inherits `CometChatTheme.DayNight`
|
|
258
|
-
4. Programmatic theme overrides: rewrite via Compose `CometChatTheme(colorScheme = ...)` or Kotlin Views `CometChatTheme.singleton.colors
|
|
260
|
+
4. Programmatic theme overrides: rewrite via Compose `CometChatTheme(colorScheme = ...)` or Kotlin Views `CometChatTheme.setPrimaryColor(...)` (the `CometChatTheme` object exposes `setPrimaryColor`/`setExtendedPrimaryColor*`/`setNeutralColor*` etc. — there is no `.singleton.colors` field; depends on surface)
|
|
259
261
|
|
|
260
262
|
For full mapping, see `cometchat-android-v6-{compose,kotlin}-theming`.
|
|
261
263
|
|
|
@@ -275,24 +277,24 @@ import com.cometchat.chatuikit.messages.CometChatMessageList
|
|
|
275
277
|
### V6 Compose imports
|
|
276
278
|
|
|
277
279
|
```kotlin
|
|
278
|
-
import com.cometchat.
|
|
279
|
-
import com.cometchat.
|
|
280
|
+
import com.cometchat.uikit.compose.presentation.conversations.ui.CometChatConversations
|
|
281
|
+
import com.cometchat.uikit.compose.presentation.messagelist.ui.CometChatMessageList
|
|
280
282
|
```
|
|
281
283
|
|
|
282
284
|
### V6 Kotlin Views imports
|
|
283
285
|
|
|
284
286
|
```kotlin
|
|
285
|
-
import com.cometchat.
|
|
286
|
-
import com.cometchat.
|
|
287
|
+
import com.cometchat.uikit.kotlin.presentation.conversations.ui.CometChatConversations
|
|
288
|
+
import com.cometchat.uikit.kotlin.presentation.messagelist.ui.CometChatMessageList
|
|
287
289
|
```
|
|
288
290
|
|
|
289
|
-
The skill rewrites imports during migration. Most projects can do a regex sweep:
|
|
291
|
+
The skill rewrites imports during migration. The V6 namespace is `com.cometchat.uikit.{compose,kotlin}.presentation.<feature>.ui` — NOT the V5 `com.cometchat.chatuikit.*`. Most projects can do a regex sweep:
|
|
290
292
|
|
|
291
293
|
```bash
|
|
292
294
|
# Compose path
|
|
293
|
-
sed -i 's|com.cometchat.chatuikit.
|
|
295
|
+
sed -i -E 's|com.cometchat.chatuikit.([a-z]+)|com.cometchat.uikit.compose.presentation.\1.ui|g' app/src/main/kotlin/**/*.kt
|
|
294
296
|
# Kotlin Views path
|
|
295
|
-
sed -i 's|com.cometchat.chatuikit.
|
|
297
|
+
sed -i -E 's|com.cometchat.chatuikit.([a-z]+)|com.cometchat.uikit.kotlin.presentation.\1.ui|g' app/src/main/kotlin/**/*.kt
|
|
296
298
|
```
|
|
297
299
|
|
|
298
300
|
But verify each rewrite — some V5 modules have been split or merged in V6 in ways the agent should review case-by-case.
|
|
@@ -326,14 +328,14 @@ For an in-progress migration, you can have V5 and V6 in the same module temporar
|
|
|
326
328
|
|
|
327
329
|
□ Update gradle
|
|
328
330
|
□ Remove chat-uikit-android:5.x
|
|
329
|
-
□ KEEP calls-sdk-android:5.0.+ (V6 needs it as peer dep — see §"
|
|
330
|
-
□ Add chatuikit-{compose,kotlin}-android:6.0
|
|
331
|
+
□ KEEP calls-sdk-android:5.0.+ (V6 needs it as peer dep — see §"KEEP calls-sdk-android:5.0.+" above)
|
|
332
|
+
□ Add chatuikit-{compose,kotlin}-android:6.0.+
|
|
331
333
|
□ Add Compose deps (if applicable) or Material Components (if Kotlin Views)
|
|
332
334
|
|
|
333
335
|
□ Rewrite init
|
|
334
|
-
□ UIKitSettingsBuilder → UIKitSettings.
|
|
335
|
-
□ Drop separate CometChatCalls.init; add .
|
|
336
|
-
□ CallbackListener
|
|
336
|
+
□ UIKitSettingsBuilder → UIKitSettings.UIKitSettingsBuilder()
|
|
337
|
+
□ Drop separate CometChatCalls.init; add .setEnableCalling(true) on UIKitSettings
|
|
338
|
+
□ init callback stays CometChat.CallbackListener<String> (V6 did NOT switch to a Result/sealed-class API)
|
|
337
339
|
|
|
338
340
|
□ Rewrite themes
|
|
339
341
|
□ Activity theme parent → CometChatTheme.DayNight (Kotlin Views)
|
|
@@ -379,8 +381,8 @@ For an in-progress migration, you can have V5 and V6 in the same module temporar
|
|
|
379
381
|
- [ ] `app/build.gradle.kts` has only one CometChat dep tree (V5 OR V6, not both)
|
|
380
382
|
- [ ] `minSdk = 28` or higher
|
|
381
383
|
- [ ] All V5 imports rewritten to the V6 surface (`compose` or `kotlin` namespace)
|
|
382
|
-
- [ ] `UIKitSettingsBuilder` → `UIKitSettings.
|
|
383
|
-
- [ ] `.
|
|
384
|
+
- [ ] `UIKitSettingsBuilder` → `UIKitSettings.UIKitSettingsBuilder()` everywhere
|
|
385
|
+
- [ ] `.setEnableCalling(true)` on the builder if calls are used
|
|
384
386
|
- [ ] Activity themes inherit `CometChatTheme.DayNight` (Kotlin Views path)
|
|
385
387
|
- [ ] No `CometChatCalls.init` calls outside what V6 does internally
|
|
386
388
|
- [ ] `calls-sdk-android:5.0.+` retained as explicit peer dep (V6 needs it; despite vendor marketing of "bundled calls")
|
|
@@ -3,13 +3,14 @@ name: cometchat-android-v6-production
|
|
|
3
3
|
description: "CometChat Android UIKit v6 production readiness — token auth, ProGuard/R8, security checklist, release configuration"
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "Android 9.0+ (API 28); Kotlin 1.9+; com.cometchat:chatuikit-compose-android:6.x / com.cometchat:chatuikit-kotlin-android:6.x"
|
|
6
|
-
allowed-tools: "shell, file-read, file-search, file-list"
|
|
7
6
|
metadata:
|
|
8
7
|
author: "CometChat"
|
|
9
8
|
version: "3.0.0"
|
|
10
9
|
tags: "cometchat, android, production, security, proguard, release, auth-token"
|
|
11
10
|
---
|
|
12
11
|
|
|
12
|
+
> **Ground truth:** `com.cometchat:chatuikit-{compose,kotlin}-android:6.x` (+ `calls-sdk-android:5.x`) — resolved AAR (javap) + `ui-kit/android/v6`. **Official docs:** https://www.cometchat.com/docs/fundamentals/user-auth · **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.
|
|
13
|
+
|
|
13
14
|
> **Companion skills:** cometchat-android-v6-core (init/login), cometchat-android-v6-builder-settings (UIKitSettings), cometchat-android-v6-push (FCM)
|
|
14
15
|
|
|
15
16
|
## Purpose
|
|
@@ -165,11 +166,13 @@ implementation("androidx.compose.material3:material3")
|
|
|
165
166
|
Pin CometChat SDK versions explicitly:
|
|
166
167
|
|
|
167
168
|
```kotlin
|
|
168
|
-
implementation("com.cometchat:chatuikit-compose-android:6.0
|
|
169
|
+
implementation("com.cometchat:chatuikit-compose-android:6.0.+")
|
|
169
170
|
// or
|
|
170
|
-
implementation("com.cometchat:chatuikit-kotlin-android:6.0
|
|
171
|
+
implementation("com.cometchat:chatuikit-kotlin-android:6.0.+")
|
|
171
172
|
```
|
|
172
173
|
|
|
174
|
+
> Never pin `6.0.0-beta2` (or any `-beta` preview) in a production build — V6 went GA on 2026-05-25. The `6.0.+` dynamic pin tracks GA patches forward (ENG-35701). Pin an exact GA patch (e.g. `6.0.1`) if your release process requires reproducible builds.
|
|
175
|
+
|
|
173
176
|
## 6. minSdk 28 Implications
|
|
174
177
|
|
|
175
178
|
v6 requires `minSdk = 28` (Android 9.0 Pie). This means:
|