belongs to Maven artifact androidx.appcompat:appcompat:1.0.0-alpha1

AppCompatTextView

public class AppCompatTextView
extends TextView implements TintableBackgroundView

java.lang.Object
   ↳ 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

Inherited constants

Inherited fields

Public constructors

AppCompatTextView(Context context)
AppCompatTextView(Context context, AttributeSet attrs)
AppCompatTextView(Context context, AttributeSet attrs, int defStyleAttr)

Public methods

int getFirstBaselineToTopHeight()
int getLastBaselineToBottomHeight()
InputConnection onCreateInputConnection(EditorInfo outAttrs)
void setBackgroundDrawable(Drawable background)
void setBackgroundResource(int resId)
void setFirstBaselineToTopHeight(int firstBaselineToTopHeight)
void setLastBaselineToBottomHeight(int lastBaselineToBottomHeight)
void setLineHeight(int lineHeight)
void setTextAppearance(Context context, int resId)
void setTextSize(int unit, float size)

Protected methods

void drawableStateChanged()
void onLayout(boolean changed, int left, int top, int right, int bottom)
void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter)

Inherited methods

Public constructors

AppCompatTextView

AppCompatTextView (Context context)

Parameters
context Context

AppCompatTextView

AppCompatTextView (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

AppCompatTextView

AppCompatTextView (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

Public methods

getFirstBaselineToTopHeight

int getFirstBaselineToTopHeight ()

Returns
int

getLastBaselineToBottomHeight

int getLastBaselineToBottomHeight ()

Returns
int

onCreateInputConnection

InputConnection onCreateInputConnection (EditorInfo outAttrs)

Parameters
outAttrs EditorInfo

Returns
InputConnection

setBackgroundDrawable

void setBackgroundDrawable (Drawable background)

Parameters
background Drawable

setBackgroundResource

void setBackgroundResource (int resId)

Parameters
resId int

setFirstBaselineToTopHeight

void setFirstBaselineToTopHeight (int firstBaselineToTopHeight)

Parameters
firstBaselineToTopHeight int

setLastBaselineToBottomHeight

void setLastBaselineToBottomHeight (int lastBaselineToBottomHeight)

Parameters
lastBaselineToBottomHeight int

setLineHeight

void setLineHeight (int lineHeight)

Parameters
lineHeight int

setTextAppearance

void setTextAppearance (Context context, 
                int resId)

Parameters
context Context

resId int

setTextSize

void setTextSize (int unit, 
                float size)

Parameters
unit int

size float

Protected methods

drawableStateChanged

void drawableStateChanged ()

onLayout

void onLayout (boolean changed, 
                int left, 
                int top, 
                int right, 
                int bottom)

Parameters
changed boolean

left int

top int

right int

bottom int

onTextChanged

void onTextChanged (CharSequence text, 
                int start, 
                int lengthBefore, 
                int lengthAfter)

Parameters
text CharSequence

start int

lengthBefore int

lengthAfter int