Code example for TextPaint

Methods: measureText, setTextSize

0
		if (dueDateWidth != null)
			return dueDateWidth;
		if (dueDate == null)
			return 0.0f; 
 
		final TextPaint p = new TextPaint(getPaint());
		p.setTextSize(dueFontSizePx);
		dueDateWidth = p.measureText(dueDate);
		return dueDateWidth;
	} 
 
	@Override 
	public void setSelected(final boolean selected) {
		super.setSelected(selected);
		updateBackground(); 
	} 
 
	@Override 
	public void setPressed(final boolean pressed) {
		super.setPressed(pressed);
		updateBackground();