List of usage examples for android.text Layout getLineDescent
public abstract int getLineDescent(int line);
From source file:com.android.ex.chips.RecipientEditTextView.java
private MoreImageSpan createMoreSpan(final int count) { final String moreText = String.format(mMoreItem.getText().toString(), count); final TextPaint morePaint = new TextPaint(getPaint()); morePaint.setTextSize(mMoreItem.getTextSize()); morePaint.setColor(mMoreItem.getCurrentTextColor()); final int width = (int) morePaint.measureText(moreText) + mMoreItem.getPaddingLeft() + mMoreItem.getPaddingRight(); final int height = getLineHeight(); final Bitmap drawable = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); final Canvas canvas = new Canvas(drawable); int adjustedHeight = height; final Layout layout = getLayout(); if (layout != null) adjustedHeight -= layout.getLineDescent(0); canvas.drawText(moreText, 0, moreText.length(), 0, adjustedHeight, morePaint); final Drawable result = new BitmapDrawable(getResources(), drawable); result.setBounds(0, 0, width, height); return new MoreImageSpan(result); }