Code example for ScaleGestureDetector

Methods: getCurrentSpan

0
                mTextPaint);
    } 
 
    @Override 
    public boolean onScale(ScaleGestureDetector detector) {
        float span = (detector.getCurrentSpan() - mBeginSpan) / 2.5f;
        float circle = (int) (mBeginCircle + span);
        circle = Math.max(mMinCircle, circle);
        circle = Math.min(mMaxCircle, circle);
        if (mListener != null && (int) circle != mCircleSize) {
            mCircleSize = (int) circle;
            int zoom = mMinZoom + (int) ((mCircleSize - mMinCircle) * (mMaxZoom - mMinZoom) / (mMaxCircle - mMinCircle));
            mListener.onZoomValueChanged(zoom);
        } 
        return true; 
    } 
 
    @Override 
    public boolean onScaleBegin(ScaleGestureDetector detector) {
        setVisible(true); 
        mBeginSpan = detector.getCurrentSpan();