> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Status Indicator

> Status Indicator — CometChat documentation.

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

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b/HFXOvmhiLRb5ClID/images/917825b6-ltyjb5ctoay86mcws67c02sfyfnsf6ffp68u0oznn0vp6m6f28tlfvdmsmhjxjhe-009bb23d6fec659cca5735a2a1baa79c.png?fit=max&auto=format&n=HFXOvmhiLRb5ClID&q=85&s=a6d8a7f832c2e48853ed2220ef486949" width="1224" height="404" data-path="images/917825b6-ltyjb5ctoay86mcws67c02sfyfnsf6ffp68u0oznn0vp6m6f28tlfvdmsmhjxjhe-009bb23d6fec659cca5735a2a1baa79c.png" />
</Frame>

## 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

<Tabs>
  <Tab title="XML">
    ```xml theme={null}
    <com.cometchat.chatuikit.shared.views.CometChatStatusIndicator.CometChatStatusIndicator
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/status"
            />
    ```
  </Tab>
</Tabs>

## Methods

### **Customization**

This Methods are use to do modify the appearance of CometChatStatusIndicator

| Methods                | Type             | Description                      |
| ---------------------- | ---------------- | -------------------------------- |
| **setCornerRadius**    | int              | Used to set the cornerRadius     |
| **setBorderColor**     | @ColorInt int    | Used to set the borderColor      |
| **setBackgroundColor** | @ColorInt int    | Used to set the backgroundColor  |
| **setBackgroundImage** | @DrawableRes int | Used to set the background image |
| **setBorderWidth**     | int              | Used to set the borderWidth      |

<Tabs>
  <Tab title="Java">
    ```java theme={null}
    //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);
    ```
  </Tab>

  <Tab title="Kotlin">
    ```kotlin theme={null}
    //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)
    ```
  </Tab>
</Tabs>

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b/L67V-UjCgqzL1qxp/images/732d7e41-ml79uprjjck1ru7z271vjwoy8bqv4a93zuv4zs77q59tdzmti04zk7vu86uq4wuf-683ba401e2fe3c8eb81e7e73fb9aec2c.png?fit=max&auto=format&n=L67V-UjCgqzL1qxp&q=85&s=d20f12afd5a3778796f2fa95b799f3d5" width="2332" height="370" data-path="images/732d7e41-ml79uprjjck1ru7z271vjwoy8bqv4a93zuv4zs77q59tdzmti04zk7vu86uq4wuf-683ba401e2fe3c8eb81e7e73fb9aec2c.png" />
</Frame>
