Base Components | Description |
---|---|
List Base | This renders common components used across Conversations , Groups & Users . |
layout.xml
file.
OnSendButtonClick
event is typically triggered when the back button is pressed and it carries a default action. However, with the following code snippet, you can effortlessly override this default operation.
setStyle
method.
Property | Description | Code |
---|---|---|
SubtitleText Color | Sets the text color for the subtitle | setSubtitleTextColor(@ColorInt int) |
SubtitleText Appearance | Sets the text appearance for the subtitle | setSubtitleTextAppearance(@StyleRes int) |
Title Font | Sets the font for the title | setSubtitleTextAppearance(@StyleRes int) |
EmptyText Font | Sets the font for the empty state text | setEmptyTextFont(String emptyTextFont) |
EmptyText Appearance | Sets the text appearance for the empty state text | setEmptyTextAppearance(@StyleRes int ) |
ErrorText Appearance | Sets the text appearance for the error state text | setErrorTextAppearance(@StyleRes int ) |
ErrorText Appearance | Sets the text appearance for the error state text | setErrorTextAppearance(@StyleRes int ) |
ErrorText Appearance | Sets the text appearance for the error state text | setErrorTextAppearance(@StyleRes int ) |
Title Color | Sets the text color for the title | setTitleColor(@ColorInt int) |
BackIcon Tint | Sets the tint color for the back icon | setBackIconTint(@ColorInt int) |
OnlineStatus Color | Sets the text color for the online status | setOnlineStatusColor(int onlineStatusColor) |
Separator Color | Sets the color for the separator | setSeparatorColor(@ColorInt int) |
LoadingIcon Tint | Sets the tint color for the loading icon | setLoadingIconTint(@ColorInt int) |
EmptyText Color | Sets the text color for the empty state text | setEmptyTextColor(@ColorInt int |
MessageTitle Appearance | Sets the text appearance for the message title | setMessageTitleAppearance(@StyleRes int) |
MessageInformationTitle Appearance | Sets the text appearance for the message information title | setMessageInformationTitleAppearance(@StyleRes int) |
MessageText Color | Sets the text color for the message text | setMessageTextColor(@ColorInt int) |
MessageInfoText Color | Sets the text color for the message info text | setMessageInfoTextColor(@ColorInt int) |
Background Color | Sets the background color | setBackground(@ColorInt int) |
Background Drawable | Sets the drawable background | setBackground(Drawable) |
Corner Radius | Sets the corner radius | setCornerRadius(float cornerRadius) |
Border Width | Sets the width of the border | setBorderWidth(int borderWidth) |
Border Color | Sets the color of the border | setBorderColor(int borderColor) |
ListItemStyle
component in the MessageInformation Component, you can use the following code snippet. For more information, visit List Item Styles.
Avatar
component in the MessageInformation Component, you can use the following code snippet. For more information, visit Avatar.
MessageBubble
component in the MessageInformation Component, you can use the following code snippet. For further insights on MessageBubble
Styles refer
Property | Description | Code |
---|---|---|
-------- | ----------- | ---- |
Set Message | Sets the message to be displayed in the message information view. | setMessage(BaseMessage message) |
ErrorView Visibility | Sets the message to be displayed in the message information view. | setMessage(BaseMessage message) |
CometChatMesssageInformation
is a Widget, it can be added directly to the layout file as shown below.
Methods | Parameters | Description |
---|---|---|
setTemplate(CometChatMessageTemplate template) | CometChatMessageTemplate | Sets a custom message template for the message information view. |
setMessage(BaseMessage message) | BaseMessage | Sets the message to be displayed in the message information view. |
setErrorViewVisibility(int visibility) | int | Sets the visibility of the error view in the message information view. |
setTitle(String title) | String | Sets the title that will be displayed at the top of the CometChatContacts view. This method allows you to customize the title to provide relevant information or context to the users. |
setListItemView(Function3<Context, BaseMessage, MessageReceipt, View> listItemView) | Function3<Context, BaseMessage, MessageReceipt, View> | Sets a custom list item view for individual entries in the message information view. |
public void setSubtitleView(Function3<Context, BaseMessage, MessageReceipt, View> subtitleView) | Function3<Context, BaseMessage, MessageReceipt, View> | Sets a custom subtitle view for individual entries in the message information view. |
setReceiptDatePattern(Function1<MessageReceipt, String> datePattern) | Function1<MessageReceipt, String> | Sets a custom date pattern for formatting receipt dates in the message information view. |
setStyle(MessageInformationStyle style) | MessageInformationStyle | Sets the overall style and appearance for the message information view. |
setReadIcon(@DrawableRes int readIcon) | @DrawableRes int | Sets the custom icon resource for read receipts in the message information view. |
setDeliveredIcon(@DrawableRes int deliverIcon) | @DrawableRes int | Sets the custom icon resource for delivered receipts in the message information view. |
setListItemStyle(ListItemStyle listItemStyle) | ListItemStyle | Sets the style for list items in the message information view. |
setAvatarStyle(AvatarStyle avatarStyle) | AvatarStyle | Sets the style for avatars in the message information view. |
setError(OnError onError) | OnError | Sets the error callback to handle any errors that may occur within the message information view. |
emptyStateText(String message) | String | Sets the text to be displayed in the empty state view of the message information view. |
errorStateText(String errorText) | String | Sets the error message to be displayed in the error state view of the message information view. |
setEmptyStateView(@LayoutRes int id) | @LayoutRes int | Sets the custom layout resource for the empty state view of the message information view. |
setErrorStateView(@LayoutRes int id) | @LayoutRes int | Sets the custom layout resource for the error state view of the message information view. |
setLoadingStateView(@LayoutRes int id) | @LayoutRes int | Sets the custom layout resource for the loading state view of the message information view. |
setBubbleView(Function2<Context, BaseMessage, View> bubbleView) | Function2<Context, BaseMessage, View> | This method allows you to set a custom bubble view in the message information Component. |
setMessageBubbleStyle(MessageBubbleStyle messageBubbleStyle) | MessageBubbleStyle | The setMessageBubbleStyle method is used to set the style and appearance of the message bubble in the CometChatMessageInformation component. |
backIcon(@DrawableRes int res) | @DrawableRes int | The back button is typically displayed at the top-left corner of the message information view, and it allows users to navigate back to the previous screen or close the message information view. |
addOnBackPressListener(OnBackPress onBackPress) | OnBackPress | This listener is triggered when the back button is pressed within the CometChatMessageInformation view. It provides a way to handle the back button press event and implement custom behavior. |
CometChatMesssageInformation
component.
Methods | Parameters | Description |
---|---|---|
setSubtitleTextColor(int subtitleTextColor) | @ColorInt int | Sets the text color for the subtitle |
setSubtitleTextAppearance(int subtitleTextAppearance) | @StyleRes int | Sets the text appearance for the subtitle |
setTitleFont(String titleFont) | String | Sets the font for the title |
setEmptyTextFont(String emptyTextFont) | String | Sets the font for the empty state text |
setTitleAppearance(int titleAppearance) | @StyleRes int | Sets the text appearance for the title |
setEmptyTextAppearance(int emptyTextAppearance) | @StyleRes int | Sets the text appearance for the empty state text |
setErrorTextAppearance(int errorTextAppearance) | @StyleRes int | Sets the text appearance for the error state text |
setTitleColor(int titleColor) | @ColorInt int | Sets the text color for the title |
setBackIconTint(int backIconTint) | @ColorInt int | Sets the tint color for the back icon |
setOnlineStatusColor(int onlineStatusColor) | @ColorInt int | Sets the text color for the online status |
setSeparatorColor(int separatorColor) | @ColorInt int | Sets the color for the separator |
setLoadingIconTint(int loadingIconTint) | @ColorInt int | Sets the tint color for the loading icon |
setEmptyTextColor(int emptyTextColor) | @ColorInt int | Sets the text color for the empty state text |
setErrorTextColor(int errorTextColor) | @ColorInt int | Sets the text color for the error state text |
setMessageTitleAppearance(int messageTitleAppearance) | @StyleRes int | Sets the text appearance for the message title |
setMessageInformationTitleAppearance(int messageInformationTitleAppearance) | @StyleRes int | Sets the text appearance for the message information title |
setMessageTextColor(int messageTextColor) | @ColorInt int | Sets the text color for the message text |
setMessageInfoTextColor(int messageInfoTextColor) | @ColorInt int | Sets the text color for the message info text |
setBackground(int background) | @ColorInt int | Sets the background color |
setBackground(Drawable drawableBackground) | Drawable | Sets the drawable background |
setCornerRadius(float cornerRadius) | float | Sets the corner radius |
setBorderWidth(int borderWidth) | int | Sets the width of the border |
setBorderColor(int borderColor) | int | Sets the color of the border |