Google は、黒人コミュニティに対する人種平等の促進に取り組んでいます。取り組みを見る

AppCompatToggleButton

open class AppCompatToggleButton : ToggleButton, TintableBackgroundView
kotlin.Any
   ↳ android.view.View
   ↳ android.widget.TextView
   ↳ android.widget.Button
   ↳ android.widget.CompoundButton
   ↳ android.widget.ToggleButton
   ↳ androidx.appcompat.widget.AppCompatToggleButton

A ToggleButton which supports compatible features on older versions of the platform, including:

This will automatically be used when you use ToggleButton in your layouts. You should only need to manually use this class when writing custom views.

Summary

Public constructors
<init>(@NonNull context: Context)

<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?)

<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?, defStyleAttr: Int)

Public methods
open Unit
setBackgroundDrawable(@Nullable background: Drawable?)

open Unit
setBackgroundResource(@DrawableRes resId: Int)

Protected methods
open Unit

Public constructors

<init>

AppCompatToggleButton(@NonNull context: Context)

<init>

AppCompatToggleButton(
    @NonNull context: Context,
    @Nullable attrs: AttributeSet?)

<init>

AppCompatToggleButton(
    @NonNull context: Context,
    @Nullable attrs: AttributeSet?,
    defStyleAttr: Int)

Public methods

setBackgroundDrawable

open fun setBackgroundDrawable(@Nullable background: Drawable?): Unit

setBackgroundResource

open fun setBackgroundResource(@DrawableRes resId: Int): Unit

Protected methods

drawableStateChanged

protected open fun drawableStateChanged(): Unit