Skip to main content
Version: v4

Status Indicator

CometChatStatusIndicator is a customized component which indicates whether user is online or offline. You can customize the borderColor, borderSize, and backgroundColor of this component.

Image

How to integrate CometChatStatusIndicator ?

Since CometChatStatusIndicator is a custom view, it can be added directly in the layout file or you can use it in Java. CometChatStatusIndicator includes various attributes and methods to customize its UI.

Usage in XML

<com.cometchat.chatuikit.shared.views.CometChatStatusIndicator.CometChatStatusIndicator
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/status"
/>

Methods

Customization

This Methods are use to do modify the appearance of CometChatStatusIndicator

MethodsTypeDescription
setCornerRadiusintUsed to set the cornerRadius
setBorderColor@ColorInt intUsed to set the borderColor
setBackgroundColor@ColorInt intUsed to set the backgroundColor
setBackgroundImage@DrawableRes intUsed to set the background image
setBorderWidthintUsed to set the borderWidth
//syntax for cornerRadius(int radius)
status_indicator.setCornerRadius(100);

//syntax for borderColor(@ColorInt int color)
status_indicator.setBorderColor(getResources().getColor(R.color.black));

//syntax for setCardBackgroundColor(@ColorInt int color)
status_indicator.setCardBackgroundColor(Color.parseColor("#FF606D"));

//syntax for borderWidth(int borderWidth)
status_indicator.setBorderWidth(2);
Image