public abstract class DynamicDrawableSpan extends ReplacementSpan
Modifier and Type | Field and Description |
---|---|
static int |
ALIGN_BASELINE
A constant indicating that the bottom of this span should be aligned
with the baseline of the surrounding text.
|
static int |
ALIGN_BOTTOM
A constant indicating that the bottom of this span should be aligned
with the bottom of the surrounding text, i.e., at the same level as the
lowest descender in the text.
|
protected int |
mVerticalAlignment |
Modifier | Constructor and Description |
---|---|
|
DynamicDrawableSpan() |
protected |
DynamicDrawableSpan(int verticalAlignment) |
Modifier and Type | Method and Description |
---|---|
void |
draw(Canvas canvas,
CharSequence text,
int start,
int end,
float x,
int top,
int y,
int bottom,
Paint paint) |
abstract Drawable |
getDrawable()
Your subclass must implement this method to provide the bitmap
to be drawn.
|
int |
getSize(Paint paint,
CharSequence text,
int start,
int end,
Paint.FontMetricsInt fm) |
int |
getVerticalAlignment()
Returns the vertical alignment of this span, one of
ALIGN_BOTTOM or
ALIGN_BASELINE . |
updateDrawState, updateMeasureState
getUnderlying
wrap
public static final int ALIGN_BOTTOM
public static final int ALIGN_BASELINE
protected final int mVerticalAlignment
public DynamicDrawableSpan()
protected DynamicDrawableSpan(int verticalAlignment)
verticalAlignment
- one of ALIGN_BOTTOM
or ALIGN_BASELINE
.public int getVerticalAlignment()
ALIGN_BOTTOM
or
ALIGN_BASELINE
.public abstract Drawable getDrawable()
public int getSize(Paint paint, CharSequence text, int start, int end, Paint.FontMetricsInt fm)
getSize
in class ReplacementSpan
public void draw(Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom, Paint paint)
draw
in class ReplacementSpan