Google은 흑인 공동체를 위한 인종 간 평등을 진전시키기 위해 노력하고 있습니다. Google에서 어떤 노력을 하고 있는지 확인하세요.

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 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.

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

setBackgroundDrawable

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

setBackgroundResource

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

setButtonDrawable

open fun setButtonDrawable(buttonDrawable: Drawable?): Unit

setButtonDrawable

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

Protected methods

drawableStateChanged

protected open fun drawableStateChanged(): Unit