From 23f7d82831d95712c2eda17a8a06e2eb3190f037 Mon Sep 17 00:00:00 2001 From: Andy Wickham Date: Wed, 29 Mar 2023 15:00:17 -0700 Subject: [PATCH] Don't move down all apps container when touching near scroll bar. Previously we were using any touch outside of the panel to move the container, but we want to check this last, after checking if the touch is near the scrollbar (in which case it should intercept instead). Test: Manual Flag: N/A Fix: 236661990 Change-Id: I518c546356d1f6c6cedf4b31fa621295dd090175 --- .../allapps/ActivityAllAppsContainerView.java | 18 ++++++++---------- .../views/RecyclerViewFastScroller.java | 1 + 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java index 895020301a..4e1c282688 100644 --- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java @@ -342,16 +342,10 @@ public class ActivityAllAppsContainerView public boolean shouldContainerScroll(MotionEvent ev) { BaseDragLayer dragLayer = mActivityContext.getDragLayer(); - // IF the MotionEvent is inside the search box, and the container keeps on receiving - // touch input, container should move down. - if (dragLayer.isEventOverView(mSearchContainer, ev)) { - return true; - } - // Scroll if not within the container view (e.g. over large-screen scrim). - if (!dragLayer.isEventOverView(getVisibleContainerView(), ev)) { - return true; - } - if (dragLayer.isEventOverView(mBottomSheetHandleArea, ev)) { + // IF the MotionEvent is inside the search box or handle area, and the container keeps on + // receiving touch input, container should move down. + if (dragLayer.isEventOverView(mSearchContainer, ev) + || dragLayer.isEventOverView(mBottomSheetHandleArea, ev)) { return true; } AllAppsRecyclerView rv = getActiveRecyclerView(); @@ -363,6 +357,10 @@ public class ActivityAllAppsContainerView && dragLayer.isEventOverView(rv.getScrollbar(), ev)) { return false; } + // Scroll if not within the container view (e.g. over large-screen scrim). + if (!dragLayer.isEventOverView(getVisibleContainerView(), ev)) { + return true; + } return rv.shouldContainerScroll(ev, dragLayer); } diff --git a/src/com/android/launcher3/views/RecyclerViewFastScroller.java b/src/com/android/launcher3/views/RecyclerViewFastScroller.java index a941833064..c0b24fa9f4 100644 --- a/src/com/android/launcher3/views/RecyclerViewFastScroller.java +++ b/src/com/android/launcher3/views/RecyclerViewFastScroller.java @@ -333,6 +333,7 @@ public class RecyclerViewFastScroller extends View { } } + @Override public void onDraw(Canvas canvas) { if (mThumbOffsetY < 0 || mRv == null) { return;