@Override public void updateDrawState(TextPaint ds) { apply(ds); if (!multiline) { ds.bgColor = theme.getCodeBackgroundColor(ds, false); } }
@Override public void drawLeadingMargin(Canvas c, Paint p, int x, int dir, int top, int baseline, int bottom, CharSequence text, int start, int end, boolean first, Layout layout) { if (multiline) { paint.setStyle(Paint.Style.FILL); paint.setColor(theme.getCodeBackgroundColor(p, true)); final int left; final int right; if (dir > 0) { left = x; right = c.getWidth(); } else { left = x - c.getWidth(); right = x; } rect.set(left, top, right, bottom); c.drawRect(rect, paint); } } }