Conversations
in your Fragment
, use the following code snippet.ItemClickListener
is triggered when you click on a ListItem of the Conversations component. The ItemClickListener
action doesn’t have a predefined behavior. You can override this action using the following code snippet.
OnBackPressListener
is triggered when you press the back button in the app bar. It has a predefined behavior; when clicked, it navigates to the previous activity. However, you can override this action using the following code snippet.
OnSelection
event is triggered upon the completion of a selection in SelectionMode
. It does not have a default behavior. However, you can override its behavior using the following code snippet.
ConversationsRequestBuilder
in the Conversations Component to filter the conversation list. You can modify the builder as per your specific requirements with multiple options available to know more refer to ConversationRequestBuilder.
You can set filters using the following parameters.
User
or Groups
Tag
Tag
Tag
Component
. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.
ConversationsStyle
to the Conversations
Component to customize the styling.
Property | Description | Code |
---|---|---|
Background Color | Used to set the background color | setBackground(@color init) |
Background Drawable | Used to set background Drawable | setBackground(@drawable int) |
Border Width | Used to set border width | setBorderWidth(int) |
Border Color | Used to set border color | setBorderColor(@color ini) |
Corner Radius | Used to set border radius | setCornerRadius(float) |
Title Appearance | Used to customise the appearance of the title in the app bar | setTitleAppearance(@style int) |
BackIcon Tint | Used to set the color of the back icon in the app bar | setBackIconTint(@color int) |
OnlineStatus Color | Used to set the color of the status indicator shown if a member is online | setOnlineStatusColor(@color int) |
Separator Color | Used to set the color of the divider separating the group member items | setSeparatorColor(@color int) |
LastMessageText Appearance | Used to set the style of the text for the last message | setLastMessageTextAppearance(@style int) |
ThreadIndicatorText Appearance | Used to set the style of the text for the thread indicator | setThreadIndicatorTextAppearance(@style int) |
ErrorText Color | Used to set the color of the text for the error Text. | setErrorTextColor(@color int) |
LastMessageText Color | Used to set the color of the text for the last message. | setLastMessageTextColor(@color int) |
TypingIndicatorTextColor | Used to set the color of the typing indicator text. | setLastMessageTextColor(@color int) |
LastMessageText Color | Used to set the color of the text for the last message. | setLastMessageTextColor(@color int) |
ThreadIndicatorText Color | Used to set the color of thread indicator text | setThreadIndicatorTextColor(@color int) |
Avatar
component in the Conversations
Component, you can use the following code snippet. For more information, visit Avatar Styles.
Conversations
Component, you can use the following code snippet. For more information, visit Indicator Styles.
Date
component in the Conversations
Component, you can use the following code snippet. For more information, visit Date Styles.
Badge
component in the Conversations
Component, you can use the following code snippet. For more information, visit Badge Styles.
ListItemStyle
component in the Conversations
Component, you can use the following code snippet. For more information, visit List Item Styles.
Property | Description | Code |
---|---|---|
Title | Used to set custom title in the app bar. | .setTitle("Your Custom Title") |
EmptyState Text | Used to set a custom text response when fetching the conversations has returned an empty list | .emptyStateText("Your Custom Title") |
Selection Mode | Used to set a custom text response when fetching the conversations has returned an empty list | .setSelectionMode(UIKitConstants.SelectionMode.MULTIPLE); |
SearchPlaceholder Text | Used to set placeholder text for the search field | .setSearchPlaceholderText("YOUR_CUSTOM_PLACEHOLDER"); |
ProtectedGroup Icon | Used to set icon shown in place of status indicator for password protected group | .setProtectedGroupIcon(getDrawable(R.drawable.your_icon)); |
SearchBox Icon | Used to set search Icon in the search field | .setSearchBoxIcon(getDrawable(R.drawable.your_icon)); |
SentIcon Icon | Used to customize the receipt icon shown in the subtitle of the conversation item if hideReceipt is false and if the status of the last message in the conversation is sent | .setSentIcon(getDrawable(R.drawable.your_icon)); |
Delivered Icon | Used to customize the receipt icon shown in the subtitle of the conversation item if hideReceipt is false and if the status of the last message in the conversation is delivered | .setDeliveredIcon(getDrawable(R.drawable.your_icon)); |
Read Icon | Used to customize the receipt icon shown in the subtitle of the conversation item if hideReceipt is false and if the status of the last message in the conversation is read | .setReadIcon(getDrawable(R.drawable.your_icon)) |
Back Icon | used to set back button located in the app bar | .backIcon(getDrawable(R.drawable.your_back_icon)); |
Show BackButton | Used to toggle visibility for back button in the app bar | .showBackButton(true); |
Hide Search | Used to toggle visibility for search box | .hideSearch(false); |
Hide Error | Used to hide error on fetching conversations | .hideError(false); |
Hide Separator | Used to control visibility of Separators in the list view | .hideSeparator(false); |
Disable UsersPresence | Used to control visibility of status indicator shown if user is online | .disableUsersPresence(false); |
Hide Receipt | Used to hide receipts shown in the subtitle of the conversation item without disabling the functionality of marking messages as read and delivered. | .hideReceipt(false); |
Disable Typing | Used to toggle visibility of typing indicator | .disableTyping(false); |
Disable Mentions | Sets whether mentions in text should be disabled. Processes the text formatters If there are text formatters available and the disableMentions flag is set to true, it removes any formatters that are instances of CometChatMentionsFormatter. | .setDisableMentions(true); |
item_converation_list.xml
as a custom layout file. Which we will inflate in setListItemView()
setListItemView
you need to inflate the XML and initialize the views using the conversation objects.
view_menu.xml
as a custom view file. Which we will inflate and pass it to .setMenu
.
setMenu
. You can get the child view reference and can handle click actions.
setLoadingStateView
to match the loading view of your app.
ContentLoadingProgressBar
to loading_view_layout.xml
. You can choose any view you prefer. This view should be inflated and passed to the setLoadingStateView()
method.
ErrorStateView
using setEmptyStateView
to match the error view of your app.
error_state_view_layout.xml
. You can choose any view you prefer. This view should be inflated and passed to the setErrorStateView()
method.