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

Commit 34f354cf authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

Make sure overscroll isn't applied in views it shouldn't be

These checks should've been there in the first place. If overscroll
can't be applied, touchMode can never be OVERSCROLL nor OVERFLING.

Change-Id: I7f60ee456c0109f792883fcfdfdecce8339830c0
parent 04d8fc70
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -1967,7 +1967,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
        // Check if we have moved far enough that it looks more like a
        // scroll than a tap
        final int distance = Math.abs(deltaY);
        final boolean overscroll = mScrollY != 0;
        final boolean overscroll = mScrollY != 0 && (getOverscrollMode() != OVERSCROLL_NEVER);
        if (overscroll || distance > mTouchSlop) {
            createScrollingCache();
            mTouchMode = overscroll ? TOUCH_MODE_OVERSCROLL : TOUCH_MODE_SCROLL;
@@ -2147,6 +2147,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
                        int motionPosition = findMotionRow(y);
                        if (motionPosition >= 0) {
                            final View motionView = getChildAt(motionPosition - mFirstPosition);
                            if (getOverscrollMode() != OVERSCROLL_NEVER) {
                                // Apply overscroll
                                final int motionViewRealTop = motionView.getTop();

@@ -2156,6 +2157,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
                                        0, getOverscrollMax(), true);
                                mTouchMode = TOUCH_MODE_OVERSCROLL;
                                invalidate();
                            }
                            mMotionViewOriginalTop = motionView.getTop();
                        }
                        mMotionY = y;