Code example for Paint

Methods: getFontMetrics, setTypeface

0
		setMeasuredDimension(width, height);
	} 
 
	@Override 
	protected int getSuggestedMinimumHeight() { 
		paint.setTypeface(Typeface.DEFAULT_BOLD);
		return (int) (-paint.getFontMetrics().top + paint.getFontMetrics().bottom)
				+ getPaddingTop() + getPaddingBottom();
	} 
 
	public void onPageScrolled(final int position, final float positionOffset,
			final int positionOffsetPixels) {
		pageOffset = position + positionOffset;
		invalidate();
	} 
 
	public void onPageSelected(final int position) {
		pagePosition = position;
		invalidate();
	}