Skip to content

非公式本サイトは非公式の日本語ドキュメントであり、Cloudflare 公式サイトではありません。最新情報はdevelopers.cloudflare.comをご確認ください。

RtkControlBarButton

最終更新 Markdown で表示Agent セットアップ

カスタムのコントロールバーボタンを組み立てるためのスケルトンコンポーネントです。

プロパティ

プロパティ 必須 デフォルト 説明
rtk_cbb_icon reference - ボタンアイコンの Drawable リソース
rtk_cbb_variant button | horizontal button レイアウトのバリエーション
rtk_cbb_showText boolean true ラベルテキストを表示するかどうか
rtk_cbb_iconSize dimension - アイコンのサイズ
rtk_cbb_iconPadding dimension - アイコンとラベルの間のパディング

メソッド

メソッド パラメーター 説明
applyDesignTokens designTokens: RtkDesignTokens テーマ用のカスタムデザイントークンを適用します
setIconDrawable drawable: Drawable? ボタンのアイコンを設定します
setIconTint color: Int アイコンのティントカラーを設定します
setText text: String? ボタンのラベルテキストを設定します
setProcessingState processing: Boolean 読み込み中のスピナーを表示または非表示にします

使用例

基本的な使い方

<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" />

メソッドを使う場合

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

役に立ちましたか?