Styling Approaches
- Kotlin (XML Views)
- Jetpack Compose
Font Customization
- Kotlin (XML Views)
- Jetpack Compose
Override fonts at the theme level:
themes.xml
| Attribute | Usage |
|---|---|
cometchatFontBold | Headings, titles, emphasized text |
cometchatFontMedium | Subtitles, secondary headings |
cometchatFontRegular | Body text, descriptions, input fields |
CometChatTheme Color Tokens
These tokens are available for programmatic override (Kotlin XML) or viaCometChatColorScheme (Compose):
Colors
| Token | Description |
|---|---|
primaryColor | Brand color for buttons, links, highlights |
backgroundColor1 – backgroundColor4 | Background levels |
textColorPrimary / Secondary / Tertiary | Text colors |
textColorDisabled / White / Highlight | Special text colors |
errorColor / successColor / warningColor / infoColor | Alert colors |
strokeColorDefault / Light / Dark / Highlight | Border colors |
Icon Tints
| Token | Description |
|---|---|
iconTintPrimary / Secondary / Tertiary | Icon tints |
iconTintWhite / Highlight | Special icon tints |
Button Colors
| Token | Description |
|---|---|
primaryButtonBackgroundColor / TextColor / IconTint | Primary button |
secondaryButtonBackgroundColor / TextColor / IconTint | Secondary button |
Per-Component Style Properties
Each component has its own style data class with nested sub-component styles. Here’s the pattern for key components:CometChatConversations
| Property | Description |
|---|---|
backgroundColor | List background |
titleTextColor | Toolbar title color |
searchBoxStyle | Search box styling |
itemStyle.avatarStyle | Avatar in each row |
itemStyle.badgeStyle | Unread badge |
itemStyle.dateStyle | Timestamp |
itemStyle.receiptStyle | Read receipts |
itemStyle.statusIndicatorStyle | Online/offline indicator |
itemStyle.typingIndicatorStyle | Typing indicator |
CometChatMessageList
| Property | Description |
|---|---|
backgroundColor | List background |
incomingMessageBubbleStyle | Incoming bubble appearance |
outgoingMessageBubbleStyle | Outgoing bubble appearance |
actionBubbleStyle | Group action bubbles |
callActionBubbleStyle | Call action bubbles |
CometChatMessageComposer
| Property | Description |
|---|---|
backgroundColor | Composer background |
attachmentIconTint | Attachment button tint |
voiceRecordingIconTint | Voice recording button tint |
aiIconTint | AI button tint |
sendButtonStyle | Send button appearance |
CometChatMessageHeader
| Property | Description |
|---|---|
backgroundColor | Header background |
titleTextColor | User/group name color |
subtitleTextColor | Status/typing text color |
avatarStyle | Avatar appearance |
callButtonsStyle | Call button appearance |
Related
- Theme Introduction — Global theming reference.
- Component Styling — Detailed per-component style examples with screenshots.
- Color Resources — Default color palette reference.
- Customization Overview — All customization categories.