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

Commit 82ab3fb3 authored by Andy Wickham's avatar Andy Wickham
Browse files

Reset fast scroller when All Apps resets.

This ensures the scrollbar is not left in a bad state, in
particular if you close All Apps while still scrolling (e.g.
pressing the Home button while holding the scroll bar).

Fix: 267583704
Test: Manual
Change-Id: I0e159f8e5ed289bf1628f77eab1879743b5aea00
parent fcb6a5fc
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -360,6 +360,9 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
                mAH.get(i).mRecyclerView.scrollToTop();
            }
        }
        if (mTouchHandler != null) {
            mTouchHandler.endFastScrolling();
        }
        if (mHeader != null && mHeader.getVisibility() == VISIBLE) {
            mHeader.reset(animate);
        }
+14 −9
Original line number Diff line number Diff line
@@ -283,15 +283,7 @@ public class RecyclerViewFastScroller extends View {
                break;
            case MotionEvent.ACTION_UP:
            case MotionEvent.ACTION_CANCEL:
                mRv.onFastScrollCompleted();
                mTouchOffsetY = 0;
                mLastTouchY = 0;
                mIgnoreDragGesture = false;
                if (mIsDragging) {
                    mIsDragging = false;
                    animatePopupVisibility(false);
                    showActiveScrollbar(false);
                }
                endFastScrolling();
                break;
        }
        if (DEBUG) {
@@ -330,6 +322,19 @@ public class RecyclerViewFastScroller extends View {
        setThumbOffsetY((int) mLastTouchY);
    }

    /** End any active fast scrolling touch handling, if applicable. */
    public void endFastScrolling() {
        mRv.onFastScrollCompleted();
        mTouchOffsetY = 0;
        mLastTouchY = 0;
        mIgnoreDragGesture = false;
        if (mIsDragging) {
            mIsDragging = false;
            animatePopupVisibility(false);
            showActiveScrollbar(false);
        }
    }

    public void onDraw(Canvas canvas) {
        if (mThumbOffsetY < 0) {
            return;