Make large task tile snap to position after scrolling

- There's an edge case when there are only 2 grid tasks, mNextPage will still be on the grid tasks when they're not fully visible, so the new isAnySmallTaskFullyVisible check can't kick in. This only happens when grid tasks are barely out of screen.

Fix: 370733696
Test: Scroll betwene large tiles, it should always snap after scrolling
Test: Scroll from focus task to grid task, it should only snap if grid tasks aren't fully visible
Flag: com.android.launcher3.enable_large_desktop_windowing_tile
Change-Id: I3b0a80ceffb1caae57aa53b1c949c5e51336231a
This commit is contained in:
Alex Chau
2024-09-27 12:04:17 +01:00
parent 98f792331a
commit ded6500848
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;
}