CometChatListBase
is a custom UI Component which displays common components used across Conversations
, Groups
& Users
. It serves as the base component from which these components are inherited.
<Component> extends CometChatListBase
Example: CometChatUsers extends CometChatListBase
CometChatListBase.
You will be able to modify the background using the below methods:
Methods | Description |
---|---|
setBackground(@ColorInt int Color) | This method will set the background color for CometChatListBase. |
setBackground(int[] colorArray, GradientDrawable.Orientation orientation) | This method will set the background drawable for CometChatListBase,It take an array of multiple colors for the gradient background. |
setBackground(Drawable drawable) | This method will set the background drawable for CometChatListBase. |
TextView
that specifies a title for CometChatListBase
. You will be able to modify the title using the below methods:
Methods | Description |
---|---|
setTitle(String title) | This method will set the title for CometChatListBase |
setTitleColor(@ColorInt int color) | This method will set the title for CometChatListBase |
setTitleFont(String font) | This method will set the title font for CometChatListBase |
setTitleAppearance(int appearanceStyle) | This method will set the appearance of title for CometChatListBase |
TextInputLayout
which is responsible for displaying and handling events for the search bar in CometChatListBase
. You will be able to modify the search bar using the below methods:
Methods | Description |
---|---|
setSearchBackground(@ColorInt int searchBoxColor) | This method will set the background color for seach bar in CometChatListBase |
setSearchCornerRadius(float searchBarRadius) | This method will set the corner radius for the search bar in CometChatListBase |
setSearchTextColor(@ColorInt int color) | This method will set the text color for search bar in CometChatListBase |
setSearchText(String text) | This method will set the text for search bar in CometChatListBase |
setSearchPlaceholderText(String placeholder) | This method will set the place holder text in search bar |
setSearchPlaceHolderColor | This method will set the place holder text color in search bar |
setSearchTextFont(String fontName) | This method will set the font for search bar in CometChatListBase |
setSearchBorderWidth(int width) | This method will set the border for search bar in CometChatListBase |
setSearchBorderColor(@ColorInt int color) | This method will set the border color for the search bar in CometChatListBase |
hideSearch(boolean IsSearchBoxVisible) | This method will hide/unhide the search bar as per boolean value |
ImageButton
the user can show if they wish to. This button can be modified using the following method:
Methods | Description |
---|---|
showBackButton(boolean isVisible) | This method will hide/show the close button as per boolean value, the user must provide the tint color for the close button icon. |
backIconTint(@ColorInt int color) | Set’s the back icon color |
backIcon(@DrawableRes int res) | Set’s the back icon |
backIcon(Drawable res) | Set’s the back icon |
Methods | Description |
---|---|
setMenu | This method will help to add view at the top right corner of CometChatListBase. |
hideMenuIcon(boolean value) | This Method will hide/unhide menu icon |
OnEventListener
it will provide the events for search-bar and on the click of back button present in the CometChatListBase.
Event | Description |
---|---|
addOnSearchListener(OnSearch eventListener) | This event will be executed whenever the text in search bar changes or “Search” Icon is clicked from keyboard. It will return the text which user has entered in the search bar. |
addOnBackPressListener(OnBackPress onBackPress) | When the back button is visible and the user clicks on the back button then this event will be executed |