Skip to content

Commit 95e4e6b

Browse files
AI Agent Component Spec
1 parent 13c494b commit 95e4e6b

7 files changed

Lines changed: 96 additions & 0 deletions

File tree

ui-kit/android/color-resources.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ title: "Color Resources"
33
description: "Review and override the default UI Kit color palette for consistent light and dark mode styling."
44
---
55

6+
<Accordion title="AI Agent Component Spec">
7+
8+
| Field | Value |
9+
| --- | --- |
10+
| Goal | Review and override the default UI Kit color palette for light and dark modes |
11+
| Light mode | `app/src/main/res/values/color.xml` |
12+
| Dark mode | `app/src/main/res/values-night/color.xml` |
13+
| Override via theme | Set `cometchatPrimaryColor` in `themes.xml` |
14+
| Constraints | App theme must extend `CometChatTheme.DayNight` |
15+
| Related | [Theme Introduction](/ui-kit/android/theme-introduction) \| [Component Styling](/ui-kit/android/component-styling) |
16+
17+
</Accordion>
18+
619
Use CometChat UI Kit color resources to keep a consistent visual identity in light and dark modes.
720

821
## When to use this

ui-kit/android/component-styling.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ title: "Component Styling"
33
description: "Style CometChat UI Kit components in Android using XML themes and drawable overrides."
44
---
55

6+
<Accordion title="AI Agent Component Spec">
7+
8+
| Field | Value |
9+
| --- | --- |
10+
| Goal | Customize UI Kit component appearance (colors, fonts, icons) via XML theme attributes |
11+
| Where | `app/src/main/res/values/themes.xml` — applied via `android:theme` in `AndroidManifest.xml` |
12+
| Pattern | Create a custom style extending the component's parent style → assign it to `AppTheme` via the component's theme attribute |
13+
| Example | `CometChatConversationsStyle``cometchatConversationsStyle`, `CometChatUsersStyle``cometchatUsersStyle` |
14+
| Constraints | Must extend `CometChatTheme.DayNight` as parent theme; rebuild after updating styles |
15+
| Related | [Theme Introduction](/ui-kit/android/theme-introduction) \| [Color Resources](/ui-kit/android/color-resources) \| [Message Bubble Styling](/ui-kit/android/message-bubble-styling) |
16+
17+
</Accordion>
18+
619
This page shows how to style CometChat UI Kit components in Android by overriding XML theme attributes. It is written for Android developers customizing UI Kit v5.
720

821
## When to use this

ui-kit/android/events.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ title: "Events"
33
description: "Listen to UI Kit events for user actions, group changes, messages, and call lifecycle updates."
44
---
55

6+
<Accordion title="AI Agent Component Spec">
7+
8+
| Field | Value |
9+
| --- | --- |
10+
| Package | `com.cometchat:chat-uikit-android` |
11+
| Conversation events | `ccConversationDeleted` |
12+
| User events | `ccUserBlocked`, `ccUserUnblocked` |
13+
| Group events | `ccGroupCreated`, `ccGroupDeleted`, `ccGroupLeft`, `ccGroupMemberScopeChanged`, `ccGroupMemberKicked`, `ccGroupMemberBanned`, `ccGroupMemberUnbanned`, `ccGroupMemberJoined`, `ccGroupMemberAdded`, `ccOwnershipChanged` |
14+
| Message events | `ccMessageSent`, `ccMessageEdited`, `ccMessageDeleted`, `ccMessageRead`, `ccLiveReaction` |
15+
| Call events | `ccOutgoingCall`, `ccCallAccepted`, `ccCallRejected`, `ccCallEnded` |
16+
| Purpose | Decoupled communication between UI Kit components — subscribe to events to react to changes without direct component references |
17+
18+
</Accordion>
19+
620
Events enable a decoupled, flexible architecture in the CometChat UI Kit. Components and Composite Components emit events in response to user interactions or state changes, allowing other parts of your application to react without direct references between components.
721

822
## When to use this

ui-kit/android/localize.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ title: "Localize"
33
description: "Set the UI Kit language and override text labels to match your users' locale."
44
---
55

