CometChatBadge is the custom component which is used to display the unread message count. It can be used in places like CometChatListItem, etc.

How to integrate CometChatBadgeCount ?
SinceCometChatBadge is a custom view, it can be added directly in the layout file or you can use it in Java. CometChatBadge includes various attributes and methods to customize its UI.
Usage in XML
- XML
XML Attributes
| Parameters | Description |
|---|---|
app:count_background_color | Used to set the backgroundColor |
app:strokeWidth | Used to set the borderWidth |
app:count | Used to set value of count. |
app:count_color | Used to set color of count value. |
app:count_size | Used to set text size of count value |
- XML
Methods
Customization
This Methods are use to do modify the appearance of CometChatBadge| Methods | Description |
|---|---|
| cornerRadius(float radius) | Used to set the cornerRadius |
| borderColor(@ColorInt int color) | Used to set the borderColor |
| setBackground(@ColorInt int color) | Used to set the backgroundColor |
| borderWidth(int width) | Used to set the borderWidth |
| setCount(int counValue) | Used to set value of count. |
| setTextColor(@ColorInt int color) | Used to set color of count value(TextView) |
| setTextSize(float size) | Used to set text size of count value |
- Java
- Kotlin