IconMarginSpanpublic class IconMarginSpan extends Object implements LeadingMarginSpan, LineHeightSpan
Fields Summary |
---|
private android.graphics.Bitmap | mBitmap | private int | mPad |
Methods Summary |
---|
public void | chooseHeight(java.lang.CharSequence text, int start, int end, int istartv, int v, Paint.FontMetricsInt fm)
if (end == ((Spanned) text).getSpanEnd(this)) {
int ht = mBitmap.getHeight();
int need = ht - (v + fm.descent - fm.ascent - istartv);
if (need > 0)
fm.descent += need;
need = ht - (v + fm.bottom - fm.top - istartv);
if (need > 0)
fm.bottom += need;
}
| public void | drawLeadingMargin(android.graphics.Canvas c, android.graphics.Paint p, int x, int dir, int top, int baseline, int bottom, java.lang.CharSequence text, int start, int end, boolean first, android.text.Layout layout)
int st = ((Spanned) text).getSpanStart(this);
int itop = layout.getLineTop(layout.getLineForOffset(st));
if (dir < 0)
x -= mBitmap.getWidth();
c.drawBitmap(mBitmap, x, itop, p);
| public int | getLeadingMargin(boolean first)
return mBitmap.getWidth() + mPad;
|
|