Set next page immediately on subsequent arrow/tab presses when navigating overivew.

This allows the user to scroll as quickly as they want.

Fix: 328749622
Test: manual
Flag: NONE
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a9a11b47c3bff4d3ec4a4f300e12895d3235fe95)
Merged-In: I493841f11407e6fb9f15fd90b5a5e55fa4ed3ad3
Change-Id: I493841f11407e6fb9f15fd90b5a5e55fa4ed3ad3
This commit is contained in:
Pat Manning
2024-03-13 11:59:19 +00:00
committed by Android Build Coastguard Worker
parent 2e64c71a2d
commit 1e6bf12fdb
@@ -4136,10 +4136,10 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
private boolean snapToPageRelative(int delta, boolean cycle,
@TaskGridNavHelper.TASK_NAV_DIRECTION int direction) {
// Ignore grid page snap events while scroll animations are running, otherwise the next
// page gets set before the animation finishes and can cause jumps.
// Set next page if scroll animation is still running, otherwise cannot snap to the
// next page on successive key presses. Setting the current page aborts the scroll.
if (!mScroller.isFinished()) {
return true;
setCurrentPage(getNextPage());
}
int pageCount = getPageCount();
if (pageCount == 0) {