Release Notes
Announcements
Chat Message List | Message Long-Press Menu |
![]() | ![]() |
Method | Parameter | Description |
MessageList | conversationID: String | Initializes the component and sets the conversation ID. For C2C Chat, use the format c2c_userID. For group chat, use group_groupID. |
| modifier: Modifier | Jetpack Compose modifier for setting style, layout, behavior, and appearance. |
| config: MessageListConfigProtocol | Initializes the component and applies message list styles. |
| customActions: List | Initializes the component and adds custom message menu actions. |
| locateMessage: MessageInfo? | Initializes the component and sets the message to locate. Typically used to jump from message search results to the target message. |
| messageListViewModelFactory: MessageListViewModelFactory | Factory for creating the internal MessageListViewModel. Usually, you do not need to provide this, as a default implementation is included. |
| onUserClick: (String) -> Unit | Initializes the component and sets the handler for user avatar clicks. |
Box(modifier = Modifier.systemBarsPadding()) {MessageList(conversationID = conversationID) {// Handle user avatar click event}}
MessageListConfigProtocol to define a fully customized style:class MyCustomConfig(override val alignment: MessageAlignment = MessageAlignment.TWO_SIDED,override val isShowTimeMessage: Boolean = true,override val isShowLeftAvatar: Boolean = true,override val isShowLeftNickname: Boolean = true,override val isShowRightAvatar: Boolean = true,override val isShowRightNickname: Boolean = true,// ... other required properties) : MessageListConfigProtocolMessageList(conversationID = conversationID, config = MyCustomConfig()) {// Handle user avatar click event}
MessageListConfigProtocol Property Descriptions:Property | Type | Description | Remarks |
alignment | MessageAlignment | Message alignment | - MessageAlignment.LEFT: left aligned. - MessageAlignment.RIGHT: right aligned. - MessageAlignment.TWO_SIDED: both sides aligned. |
isShowTimeMessage | Boolean | Show message timestamps | Controls whether message timestamps are displayed. |
isShowLeftAvatar | Boolean | Show left avatar | Controls whether the sender's avatar is shown for received messages. |
isShowLeftNickname | Boolean | Show left nickname | Controls whether the sender's nickname is shown for received messages. |
isShowRightAvatar | Boolean | Show right avatar | Controls whether your avatar is shown for sent messages. |
isShowRightNickname | Boolean | Show right nickname | Controls whether your nickname is shown for sent messages. |
isShowTimeInBubble | Boolean | Show time inside bubble | Controls whether the timestamp appears inside the message bubble. |
cellSpacing | Dp | Message spacing | Controls the spacing between adjacent messages. |
isShowSystemMessage | Boolean | Show system notifications | Controls whether system notification messages are displayed. |
isShowUnsupportMessage | Boolean | Show unsupported messages | Controls whether unsupported message types are displayed. |
horizontalPadding | Dp | Horizontal padding | Controls the left and right padding of the message list. |
avatarSpacing | Dp | Avatar spacing | Controls the spacing between the avatar and message content. |
isSupportCopy | Boolean | Enable copy in message menu | true: Display the copy action.false: Do not display the copy action. |
isSupportDelete | Boolean | Enable delete in message menu | true: Display the delete action.false: Do not display the delete action. |
isSupportRecall | Boolean | Enable recall in message menu | true: Display the recall action.false: Do not display the recall action. |
isSupportCopy, isSupportDelete, and isSupportRecall in the config parameter when initializing MessageList to control which actions are available:MessageList(conversationID = conversationID,config = ChatMessageListConfig(isSupportCopy = false)) {// Handle user avatar click event}
customActions parameter when initializing MessageList. Your custom actions will appear below the default actions:MessageList(conversationID = conversationID,customActions = listOf(MessageCustomAction(title = "Share", iconResID = R.drawable.message_list_menu_forward_icon) {println("Share Message")}))
AppBuilderConfig:// Configure at app startupAppBuilderConfig.messageActionList = listOf(MessageAction.COPY, // Enable copyMessageAction.DELETE, // Enable deleteMessageAction.RECALL // Enable recall)// Then initialize MessageList; all instances will use the above configurationMessageList(conversationID = conversationID,)
Message List Actions (Default Options) | Message List Actions (Copy Option Hidden) | Message List Actions (Share Option Added) |
![]() | ![]() | ![]() |
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback