Merge "Make large task tile snap to position after scrolling" into main

This commit is contained in:
Treehugger Robot
2024-10-01 23:01:37 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 2 deletions
@@ -1706,10 +1706,11 @@ public abstract class RecentsView<
return;
}
TaskView taskView = getTaskViewAt(mNextPage);
// Snap to fully visible focused task and clear all button.
boolean shouldSnapToLargeTask = taskView != null && taskView.isLargeTile()
&& isTaskViewFullyVisible(taskView);
&& !mUtils.isAnySmallTaskFullyVisible(getTaskViews(),
this::isTaskViewFullyVisible);
boolean shouldSnapToClearAll = mNextPage == indexOfChild(mClearAllButton);
// Snap to large tile when grid tasks aren't fully visible or the clear all button.
if (!shouldSnapToLargeTask && !shouldSnapToClearAll) {
return;
}