Code example for VelocityTracker

Methods: addMovement, computeCurrentVelocity

0
                    listener.onTouchZoomMove(x, y, AndroidUtils2.getXFromMotionEvent(event, 1), AndroidUtils2.getYFromMotionEvent(event, 1));
                } 
                break; 
 
            case MotionEvent.ACTION_UP:
                velocityTracker.addMovement(event);
                velocityTracker.computeCurrentVelocity(1000);
                listener.onTouchUp(x, y);
                break; 
 
            case MotionEvent.ACTION_POINTER_DOWN:
                if (pointerCount == 2) {
                    listener.onTouchZoomDown(x, y, AndroidUtils2.getXFromMotionEvent(event, 1), AndroidUtils2.getYFromMotionEvent(event, 1));
                } 
                break; 
 
            case MotionEvent.ACTION_POINTER_UP:
                if (pointerCount == 2) {
                    afterZoom = true;
                } 
                break;