From fa37a0ad9b062f5d2dcef60aeb749c5ebabbb456 Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Wed, 18 May 2022 10:14:01 -0700 Subject: [PATCH] Fix repeated empty workspaces after changing the grid size. There are specific scenarios when you can force an extra empty workspace after changing the grid, fortunately there is a function that removes empty workspaces. Fix:229349287 Test: Add a widget in a new empty workspace page, change the grid then remove the widget in the new grid size then return to the previous grid and it shouldn't have an empty workspace. Change-Id: I7b73ae2ca058bc84b3b361930e3dc856c045281b --- src/com/android/launcher3/Launcher.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index a6831aafa9..aeeb41282e 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -2742,6 +2742,8 @@ public class Launcher extends StatefulActivity getViewCache().setCacheSize(R.layout.folder_page, 2); TraceHelper.INSTANCE.endSection(traceToken); + + mWorkspace.removeExtraEmptyScreen(true); } private boolean canAnimatePageChange() {