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
This commit is contained in:
Andy Wickham
2023-03-29 15:00:17 -07:00
parent 6cb7469564
commit 23f7d82831
2 changed files with 9 additions and 10 deletions

View File

@@ -342,16 +342,10 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
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<T extends Context & ActivityContext>
&& 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);
}