Skip to main content
Version: v4

Audio Bubble

CometChatAudioBubble is the content view for a MediaMessage if the media sent is an audio.

Methods

MethodsTypeDescription
setAudioUrlStringused to set the Audio url for the bubble
setTitleTextStringa text to display as name of the audio file
setSubtitleTextStringa text to display below the name of the audio file
setStyleAudioBubbleStyleused to customize appearance of this widget
setPlayIcon@DrawableRes intcustomize the icon to display to play the audio
setPauseIcon@DrawableRes intcustomize the icon to display to pause the audio
setOnClickOnClickOverride the click event when tapped on play icon

AudioBubbleStyle

AudioBubbleStyle is the class containing methods to customize appearance of this widget.

MethodsTypeDescription
setTitleTextAppearance@StyleRes

int
used to set style of the name of the audio file
setSubtitleTextAppearance@StyleRes

int
used to set style of the text below the name of the audio file
setPlayIconTint@ColorInt

int
used to provide color to the audio play icon
setPauseIconTint@ColorInt

int
used to provide color to the audio pause icon
setBackground@ColorInt

int
used to set background color
setBackgroundDrawableused to set a gradient background
setBorderWidthintused to set border
setCornerRadiusfloatused to set border radius

Usage

CometChatAudioBubble videoBubble = new CometChatAudioBubble(getContext());
videoBubble.setAudioUrl("https://data-us.cometchat.io/208434241880dc4d/media/1676385385_2121040948_0a18fc37cb5afbe4cf833020017274e0.mp3", "Sample Audio", "music");