Skip to main content
The CometChatBuilderSettings.kt file handles basic feature toggles. For deeper customizations, modify component props using BuilderSettingsHelper or edit the source code directly.

Understanding the Customization Architecture

The Android UI Kit Builder uses two main files for customization:
FilePurposeWhen to Modify
CometChatBuilderSettings.ktAuto-generated feature flags and configuration constantsFunctional changes (enable/disable features)
themes.xmlTheme styles, colors, and typographyUI/visual changes (colors, fonts, spacing)
BuilderSettingsHelper.ktUtility class that applies settings to UI componentsComponent-level customizations
CometChatBuilderSettings.kt is auto-generated by the Builder plugin from your cometchat-builder-settings.json file. You can modify the values directly in the Kotlin file, but changes will be overwritten if you rebuild with the plugin.

Using BuilderSettingsHelper

The BuilderSettingsHelper is a utility class that applies your Builder configuration to CometChat UI components. It reads values from CometChatBuilderSettings and configures component properties accordingly.

How It Works

  1. Import the helper into your Activity or Fragment
  2. Get a reference to your CometChat UI component
  3. Call the appropriate method to apply settings
import com.yourpackage.BuilderSettingsHelper

// Apply settings to your components
BuilderSettingsHelper.applySettingsToMessageHeader(messageHeader)
BuilderSettingsHelper.applySettingsToMessageList(messageList)
BuilderSettingsHelper.applySettingsToMessageComposer(messageComposer)

Component-Level Customizations

MessageHeader

The applySettingsToMessageHeader method configures call buttons and user status visibility based on your Builder settings.
import com.cometchat.chatuikit.messageheader.CometChatMessageHeader
import com.yourpackage.BuilderSettingsHelper

class MessagesActivity : AppCompatActivity() {
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        val messageHeader: CometChatMessageHeader = binding.messageHeader
        
        // Apply Builder settings
        BuilderSettingsHelper.applySettingsToMessageHeader(messageHeader)
    }
}
Settings Applied:
SettingPropertyDescription
VoiceAndVideoCalling.ONEONONEVOICECALLINGvoiceCallButtonVisibilityShows/hides voice call button for 1:1 chats
VoiceAndVideoCalling.ONEONONEVIDEOCALLINGvideoCallButtonVisibilityShows/hides video call button for 1:1 chats
VoiceAndVideoCalling.GROUPVOICECONFERENCEvoiceCallButtonVisibilityShows/hides voice call button for groups
VoiceAndVideoCalling.GROUPVIDEOCONFERENCEvideoCallButtonVisibilityShows/hides video call button for groups
CoreMessagingExperience.USERANDFRIENDSPRESENCEuserStatusVisibilityShows/hides online status indicator

MessageList

The applySettingsToMessageList method configures message options, reactions, AI features, and more.
import com.cometchat.chatuikit.messagelist.CometChatMessageList
import com.yourpackage.BuilderSettingsHelper

class MessagesActivity : AppCompatActivity() {
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        val messageList: CometChatMessageList = binding.messageList
        
        // Apply Builder settings
        BuilderSettingsHelper.applySettingsToMessageList(messageList)
    }
}
Settings Applied:
SettingPropertyDescription
CoreMessagingExperience.THREADCONVERSATIONANDREPLIESreplyInThreadOptionVisibilityShows/hides reply in thread option
CoreMessagingExperience.EDITMESSAGEeditMessageOptionVisibilityShows/hides edit message option
CoreMessagingExperience.DELETEMESSAGEdeleteMessageOptionVisibilityShows/hides delete message option
CoreMessagingExperience.MESSAGEDELIVERYANDREADRECEIPTSreceiptsVisibilityShows/hides read receipts
CoreMessagingExperience.QUOTEDREPLIESisSwipeToReplyEnabled, replyOptionVisibilityEnables swipe-to-reply and reply option
DeeperUserEngagement.REACTIONSmessageReactionOptionVisibilityShows/hides reaction option
DeeperUserEngagement.MESSAGETRANSLATIONtranslateMessageOptionVisibilityShows/hides translate option
AiUserCopilot.CONVERSATIONSTARTERisEnableConversationStarterEnables AI conversation starters
AiUserCopilot.SMARTREPLYisEnableSmartRepliesEnables AI smart replies
PrivateMessagingWithinGroups.SENDPRIVATEMESSAGETOGROUPMEMBERSmessagePrivatelyOptionVisibilityShows/hides message privately option

