Correct the page scrolls of the AddDesktopButton

Do not apply the button's grid translation to its page scrolls if
it is not showing as a grid,otherwise the `mCurrentPage` may not be
set correctly while checking `ensureWithinScrollBounds`.

Bug: 396146789
Flag: com.android.window.flags.enable_multiple_desktops_frontend
Flag: com.android.window.flags.enable_multiple_desktops_backend
Test: m
Change-Id: Ia1378a997e681abda60fa1cb3c125660916df4c5
This commit is contained in:
minch
2025-02-21 16:51:43 +00:00
committed by Min Chen
parent ca88e0cc04
commit 1c028b7ccb
2 changed files with 5 additions and 2 deletions
@@ -6243,8 +6243,8 @@ public abstract class RecentsView<
int addDesktopButtonIndex = indexOfChild(mAddDesktopButton);
if (addDesktopButtonIndex != -1 && addDesktopButtonIndex < outPageScrolls.length) {
outPageScrolls[addDesktopButtonIndex] =
newPageScrolls[addDesktopButtonIndex] + Math.round(
mAddDesktopButton.getGridTranslationX());
newPageScrolls[addDesktopButtonIndex] + mAddDesktopButton.getScrollAdjustment(
showAsGrid);
}
int lastTaskScroll = getLastTaskScroll(clearAllScroll, clearAllWidth);