Code example for VelocityTracker

Methods: clear

0
                final int newPointerIndex = pointerIndex == 0 ? 1 : 0;
                lastMotionX = ev.getX(newPointerIndex);
                lastMotionY = ev.getY(newPointerIndex);
                mActivePointerId = ev.getPointerId(newPointerIndex);
                if (mVelocityTracker != null) {
                    mVelocityTracker.clear();
                } 
            } 
        } 
 
        /** 
         * Track the touch event 
         */ 
        @Override 
        public boolean onTouchEvent(MotionEvent ev) {
    //      Log.d("workspace","caught a touch event"); 
            if (locked) {
                return true; 
            } 
            if (mVelocityTracker == null) {
Experience pair programming with AI  Get Codota for Java