Android 12 Developer Preview is here! Try it out, and give us your feedback!

AppCompatTextView

open class AppCompatTextView : TextView, TintableBackgroundView, TintableCompoundDrawablesView, AutoSizeableTextView
kotlin.Any
   ↳ android.view.View
   ↳ android.widget.TextView
   ↳ androidx.appcompat.widget.AppCompatTextView

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

This will automatically be used when you use TextView 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 Int

open CharSequence!

open TextClassifier

Returns the TextClassifier used by this TextView.

open PrecomputedTextCompat.Params

Gets the parameters for text layout precomputation, for use with PrecomputedTextCompat.

open InputConnection!

open Unit
setBackgroundDrawable(@Nullable background: Drawable?)

open Unit
setBackgroundResource(@DrawableRes resId: Int)

open Unit
setCompoundDrawables(@Nullable left: Drawable?, @Nullable top: Drawable?, @Nullable right: Drawable?, @Nullable bottom: Drawable?)

open Unit
setCompoundDrawablesRelative(@Nullable start: Drawable?, @Nullable top: Drawable?, @Nullable end: Drawable?, @Nullable bottom: Drawable?)

open Unit
setCompoundDrawablesRelativeWithIntrinsicBounds(@Nullable start: Drawable?, @Nullable top: Drawable?, @Nullable end: Drawable?, @Nullable bottom: Drawable?)

open Unit