AppCompatCheckedTextView
class AppCompatCheckedTextView : CheckedTextView, TintableBackgroundView, EmojiCompatConfigurationView, TintableCompoundDrawablesView
| kotlin.Any | ||||
| ↳ | android.view.View | |||
| ↳ | android.widget.TextView | |||
| ↳ | android.widget.CheckedTextView | |||
| ↳ | androidx.appcompat.widget.AppCompatCheckedTextView |
A CheckedTextView 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.view.ViewCompat. - Allows setting of the background tint using
backgroundTintandbackgroundTintMode. - Allows dynamic tint of its check mark via the check mark tint methods in
androidx.core.widget.CheckedTextViewCompat. - Allows setting of the check mark tint using checkMarkTint and checkMarkTintMode.
- Allows setting of the font family using
fontFamily
This will automatically be used when you use CheckedTextView 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 |
|---|
AppCompatCheckedTextView(context: Context) |
AppCompatCheckedTextView(context: Context, attrs: AttributeSet?) |
AppCompatCheckedTextView( |
Public functions |
|
|---|---|
ActionMode.Callback? |
|
Boolean |
|
InputConnection? |
onCreateInputConnection(outAttrs: EditorInfo) |
Unit |
setAllCaps(allCaps: Boolean) |
Unit |
setBackgroundDrawable(background: Drawable?)This function is deprecated. |
Unit |
setBackgroundResource(resId: @DrawableRes Int) |
Unit |
|
Unit |
setCheckMarkDrawable(resId: @DrawableRes Int) |
Unit |
setCompoundDrawables( |
Unit |
setCompoundDrawablesRelative( |
Unit |
setCustomSelectionActionModeCallback( |
Unit |
setEmojiCompatEnabled(enabled: Boolean)Configure emoji fallback behavior using EmojiCompat. |
Unit |
setTextAppearance(context: Context, resId: Int)This function is deprecated. |
Protected functions |
|
|---|---|
Unit |
Inherited Constants |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
AppCompatCheckedTextView
AppCompatCheckedTextView(context: Context, attrs: AttributeSet?)
AppCompatCheckedTextView
AppCompatCheckedTextView(
context: Context,
attrs: AttributeSet?,
defStyleAttr: Int
)
Public functions
getCustomSelectionActionModeCallback
fun getCustomSelectionActionModeCallback(): ActionMode.Callback?
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
setCustomSelectionActionModeCallback
fun setCustomSelectionActionModeCallback(
actionModeCallback: ActionMode.Callback?
): 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) |