My Text Message Item
fun MyTextMessageItem(message: UikitUserMessage, modifier: Modifier = Modifier, onMessageClick: (UikitUserMessage) -> Unit = {}, onMessageLongClick: (UikitUserMessage) -> Unit = {}, onEmojiReactionClick: (UikitBaseMessage, String, Boolean) -> Unit = { _, _, _ -> }, onEmojiReactionLongClick: (UikitBaseMessage, UiKitReaction) -> Unit = { _, _ -> }, onEmojiReactionMoreButtonClick: (UikitBaseMessage) -> Unit = { }, textBackgroundColor: Color = MaterialTheme.colorScheme.primary, textStyle: TextStyle = MaterialTheme.typography.bodySmall, textColor: Color = MaterialTheme.colorScheme.background.copy(alpha = SendbirdOpacity.HighOpacity), messageGroupingPosition: MessageGroupingPosition = MessageGroupingPosition.Single, ogTagMessage: @Composable (message: UikitUserMessage) -> Unit = { userMessage ->
userMessage.ogMetaData?.let { ogData ->
OgTagMessage(
modifier = Modifier,
ogMetaData = ogData,
onLinkClick = { onMessageClick(userMessage) },
onLinkLongClick = { onMessageLongClick(userMessage) },
backgroundColor = if (SendbirdUikitCompose.isDarkTheme) {
MaterialTheme.colorScheme.surfaceContainerHighest
} else {
MaterialTheme.colorScheme.surfaceBright
}
)
}
}, emojiReactionList: @Composable (message: UikitBaseMessage) -> Unit = { baseMessage ->
EmojiReactionList(
message = baseMessage,
useMoreButton = true,
onEmojiReactionClick = onEmojiReactionClick,
onEmojiReactionLongClick = onEmojiReactionLongClick,
onEmojiReactionMoreButtonClick = onEmojiReactionMoreButtonClick,
)
})
A Composable to display the current user's UikitUserMessage item using the MyMessageItem.
Since
1.0.0
Parameters
message
The UikitUserMessage to display.
modifier
The modifier to be applied to the view.
on Message Click
The handler for when the message is clicked.
on Message Long Click
The handler for when the message is long clicked.
on Emoji Reaction Click
The handler for when the reaction is clicked.
on Emoji Reaction Long Click
The handler for when the reaction is long clicked.
on Emoji Reaction More Button Click
The handler for when the emoji reaction more button is clicked.
text Background Color
The background color of the text message.
text Style
The style of the text message.
text Color
The color of the text message.
message Grouping Position
The position of the message in the message group.
og Tag Message
The Composable to display the Open Graph tag message.
emoji Reaction List
The Composable to display the emoji reaction list.