AppCompatCheckBox
open class AppCompatCheckBox : CheckBox, TintableCompoundButton, TintableBackgroundView
kotlin.Any | ||||||
↳ | 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
andR.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.
Summary
Public constructors | |
---|---|
<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?) |
|
<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?, defStyleAttr: Int) |
Public methods | |
---|---|
open Int | |
open Unit |
setBackgroundDrawable(@Nullable background: Drawable?) |
open Unit |
setBackgroundResource(@DrawableRes resId: Int) |
open Unit |
setButtonDrawable(buttonDrawable: Drawable?) |
open Unit |
setButtonDrawable(@DrawableRes resId: Int) |
Protected methods | |
---|---|
open Unit |
Public constructors
<init>
AppCompatCheckBox(@NonNull context: Context)
<init>
AppCompatCheckBox(
@NonNull context: Context,
@Nullable attrs: AttributeSet?)
<init>
AppCompatCheckBox(
@NonNull context: Context,
@Nullable attrs: AttributeSet?,
defStyleAttr: Int)
Public methods
getCompoundPaddingLeft
open fun getCompoundPaddingLeft(): Int
Protected methods
drawableStateChanged
protected open fun drawableStateChanged(): Unit