Code example for OverScroller

Methods: abortAnimationisFinished

0
    @Override 
    public boolean onInterceptTouchEvent(MotionEvent event) {
        switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN:
                //Stop any flinging in progress 
                if (!mScroller.isFinished()) {
                    mScroller.abortAnimation();
                } 
                //Reset the velocity tracker 
                mVelocityTracker.clear();
                mVelocityTracker.addMovement(event);
                //Save the initial touch point 
                mLastTouchX = event.getX();
                mLastTouchY = event.getY();
                break; 
            case MotionEvent.ACTION_MOVE:
                final float x = event.getX();
                final float y = event.getY();
                final int yDiff = (int) Math.abs(y - mLastTouchY);
                final int xDiff = (int) Math.abs(x - mLastTouchX);