Merge "[Multiline] If a multiline searchbox can scroll up, don't scroll all apps container" into main

This commit is contained in:
Kevin Lim authored and Android (Google) Code Review committed 2025-05-21 19:18:53 -07:00
commit a735b96a40
1 file changed
+15 -4
@@ -435,10 +435,21 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
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();