Overview
ThreadedMessages is a Composite Component that displays all replies made to a particular message in a conversation. By default, the parent message will be displayed at the top, the message composer will be at the bottom and between them a message list will contain all replies.
| Component | Description |
|---|---|
| MessageList | CometChatMessageList is a component that displays a list of Messages |
| MessageComposer | CometChatMessageComposer is a component that helps in writing and editing of messages and also sending attachments |
Usage
Integration
The following code snippet illustrates how you can directly incorporate the ThreadedMessages component into yourlayout.xml file.
- XML
Actions
Actions dictate how a component functions. They are divided into two types: Predefined and User-defined. You can override either type, allowing you to tailor the behavior of the component to fit your specific needs. ThreadedMessages does not have its own actions. However, you can override the behavior of the ThreadedMessages component by using the actions of its Components, with the help of Configurations. Example In this example, we are overriding theonThreadReplyClick of the MessageList Component using MessageListConfiguration and applying it to ThreadedMessages.
- Java
- Kotlin
Filters
Filters allow you to customize the data displayed in a list within a Component. You can filter the list based on your specific criteria, allowing for a more customized. Filters can be applied using RequestBuilders of Chat SDK. ThreadedMessages does not have its own Filters. However, you can filter the messages list in ThreadedMessages Component using MessageListConfiguration. Example In this example, we are filtering messages based on the ParentMessageID and searching for messages that contain the keyword “payment”.- Java
- Kotlin
Events
Events are emitted by aComponent. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.
The MessageList Component does not emit any events of its own.
Customization
To fit your app’s design requirements, you can customize the appearance of the conversation component. We provide exposed methods that allow you to modify the experience and behavior according to your specific needs.Style
Using Style you can customize the look and feel of the component in your app, These parameters typically control elements such as the color, size, shape, and fonts used within the component.1. ThreadedMessage Style
To modify the styling, you can apply the ThreadedMessageStyle to the ThreadedMessage Component using thesetStyle method.
- Java
- Kotlin
ThreadedMessagesStyle:
| Methods | Type | Description |
|---|---|---|
| setBackground | @ColorInt int | used to set the background color |
| setBorderWidth | int | used to set border |
| borderRadius | double | used to set border radius |
| setBackground | Drawable | used to set background gradient |
| setTitleAppearance | @StyleRes int | used to customise the appearance of the title in the app bar |
| setCloseIconTint | @ColorInt int | used to set the color of the close icon in the app bar |
Functionality
These are a set of small functional customizations that allow you to fine-tune the overall experience of the component. With these, you can change text, set custom icons, and toggle the visibility of UI elements.- Java
- Kotlin
| Property | Description | Code |
|---|---|---|
| Set ParentMessage | Used to to set the message for which the replies need to be fetched | .setParentMessage(BaseMessage) |
| Set Title | Used to set title in the app bar | .setTitle(String) |
| Set CloseIcon | Used to set the icon to exit the widget | .setTitle(@DrawableRes int) |
| setHideMessageComposer | Used to toggle visibility for CometChatMessageComposer | .setHideMessageComposer(boolen) |
Advanced
For advanced-level customization, you can set custom views to the component. This lets you tailor each aspect of the component to fit your exact needs and application aesthetics. You can create and define your views, layouts, and UI elements and then incorporate those into the component.MessageBubbleView
By usingsetMessageBubbleView(), You can set parent message buggle view inside ThreadedMessage Component.
- Java
- Kotlin

setOnThreadRepliesClick Action of MessageList Component and apply custom styles on it.
- Java
- Kotlin
MessageActionView
By utilizing thesetMessageActionView() method, you can assign custom actions to the parent message bubble view inside the ThreadedMessage Component.
- Java
- Kotlin

custom_header_view_layout.xml
- Java
- Kotlin
setMessageListView
You can set your custom message list view using thesetMessageListView() method. But keep in mind, by using this you will override the default message ListView functionality.
- Java
- Kotlin

custom_messages_list_layout.xml and inflate it inside the setMessageListView() method.
custom_messages_list_layout.xml
- Java
- Kotlin
setMessageComposerView
You can set your custom Message Composer view using thesetMessageComposerView() method. But keep in mind, by using this you will override the default message composer functionality.
- Java
- Kotlin

custom_composer_view_layout.xml and inflate it inside the setMessageComposerView() method.
custom_composer_view_layout.xml
- Java
- Kotlin
Configuration
Configurations offer the ability to customize the properties of each individual component within a Composite Component. The ThreadedMessages is a Composite Component, and it has a distinct set of configurations for each of its components as follows.MessageList
If you want to customize the properties of the MessageList Component inside ThreadedMessages Component, you need use theMessageListConfiguration object.
- Java
- Kotlin
MessageListConfiguration provides access to all the Action, Filters, Styles, Functionality, and Advanced properties of the MessageList component.
Please note that the properties marked with the 🛑 symbol are not accessible within the Configuration Object.Example

MessageListConfiguration.
- Java
- Kotlin
MessageComposer
If you want to customize the properties of the MessageComposer Component inside ThreadedMessages Component, you need use theMessageComposerConfiguration object.
- Java
- Kotlin
MessageComposerConfiguration provides access to all the Action, Filters, Styles, Functionality, and Advanced properties of the MessageComposer component.
Please note that the properties marked with the 🛑 symbol are not accessible within the Configuration Object.Example

MessageComposerConfiguration.
- Java
- Kotlin