compat/src/main/java/androidx/core/widget/AutoScrollHelper.java
@Override
    public boolean onTouch(View v, MotionEvent event) {
        if (!mEnabled) {
            return false;
        }

        final int action = event.getActionMasked();
        switch (action) {
            case MotionEvent.ACTION_DOWN:
                mNeedsCancel = true;
                mAlreadyDelayed = false;
                // $FALL-THROUGH$
            case MotionEvent.ACTION_MOVE:
                final float xTargetVelocity = computeTargetVelocity(
                        HORIZONTAL, event.getX(), v.getWidth(), mTarget.getWidth());
                final float yTargetVelocity = computeTargetVelocity(
                        VERTICAL, event.getY(), v.getHeight(), mTarget.getHeight());
                mScroller.setTargetVelocity(xTargetVelocity, yTargetVelocity);

                // If the auto scroller was not previously active, but it should
                // be, then update the state and start animations.
                if (!mAnimating && shouldAnimate()) {
                    startAnimating();
                }
                break;
            case MotionEvent.ACTION_UP:
            case MotionEvent.ACTION_CANCEL:
                requestStop();
                break;
        }

        return mExclusive && mAnimating;
    }
/**
     * Handles touch events by activating automatic scrolling, adjusting scroll
     * velocity, or stopping.
     * <p>
     * If {@link #isExclusive()} is false, always returns false so that
     * the host view may handle touch events. Otherwise, returns true when
     * automatic scrolling is active and false otherwise.
     */
Handles touch events by activating automatic scrolling, adjusting scroll
velocity, or stopping.

If  #isExclusive() is false, always returns false so that
the host view may handle touch events. Otherwise, returns true when
automatic scrolling is active and false otherwise.
Handles touch events by activating automatic scrolling adjusting scroll velocity or stopping . If #isExclusive () is false always returns false so that the host view may handle touch events . Otherwise returns true when automatic scrolling is active and false otherwise .
@Override
    public boolean onTouch(View v, MotionEvent event) {
        if (!mEnabled) {
            return false;
        }
        final int action = event.getActionMasked();
        switch (action) {
            case MotionEvent.ACTION_DOWN:
                mNeedsCancel = true;
                mAlreadyDelayed = false;
            case MotionEvent.ACTION_MOVE:
                final float xTargetVelocity = computeTargetVelocity(
                        HORIZONTAL, event.getX(), v.getWidth(), mTarget.getWidth());
                final float yTargetVelocity = computeTargetVelocity(
                        VERTICAL, event.getY(), v.getHeight(), mTarget.getHeight());
                mScroller.setTargetVelocity(xTargetVelocity, yTargetVelocity);
                if (!mAnimating && shouldAnimate()) {
                    startAnimating();
                }
                break;
            case MotionEvent.ACTION_UP:
            case MotionEvent.ACTION_CANCEL:
                requestStop();
                break;
        }
        return mExclusive && mAnimating;
    }
@ Override public boolean onTouch ( View v , MotionEvent event ) { if ( ! mEnabled ) { return false ; } final int action = event . getActionMasked ( ) ; switch ( action ) { case MotionEvent . ACTION_DOWN : mNeedsCancel = true ; mAlreadyDelayed = false ; case MotionEvent . ACTION_MOVE : final float xTargetVelocity = computeTargetVelocity ( HORIZONTAL , event . getX ( ) , v . getWidth ( ) , mTarget . getWidth ( ) ) ; final float yTargetVelocity = computeTargetVelocity ( VERTICAL , event . getY ( ) , v . getHeight ( ) , mTarget . getHeight ( ) ) ; mScroller . setTargetVelocity ( xTargetVelocity , yTargetVelocity ) ; if ( ! mAnimating && shouldAnimate ( ) ) { startAnimating ( ) ; } break ; case MotionEvent . ACTION_UP : case MotionEvent . ACTION_CANCEL : requestStop ( ) ; break ; } return mExclusive && mAnimating ; }
Handles touch events by activating automatic scrolling, adjusting scroll
 velocity, or stopping.
Handles touch events by activating automatic scrolling adjusting scroll velocity or stopping .
// $FALL-THROUGH$ // If the auto scroller was not previously active, but it should // be, then update the state and start animations.