public class TextDrawable extends Drawable implements Touchable, TextContent
Drawable
for mounting text content from a Component
.Component
,
TextSpec
EMPTY
Constructor and Description |
---|
TextDrawable() |
Modifier and Type | Method and Description |
---|---|
void |
draw(Canvas canvas) |
ClickableSpan[] |
getClickableSpans() |
int |
getColor() |
Layout |
getLayout() |
int |
getOpacity() |
CharSequence |
getText() |
List<CharSequence> |
getTextItems() |
float |
getTextSize() |
void |
invalidateDrawable(Drawable drawable) |
boolean |
isStateful() |
void |
mount(CharSequence text,
Layout layout,
float layoutTranslationY,
boolean clipToBounds,
ColorStateList colorStateList,
int userColor,
int highlightColor,
ClickableSpan[] clickableSpans,
ImageSpan[] imageSpans,
ClickableSpanListener spanListener,
com.facebook.litho.widget.TextDrawable.TextOffsetOnTouchListener textOffsetOnTouchListener,
int highlightStartOffset,
int highlightEndOffset,
float clickableSpanExpandedOffset,
String contextLogTag) |
void |
mount(CharSequence text,
Layout layout,
float layoutTranslationY,
ColorStateList colorStateList,
int userColor,
int highlightColor,
ClickableSpan[] clickableSpans) |
void |
mount(CharSequence text,
Layout layout,
int userColor,
ClickableSpan[] clickableSpans) |
void |
mount(CharSequence text,
Layout layout,
int userColor,
int highlightColor) |
protected boolean |
onStateChange(int[] states) |
boolean |
onTouchEvent(MotionEvent event,
View view) |
void |
scheduleDrawable(Drawable drawable,
Runnable runnable,
long l) |
void |
setAlpha(int alpha) |
void |
setColorFilter(ColorFilter cf) |
boolean |
shouldHandleTouchEvent(MotionEvent event) |
void |
unmount() |
void |
unscheduleDrawable(Drawable drawable,
Runnable runnable) |
public void draw(Canvas canvas)
public boolean isStateful()
protected boolean onStateChange(int[] states)
public boolean onTouchEvent(MotionEvent event, View view)
onTouchEvent
in interface Touchable
public boolean shouldHandleTouchEvent(MotionEvent event)
shouldHandleTouchEvent
in interface Touchable
public void mount(CharSequence text, Layout layout, int userColor, ClickableSpan[] clickableSpans)
public void mount(CharSequence text, Layout layout, int userColor, int highlightColor)
public void mount(CharSequence text, Layout layout, float layoutTranslationY, ColorStateList colorStateList, int userColor, int highlightColor, ClickableSpan[] clickableSpans)
public void mount(CharSequence text, Layout layout, float layoutTranslationY, boolean clipToBounds, ColorStateList colorStateList, int userColor, int highlightColor, ClickableSpan[] clickableSpans, ImageSpan[] imageSpans, ClickableSpanListener spanListener, com.facebook.litho.widget.TextDrawable.TextOffsetOnTouchListener textOffsetOnTouchListener, int highlightStartOffset, int highlightEndOffset, float clickableSpanExpandedOffset, String contextLogTag)
public void unmount()
public ClickableSpan[] getClickableSpans()
public void setAlpha(int alpha)
public void setColorFilter(ColorFilter cf)
public int getOpacity()
public CharSequence getText()
public int getColor()
public float getTextSize()
public Layout getLayout()
public List<CharSequence> getTextItems()
getTextItems
in interface TextContent
public void invalidateDrawable(Drawable drawable)
public void scheduleDrawable(Drawable drawable, Runnable runnable, long l)
public void unscheduleDrawable(Drawable drawable, Runnable runnable)