Skip to main content
Version: v4

Text Bubble

CometChatTextBubble is the content view shown for TextMessage.

MethodsTypeDescription
setTextStringthe text to display
setStyleTextBubbleStyleused to customize appearance of this widget
setCompoundDrawable@DrawableRes intused to set image at the start,end,top or bottom of the text.
setCompoundDrawableIconTint@ColorInt intused to set the image tint color

TextBubbleStyle

TextBubbleStyle is the class containing attributes to customize appearance of this widget.

MethodsTypeDescription
setTextAppearance@StyleRes

int
used to set style of the text of the message
setBackground@ColorInt

int
used to set background color
setBackgroundDrawableused to set a Drawable background
setBorderWidthintused to set border
setCornerRadiusfloatused to set corner radius

Usage

<com.cometchat.chatuikit.shared.views.CometChatTextBubble.CometChatTextBubble
android:id="@+id/text_bubble"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
CometChatTextBubble cometChatTextBubble=view.findViewById(R.id.text_bubble);
cometChatTextBubble.setText("Keep calm and chat on!");