AppCompatCheckBox
class AppCompatCheckBox : CheckBox, TintableCompoundButton, TintableBackgroundView, EmojiCompatConfigurationView, TintableCompoundDrawablesView
| 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
buttonTintandbuttonTintMode.
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 |
|---|
AppCompatCheckBox(context: Context) |
AppCompatCheckBox(context: Context, attrs: AttributeSet?) |
AppCompatCheckBox(context: Context, attrs: AttributeSet?, defStyleAttr: Int) |
Public functions |
|
|---|---|
Boolean |
|
Unit |
setAllCaps(allCaps: Boolean) |
Unit |
setBackgroundDrawable(background: Drawable?)This function is deprecated. |
Unit |
setBackgroundResource(resId: @DrawableRes Int) |
Unit |
setButtonDrawable(buttonDrawable: Drawable!) |
Unit |
setButtonDrawable(resId: @DrawableRes Int) |
Unit |
setCompoundDrawables( |
Unit |
setCompoundDrawablesRelative( |
Unit |
setEmojiCompatEnabled(enabled: Boolean)Configure emoji fallback behavior using EmojiCompat. |
Unit |
setFilters(filters: Array<InputFilter!>) |
Protected functions |
|
|---|---|
Unit |
Inherited Constants |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
AppCompatCheckBox
AppCompatCheckBox(context: Context, attrs: AttributeSet?, defStyleAttr: Int)
Public functions
isEmojiCompatEnabled
fun isEmojiCompatEnabled(): Boolean
| Returns | |
|---|---|
Boolean |
the current enabled state, set via |
setCompoundDrawables
fun setCompoundDrawables(
left: Drawable?,
top: Drawable?,
right: Drawable?,
bottom: Drawable?
): Unit
setCompoundDrawablesRelative
fun setCompoundDrawablesRelative(
start: Drawable?,
top: Drawable?,
end: Drawable?,
bottom: Drawable?
): Unit
setEmojiCompatEnabled
fun setEmojiCompatEnabled(enabled: Boolean): Unit
Configure emoji fallback behavior using EmojiCompat. When enabled, this View will attempt to use EmojiCompat to enabled missing emojis. When disabled, this View will not display missing emojis using EmojiCompat. EmojiCompat must be correctly configured on a device for this to have an effect, which will happen by default if a correct downloadable fonts provider is installed on the device. If you manually configure EmojiCompat by calling EmojiCompat init after this View is constructed, you may call this method again to enable EmojiCompat on this text view. For more information about EmojiCompat configuration see the emoji2 module.
| Parameters | |
|---|---|
enabled: Boolean |
if true, display missing emoji using EmojiCompat, otherwise display missing emoji using a fallback glyph "□" (known as tofu) |