6+
<Accordion title="AI Agent Component Spec">
7+
8+
| Field | Value |
9+
| --- | --- |
10+
| Package | `com.cometchat:chat-uikit-android` |
11+
| Import | `com.cometchat.chatuikit.resources.localize.CometChatLocalize` |
12+
| Set language | `CometChatLocalize.setLocale(context, Language.Code.FR)` |
13+
| Get language | `CometChatLocalize.getLocale(context)` |
14+
| Supported languages | 19: ar, de, en, es, fr, hi, hu, it, ja, ko, lt, ms, nl, pt, ru, sv, tr, zh, zh-TW |
15+
| Override labels | `res/values/strings.xml` — override UI Kit string resource keys |
16+
| Date formatting | `DateTimeFormatterCallback` for custom date/time labels |
17+
| Related | [Theme Introduction](/ui-kit/android/theme-introduction) \| [Sound Manager](/ui-kit/android/sound-manager) |
18+
19+
</Accordion>
20+
621
Set the CometChat UI Kit language and override UI text so your Android app matches your users' locale.
722

823
## When to use this

ui-kit/android/message-bubble-styling.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ title: "Message Bubble Styling"
33
description: "Configure and style incoming, outgoing, and specific message bubbles in your Android UI Kit."
44
---
55

6+
<Accordion title="AI Agent Component Spec">
7+
8+
| Field | Value |
9+
| --- | --- |
10+
| Goal | Customize incoming, outgoing, and per-type message bubble appearance via XML theme styles |
11+
| Where | `app/src/main/res/values/themes.xml` |
12+
| Hub styles | `CometChatIncomingMessageBubbleStyle`, `CometChatOutgoingMessageBubbleStyle` |
13+
| Per-type styles | Text, Image, Audio, Video, File, Sticker, Poll, Collaborative, Call Action, Delete, AI Assistant bubbles |
14+
| Constraints | App theme must extend `CometChatTheme.DayNight`; rebuild after updating styles |
15+
| Related | [Theme Introduction](/ui-kit/android/theme-introduction) \| [Component Styling](/ui-kit/android/component-styling) \| [Message List](/ui-kit/android/message-list) |
16+
17+
</Accordion>
18+
619
Configure and style incoming, outgoing, and specific message bubbles in your Android UI Kit.
720

821
## When to use this

ui-kit/android/methods.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ title: "Methods"
33
description: "Use CometChatUIKit wrapper methods for initialization, authentication, user creation, and message sending."
44
---
55

6+
<Accordion title="AI Agent Component Spec">
7+
8+
| Field | Value |
9+
| --- | --- |
10+
| Package | `com.cometchat:chat-uikit-android` |
11+
| Import | `com.cometchat.chatuikit.CometChatUIKit` |
12+
| Init | `CometChatUIKit.init(context, uiKitSettings, callback)` |
13+
| Login (dev) | `CometChatUIKit.login("UID", callback)` |
14+
| Login (prod) | `CometChatUIKit.loginWithAuthToken("AUTH_TOKEN", callback)` |
15+
| Other methods | `CometChatUIKit.logout()`, `CometChatUIKit.getLoggedInUser()`, `CometChatUIKit.createUser(user, callback)` |
16+
| Send messages | `CometChatUIKit.sendTextMessage()`, `CometChatUIKit.sendMediaMessage()`, `CometChatUIKit.sendCustomMessage()` |
17+
| Note | Use these wrapper methods instead of raw SDK calls — they manage internal UI Kit eventing |
18+
19+
</Accordion>
20+
621
`CometChatUIKit` provides wrapper methods around the CometChat SDK for initialization, authentication, user creation, date formatting, and sending messages — while automatically managing internal UI Kit events so that components like Message List and Conversations stay in sync.
722

823
## When to use this

ui-kit/android/sound-manager.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ title: "Sound Manager"
33
description: "Play, pause, and customize audio cues for calls and messages using CometChatSoundManager."
44
---
55

6+
<Accordion title="AI Agent Component Spec">
7+
8+
| Field | Value |
9+
| --- | --- |
10+
| Package | `com.cometchat:chat-uikit-android` |
11+
| Import | `com.cometchat.chatuikit.resources.soundmanager.CometChatSoundManager` |
12+
| Play sound | `CometChatSoundManager(context).play(Sound.incomingCall)` — or pass custom `@RawRes int` as second arg |
13+
| Pause sound | `CometChatSoundManager(context).pause()` |
14+
| Sound events | `incomingCall`, `outgoingCall`, `incomingMessage`, `incomingMessageFromOther`, `outgoingMessage` |
15+
| Source | [GitHub](https://github.com/cometchat/cometchat-uikit-android/tree/v5/chatuikit/src/main/java/com/cometchat/chatuikit/resources/soundmanager) |
16+
17+
</Accordion>
18+
619
Use `CometChatSoundManager` to play UI Kit audio cues for calls and messages.
720

821
## When to use this

0 commit comments

Comments
 (0)