public class RestrictedLockImageSpan extends ImageSpan
ALIGN_BASELINE, ALIGN_BOTTOM, mVerticalAlignment
Constructor and Description |
---|
RestrictedLockImageSpan(Context context) |
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)
Draws the span into the canvas.
|
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 fontMetrics)
Returns the width of the span.
|
getVerticalAlignment
updateDrawState, updateMeasureState
getUnderlying
wrap
public RestrictedLockImageSpan(Context context)
public Drawable getDrawable()
DynamicDrawableSpan
getDrawable
in class ImageSpan
public void draw(Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom, Paint paint)
ReplacementSpan
draw
in class DynamicDrawableSpan
canvas
- Canvas into which the span should be rendered.text
- Current text.start
- Start character index for span.end
- End character index for span.x
- Edge of the replacement closest to the leading margin.top
- Top of the line.y
- Baseline.bottom
- Bottom of the line.paint
- Paint instance.public int getSize(Paint paint, CharSequence text, int start, int end, Paint.FontMetricsInt fontMetrics)
ReplacementSpan
Paint.FontMetricsInt
. If the span covers the whole
text, and the height is not set,
ReplacementSpan.draw(Canvas, CharSequence, int, int, float, int, int, int, Paint)
will not be
called for the span.getSize
in class DynamicDrawableSpan
paint
- Paint instance.text
- Current text.start
- Start character index for span.end
- End character index for span.fontMetrics
- Font metrics, can be null.