Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 070d6677 authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Fix consistency in nested pre-scroll with ScrollView for AbsListView"

parents fa25d3e9 aab726c5
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -3326,8 +3326,8 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
        if (mLastY == Integer.MIN_VALUE) {
            rawDeltaY -= mMotionCorrection;
        }
        if (dispatchNestedPreScroll(0, rawDeltaY, mScrollConsumed, mScrollOffset)) {
            rawDeltaY -= mScrollConsumed[1];
        if (dispatchNestedPreScroll(0, -rawDeltaY, mScrollConsumed, mScrollOffset)) {
            rawDeltaY += mScrollConsumed[1];
            scrollOffsetCorrection -= mScrollOffset[1];
            scrollConsumedCorrection -= mScrollConsumed[1];
            if (vtev != null) {
@@ -3853,7 +3853,8 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
                    // Since we can potentially overfling more than we can overscroll, don't
                    // allow the weird behavior where you can scroll to a boundary then
                    // fling further.
                    if (Math.abs(initialVelocity) > mMinimumVelocity &&
                    boolean flingVelocity = Math.abs(initialVelocity) > mMinimumVelocity;
                    if (flingVelocity &&
                            !((mFirstPosition == 0 &&
                                    firstChildTop == contentTop - mOverscrollDistance) ||
                              (mFirstPosition + childCount == mItemCount &&
@@ -3864,6 +3865,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
                        reportScrollStateChange(OnScrollListener.SCROLL_STATE_FLING);

                        mFlingRunnable.start(-initialVelocity);
                        dispatchNestedFling(0, -initialVelocity, true);
                    } else {
                        mTouchMode = TOUCH_MODE_REST;
                        reportScrollStateChange(OnScrollListener.SCROLL_STATE_IDLE);
@@ -3873,6 +3875,9 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
                        if (mPositionScroller != null) {
                            mPositionScroller.stop();
                        }
                        if (flingVelocity) {
                            dispatchNestedFling(0, -initialVelocity, false);
                        }
                    }
                }
            } else {