Code example for TextPaint

Methods: ascent, getTextSize, setTextSize

0
		public VerseNumberSpan(boolean applyColor) {
			this.applyColor = applyColor;
		} 
		 
		@Override public void updateMeasureState(TextPaint tp) {
			tp.baselineShift += (int) (tp.ascent() * 0.3f + 0.5f);
			tp.setTextSize(tp.getTextSize() * 0.7f);
		} 
	 
		@Override public void updateDrawState(TextPaint tp) {
			tp.baselineShift += (int) (tp.ascent() * 0.3f + 0.5f);
			tp.setTextSize(tp.getTextSize() * 0.7f);
			if (applyColor) {
				tp.setColor(S.applied.verseNumberColor);
			} 
		} 
	} 
	 
	static class XrefAttrSpan extends ReplacementSpan {
		private final Context context;
        private Drawable drawable;