Interface ChatMessageTextTransformer
-
- All Implemented Interfaces:
public interface ChatMessageTextTransformerTransforms a MessageListItem.MessageItem to format or style the TextView.
Instances can be provided by implementing this interface and installing that in ChatUI.
-
-
Method Summary
Modifier and Type Method Description abstract UnittransformAndApply(TextView textView, MessageListItem.MessageItem messageItem)Transforms a given MessageListItem.MessageItem and sets the formatted string to the TextView. -
-
Method Detail
-
transformAndApply
abstract Unit transformAndApply(TextView textView, MessageListItem.MessageItem messageItem)
Transforms a given MessageListItem.MessageItem and sets the formatted string to the TextView.
For example, this implementation would convert the message to upper case and then set it to the textView.
val toUpperCaseTransformer = ChatMessageTextTransformer { textView, messageItem -> val upperCaseMessage = messageItem.message.text.uppercase(Locale.getDefault()) textView.text = upperCaseMessage }
-
-
-
-