From 02e5d63fc7535c6d254676bbbcfa804a06476d21 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Mon, 19 Jul 2021 23:44:14 -0700 Subject: [PATCH] Fix fast scroller issues / remove fast thumb access / fix wrong popup location (1) Remove jumping to arbitrary fast scroller position because back gesture can trigger arbitrary fast scrolling (2) Pop up would show up in random location when user combines touching the track and scrolling. This was because thumb location was not updating when user was scrolling on the main container. Bug: 193177670 Bug: 191562400 Test: manual Change-Id: I129aaa37ca911666453a8c98e24eaac33827238f --- .../launcher3/views/RecyclerViewFastScroller.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/com/android/launcher3/views/RecyclerViewFastScroller.java b/src/com/android/launcher3/views/RecyclerViewFastScroller.java index a88b8b7776..1c2534d9fd 100644 --- a/src/com/android/launcher3/views/RecyclerViewFastScroller.java +++ b/src/com/android/launcher3/views/RecyclerViewFastScroller.java @@ -278,12 +278,7 @@ public class RecyclerViewFastScroller extends View { mIgnoreDragGesture |= absDeltaY > mConfig.getScaledPagingTouchSlop(); if (!mIsDragging && !mIgnoreDragGesture && mRv.supportsFastScrolling()) { - // condition #1: triggering thumb is distance, angle based - if ((isNearThumb(mDownX, mLastY) - && absDeltaY > mConfig.getScaledPagingTouchSlop() - && absDeltaY > absDeltaX) - // condition#2: Fastscroll function is now time based - || (isNearScrollBar(mDownX) && ev.getEventTime() - mDownTimeStampMillis + if ((isNearThumb(mDownX, mLastY) && ev.getEventTime() - mDownTimeStampMillis > FASTSCROLL_THRESHOLD_MILLIS)) { calcTouchOffsetAndPrepToFastScroll(mDownY, mLastY); } @@ -433,9 +428,6 @@ public class RecyclerViewFastScroller extends View { } private void updatePopupY(int lastTouchY) { - if (!mPopupVisible) { - return; - } int height = mPopupView.getHeight(); // Aligns the rounded corner of the pop up with the top of the thumb. float top = mRv.getScrollBarTop() + lastTouchY + (getScrollThumbRadius() / 2f)