MessageComposer

The applySettingsToMessageComposer method configures attachment options, typing indicators, mentions, and more.
import com.cometchat.chatuikit.messagecomposer.CometChatMessageComposer
import com.yourpackage.BuilderSettingsHelper

class MessagesActivity : AppCompatActivity() {
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        val messageComposer: CometChatMessageComposer = binding.messageComposer
        
        // Apply Builder settings
        BuilderSettingsHelper.applySettingsToMessageComposer(messageComposer)
    }
}
Settings Applied:
SettingPropertyDescription
CoreMessagingExperience.TYPINGINDICATORdisableTypingEvents()Enables/disables typing indicators
CoreMessagingExperience.PHOTOSSHARINGcameraAttachmentOptionVisibility, imageAttachmentOptionVisibilityShows/hides photo attachments
CoreMessagingExperience.VIDEOSHARINGvideoAttachmentOptionVisibilityShows/hides video attachments
CoreMessagingExperience.AUDIOSHARINGaudioAttachmentOptionVisibilityShows/hides audio attachments
CoreMessagingExperience.FILESHARINGfileAttachmentOptionVisibilityShows/hides file attachments
DeeperUserEngagement.MENTIONSisDisableMentionsEnables/disables @mentions
DeeperUserEngagement.MENTIONALLsetDisableMentionAll()Enables/disables @all mentions
DeeperUserEngagement.POLLSpollAttachmentOptionVisibilityShows/hides polls option
DeeperUserEngagement.COLLABORATIVEWHITEBOARDcollaborativeWhiteboardOptionVisibilityShows/hides whiteboard option
DeeperUserEngagement.COLLABORATIVEDOCUMENTcollaborativeDocumentOptionVisibilityShows/hides document option
DeeperUserEngagement.VOICENOTESvoiceNoteButtonVisibilityShows/hides voice notes button
DeeperUserEngagement.STICKERSstickersButtonVisibilityShows/hides stickers button

Users

The applySettingsToUsers method configures user list display options.
import com.cometchat.chatuikit.users.CometChatUsers
import com.yourpackage.BuilderSettingsHelper

class UsersActivity : AppCompatActivity() {
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        val users: CometChatUsers = binding.users
        
        // Apply Builder settings
        BuilderSettingsHelper.applySettingsToUsers(users)
    }
}
Settings Applied:
SettingPropertyDescription
CoreMessagingExperience.USERANDFRIENDSPRESENCEuserStatusVisibilityShows/hides online status indicator

CallLogs

The applySettingsToCallLogs method configures call log display and call buttons.
import com.cometchat.chatuikit.calls.calllogs.CometChatCallLogs
import com.yourpackage.BuilderSettingsHelper

class CallsActivity : AppCompatActivity() {
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        val callLogs: CometChatCallLogs = binding.callLogs
        
        // Apply Builder settings
        BuilderSettingsHelper.applySettingsToCallLogs(callLogs)
    }
}
Settings Applied:
SettingPropertyDescription
VoiceAndVideoCalling.ONEONONEVIDEOCALLINGitemVideoCallIconShows/hides video call icon
VoiceAndVideoCalling.ONEONONEVOICECALLINGitemIncomingCallIconShows/hides voice call icon

GroupMembers

The applySettingToGroupMembers method configures moderator controls and member display options.
import com.cometchat.chatuikit.groupmembers.CometChatGroupMembers
import com.yourpackage.BuilderSettingsHelper

class GroupMembersActivity : AppCompatActivity() {
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        val groupMembers: CometChatGroupMembers = binding.groupMembers
        
        // Apply Builder settings
        BuilderSettingsHelper.applySettingToGroupMembers(groupMembers)
    }
}
Settings Applied:
SettingPropertyDescription
ModeratorControls.KICKUSERSkickMemberOptionVisibilityShows/hides kick member option
ModeratorControls.BANUSERSbanMemberOptionVisibilityShows/hides ban member option
ModeratorControls.PROMOTEDEMOTEMEMBERSscopeChangeOptionVisibilityShows/hides promote/demote option
CoreMessagingExperience.USERANDFRIENDSPRESENCEuserStatusVisibilityShows/hides online status indicator

Functional Changes via CometChatBuilderSettings

For functional changes (enabling/disabling features), you can directly access the CometChatBuilderSettings object:
import com.cometchat.builder.CometChatBuilderSettings

