From dddf56f5b19cfa11d3b4810740f6b6a73f4c050e Mon Sep 17 00:00:00 2001 From: Kevin Lim Date: Tue, 20 May 2025 16:31:11 -0700 Subject: [PATCH] [Multiline] If a multiline searchbox can scroll up, don't scroll all apps container Bug: b/390540638 Flag: EXEMPT bug fix Test: Before: http://recall/clips/2c3e5774-c0ba-4a2d-b878-db3a6efec247 Test: After: http://recall/clips/3c98c52b-7f94-4dd4-a6f6-560403d4a426 Change-Id: I9dad962740ec31edad6213c41e2dec04deeedf0b --- .../allapps/ActivityAllAppsContainerView.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java index 00054591dd..75445fa8fe 100644 --- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java @@ -435,10 +435,21 @@ public class ActivityAllAppsContainerView public boolean shouldContainerScroll(MotionEvent ev) { BaseDragLayer dragLayer = mActivityContext.getDragLayer(); - // 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)) { + // 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)) { + // If the touch was on the edit text, container should move down ONLY when edit text is + // already at the top. + View editText = mSearchUiManager.getEditText(); + if (editText != null && dragLayer.isEventOverView(editText, ev)) { + boolean canScrollUp = editText.canScrollVertically(-1); + return !canScrollUp; + } + return true; + } + // If the MotionEvent is inside the handle area, and the container keeps on receiving touch + // input, container should move down. + if (dragLayer.isEventOverView(mBottomSheetHandleArea, ev)) { return true; } AllAppsRecyclerView rv = getActiveRecyclerView();