> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-audit-mechanical-fixes.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Image Bubble

> Image Bubble — CometChat documentation.

`CometChatImageBubble` is the content view for a MediaMessage if the media sent is an image.

## Methods

| Methods         | Parameters                                                     | Description                                                   |
| --------------- | -------------------------------------------------------------- | ------------------------------------------------------------- |
| **setImageUrl** | (String url, @DrawableRes int placeHolderImage, boolean isGif) | It used to set image url which to be rendered in image bubble |
| **setCaption**  | (String caption)                                               | a text to display below the image                             |
| **setStyle**    | (ImageBubbleStyle style)                                       | used to customize appearance of this widget                   |
| **setOnClick**  | (OnClick onClick)                                              | custom action on tapping the image                            |

## ImageBubbleStyle

ImageBubbleStyle is the class containing attributes to customize appearance of this widget.

| Methods               | Type          | Description                           |
| --------------------- | ------------- | ------------------------------------- |
| **setTextAppearance** | @StyleRes int | used to set style of the caption text |
| **setBackground**     | @ColorInt int | used to set background color          |
| **setBackground**     | Drawable      | used to set a gradient background     |
| **setBorderWidth**    | int           | used to set border                    |
| **setCornerRadius**   | float         | used to set border radius             |

## Usage

<Tabs>
  <Tab title="XML">
    ```xml theme={null}
    <com.cometchat.chatuikit.shared.views.CometChatImageBubble.CometChatImageBubble
            android:id="@+id/image_bubble"
            android:layout_width="228dp"
            android:layout_height="168dp" />
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="Java">
    ```java theme={null}
    CometChatImageBubble cometChatImageBubble=view.findViewById(R.id.image_bubble);

    cometChatImageBubble.setImageUrl("https://images.pexels.com/photos/1496372/pexels-photo-1496372.jpeg",R.drawable.black_placeholder,false);
    ```
  </Tab>

  <Tab title="Kotlin">
    ```kotlin theme={null}
    val cometChatImageBubble: CometChatImageBubble = view.findViewById(R.id.image_bubble)

    cometChatImageBubble.setImageUrl(
                "https://images.pexels.com/photos/1496372/pexels-photo-1496372.jpeg",
                R.drawable.black_placeholder,
                false)
    ```
  </Tab>
</Tabs>
