Merge "Snap to Large tile or first grid task when they are the next page." into main

This commit is contained in:
Treehugger Robot
2025-03-26 05:07:40 -07:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 29 deletions
@@ -1825,11 +1825,13 @@ public abstract class RecentsView<
return;
}
TaskView taskView = getTaskViewAt(mNextPage);
boolean shouldSnapToLargeTask = taskView != null && taskView.isLargeTile()
&& !mUtils.isAnySmallTaskFullyVisible();
boolean shouldSnapToLargeTask = taskView != null && taskView.isLargeTile();
boolean shouldSnapToSmallTask = enableGridOnlyOverview() && taskView != null
&& taskView == mUtils.getFirstSmallTaskView();
boolean shouldSnapToClearAll = mNextPage == indexOfChild(mClearAllButton);
// Snap to large tile when grid tasks aren't fully visible or the clear all button.
if (!shouldSnapToLargeTask && !shouldSnapToClearAll) {
boolean shouldSnap =
shouldSnapToLargeTask || shouldSnapToClearAll || shouldSnapToSmallTask;
if (!shouldSnap) {
return;
}
}