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();