Code example for ScaleGestureDetector

Methods: getCurrentSpanX, getCurrentSpanY, getFocusX, getFocusY, getScaleFactor

0
                    return true; 
                } 
 
                @Override 
                public boolean onScale(ScaleGestureDetector detector) { 
                    final float x = detector.getFocusX() - detector.getCurrentSpanX() / 2.0f; 
                    final float y = detector.getFocusY() - detector.getCurrentSpanY() / 2.0f; 
                    final float scaleFactor = detector.getScaleFactor(); 
                    final float smoothed = (scaleFactor * 0.9f) + (mPreviousScaleFactor * 0.1f); 
 
                    mPreviousScaleFactor = scaleFactor; 
 
                    setScaleFactor(mPointerX, mPointerY, scaleFactor); 
 
                    return true; 
                } 
 
                @Override 
                public void onScaleEnd(ScaleGestureDetector detector) { 
                    // Do nothing. 
                }