Skip to content

RtkControlBarButton

A skeleton component used for composing custom controlbar buttons.

Properties

PropertyTypeRequiredDefaultDescription
rtk_cbb_iconreference-Drawable resource for the button icon
rtk_cbb_variantbutton | horizontalbuttonLayout variant
rtk_cbb_showTextbooleantrueWhether to show the label text
rtk_cbb_iconSizedimension-Size of the icon
rtk_cbb_iconPaddingdimension-Padding between icon and label

Methods

MethodParametersDescription
applyDesignTokensdesignTokens: RtkDesignTokensApply custom design tokens for theming
setIconDrawabledrawable: Drawable?Set the button icon
setIconTintcolor: IntSet the icon tint color
setTexttext: String?Set the button label text
setProcessingStateprocessing: BooleanShow or hide a loading spinner

Usage Examples

Basic Usage

<com.cloudflare.realtimekit.ui.view.controlbarbuttons.RtkControlBarButton
android:id="@+id/rtk_control_bar_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:rtk_cbb_showText="true"
app:rtk_cbb_variant="button" />

With Methods

Kotlin
val buttonView = findViewById<RtkControlBarButton>(R.id.rtk_control_bar_button)
buttonView.setOnClickListener { }