AI Integration Quick Reference
AI Integration Quick Reference
| Field | Value |
|---|---|
| Kotlin XML Views | Override XML theme attributes in themes.xml extending CometChatTheme.DayNight, or use CometChatTheme.setPrimaryColor() programmatically |
| Jetpack Compose | Wrap content in CometChatTheme {} composable, customize via CometChatColorScheme, CometChatTypography, and Shapes |
| Key color tokens | primary, backgroundColor1, backgroundColor2, textColorPrimary, textColorSecondary, strokeColorDefault |
| Dark mode | Kotlin: values-night/themes.xml overrides. Compose: provide a different CometChatColorScheme based on isSystemInDarkTheme() |
When to use this
- You want a single UI Kit theme that matches your app branding.
- You need light and dark mode support with consistent colors.
- You want to customize primary, background, or text colors across all UI Kit components.
Prerequisites
- CometChat UI Kit is installed and initialized.
- You’ve completed the Kotlin Integration or Jetpack Compose Integration.
Core Concepts
- Kotlin (XML Views)
- Jetpack Compose
The Kotlin XML UI Kit uses Android’s theme attribute system. All components read colors, typography, and fonts from XML theme attributes prefixed with
cometchat.CometChatTheme.DayNight— base theme built onTheme.MaterialComponents.DayNight.NoActionBar- Theme attributes like
cometchatPrimaryColor,cometchatBackgroundColor1, etc. are defined in yourthemes.xml - Programmatic access via
CometChatTheme.getPrimaryColor(context)andCometChatTheme.setPrimaryColor(color) - Dark mode via
values-night/themes.xmloverrides
- Programmatic overrides via
CometChatTheme.set*()(highest) - Activity-level theme
- Application-level theme
CometChatTheme.DayNightdefaults (lowest)
Quick Start
- Kotlin (XML Views)
- Jetpack Compose
Change the Primary Color
- Kotlin (XML Views)
- Jetpack Compose
Override Or set it programmatically:
cometchatPrimaryColor in your theme:themes.xml

Customize Common Theme Attributes
- Kotlin (XML Views)
- Jetpack Compose
themes.xml
Add Dark Mode Support
- Kotlin (XML Views)
- Jetpack Compose
Create Android automatically applies
app/src/main/res/values-night/themes.xml and override attributes for dark mode:values-night/themes.xml
values-night overrides when the system uses dark mode.Apply a Theme to a Specific Activity
- Kotlin (XML Views)
- Jetpack Compose
Set Activity-level themes override the application-level theme.
android:theme on a specific <activity> in AndroidManifest.xml:AndroidManifest.xml
Color Token Reference
| Token | Description |
|---|---|
primary | Buttons, highlights, interactive elements |
backgroundColor1 | Main surface/panel background |
backgroundColor2 | Secondary surface background |
backgroundColor3 | Tertiary surface background |
backgroundColor4 | Quaternary surface background |
textColorPrimary | Primary text |
textColorSecondary | Secondary/subtitle text |
textColorTertiary | Tertiary/hint text |
textColorHighlight | Highlighted/linked text |
strokeColorDefault | Default borders and dividers |
strokeColorLight | Light borders |
strokeColorDark | Dark borders |
successColor | Success indicators |
errorColor | Error indicators |
warningColor | Warning indicators |
infoColor | Info indicators |
