open class AppCompatCheckBox : CheckBox
   ↳ android.view.View
   ↳ android.widget.TextView
   ↳ android.widget.Button
   ↳ android.widget.CompoundButton
   ↳ android.widget.CheckBox
   ↳ androidx.appcompat.widget.AppCompatCheckBox

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

  • Allows dynamic tint of its background via the background tint methods in androidx.core.widget.CompoundButtonCompat.
  • Allows setting of the background tint using R.attr#buttonTint and R.attr#buttonTintMode.

This will automatically be used when you use CheckBox in your layouts and the top-level activity / dialog is provided by appcompat. You should only need to manually use this class when writing custom views.


Public constructors
<init>(context: Context!)

<init>(context: Context!, attrs: AttributeSet!)

<init>(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

Public methods
open Unit
setButtonDrawable(buttonDrawable: Drawable!)

open Unit

open Int

Public constructors


AppCompatCheckBox(context: Context!)


AppCompatCheckBox(context: Context!, attrs: AttributeSet!)


AppCompatCheckBox(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

Public methods


open fun setButtonDrawable(buttonDrawable: Drawable!): Unit


open fun setButtonDrawable(resId: Int): Unit


open fun getCompoundPaddingLeft(): Int