// Check if a feature is enabled
if (CometChatBuilderSettings.ChatFeatures.CoreMessagingExperience.PHOTOSSHARING) {
    // Photo sharing is enabled
}

// Check AI features
if (CometChatBuilderSettings.ChatFeatures.AiUserCopilot.SMARTREPLY) {
    // Smart reply is enabled
}

// Check call features
if (CometChatBuilderSettings.CallFeatures.VoiceAndVideoCalling.ONEONONEVIDEOCALLING) {
    // 1:1 video calling is enabled
}

// Access layout settings
val tabs = CometChatBuilderSettings.Layout.TABS // List of enabled tabs
val chatType = CometChatBuilderSettings.Layout.CHATTYPE // "user" or "group"

// Access style settings
val brandColor = CometChatBuilderSettings.Style.Color.BRANDCOLOR
val theme = CometChatBuilderSettings.Style.THEME // "light", "dark", or "system"

Modifying Feature Flags at Runtime

You can modify feature flags at runtime by directly setting the values:
// Disable photo sharing at runtime
CometChatBuilderSettings.ChatFeatures.CoreMessagingExperience.PHOTOSSHARING = false

// Enable AI smart replies
CometChatBuilderSettings.ChatFeatures.AiUserCopilot.SMARTREPLY = true

// Then re-apply settings to your components
BuilderSettingsHelper.applySettingsToMessageComposer(messageComposer)
BuilderSettingsHelper.applySettingsToMessageList(messageList)
Runtime changes to CometChatBuilderSettings are not persisted. They will reset to the original values when the app restarts.

UI/Theme Changes via themes.xml

For visual customizations (colors, fonts, spacing), modify the themes.xml file in your res/values directory.

Customizing Colors

themes.xml
<style name="CometChat.Builder.Theme" parent="CometChatTheme.DayNight">
    <!-- Brand color (primary accent) -->
    <item name="cometchatPrimaryColor">#6852D6</item>
    
    <!-- Text colors -->
    <item name="cometchatTextColorPrimary">#141414</item>
    <item name="cometchatTextColorSecondary">#727272</item>
    
    <!-- Background colors -->
    <item name="cometchatBackgroundColor1">#FFFFFF</item>
    <item name="cometchatBackgroundColor2">#F5F5F5</item>
</style>

Customizing Typography

themes.xml
<style name="CometChat.Builder.Theme" parent="CometChatTheme.DayNight">
    <!-- Custom fonts -->
    <item name="cometchatFontBold">@font/your_font_bold</item>
    <item name="cometchatFontRegular">@font/your_font_regular</item>
    <item name="cometchatFontMedium">@font/your_font_medium</item>
</style>

Pre-built Font Themes

The Builder includes pre-built font themes you can use:
themes.xml
<!-- Use Roboto (default) -->
<style name="YourAppTheme" parent="Builder.Theme.Roboto" />

<!-- Use Arial -->
<style name="YourAppTheme" parent="Builder.Theme.Arial" />

<!-- Use Inter -->
<style name="YourAppTheme" parent="Builder.Theme.Inter" />

<!-- Use Times New Roman -->
<style name="YourAppTheme" parent="Builder.Theme.TimesNewRoman" />

Customizing Component Styles

You can customize individual component styles by overriding their style attributes:
themes.xml
<!-- Custom Message List Style -->
<style name="CustomCometChatMessageListStyle" parent="CometChatMessageListStyle">
    <item name="cometchatMessageListOutgoingMessageBubbleStyle">
        @style/CustomOutgoingMessageBubbleStyle
    </item>
</style>

<!-- Custom Outgoing Message Bubble -->
<style name="CustomOutgoingMessageBubbleStyle">
    <item name="cometchatMessageBubbleBackgroundColor">?attr/cometchatBackgroundColor4</item>
    <item name="cometchatMessageBubbleCornerRadius">@dimen/cometchat_radius_3</item>
</style>

<!-- Custom Message Composer Style -->
<style name="CustomMessageComposerStyle">
    <item name="cometchatMessageComposerComposeBoxStrokeWidth">@dimen/cometchat_1dp</item>
    <item name="cometchatMessageComposerComposeBoxCornerRadius">@dimen/cometchat_radius_2</item>
</style>

Next Steps

UI Kit Builder Settings

Understand all available feature toggles and configuration options.

Components Overview

Explore all available UI components and their customization options.

Theming

Deep dive into colors, typography, and advanced styling.

Directory Structure

Understand how the exported code is organized.