Code example for ScaleGestureDetector

Methods: getScaleFactor

0
 
	private class ScaleListener extends 
			ScaleGestureDetector.SimpleOnScaleGestureListener {
		@Override 
		public boolean onScale(ScaleGestureDetector detector) {
			scaleFactor *= detector.getScaleFactor();
 
			// Don't let the object get too small or too large. 
			scaleFactor = Math.max(0.1f, Math.min(scaleFactor, 5.0f));
 
			invalidate();
			return true; 
		} 
	} 
}