From 1c017d5d58287498c300eeb47b147ca43c581875 Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Tue, 7 Feb 2023 17:44:25 -0800 Subject: [PATCH] Fix foldable single page bug I did a last minute change and uploaded the wrong branch. Bug: 268356439 Change-Id: Ia11ce681d57b7a637c01b2155b16486cf5fd648f --- src/com/android/launcher3/Workspace.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index fa54dcfc59..cfb8ca4df5 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -501,7 +501,7 @@ public class Workspace extends PagedView } private boolean isTwoPanelEnabled() { - return mLauncher.mDeviceProfile.isTwoPanels; + return !FOLDABLE_SINGLE_PAGE.get() && mLauncher.mDeviceProfile.isTwoPanels; } @Override @@ -663,8 +663,9 @@ public class Workspace extends PagedView // Inflate the cell layout, but do not add it automatically so that we can get the newly // created CellLayout. + DeviceProfile dp = mLauncher.getDeviceProfile(); CellLayout newScreen; - if (FOLDABLE_SINGLE_PAGE.get() && isTwoPanelEnabled()) { + if (FOLDABLE_SINGLE_PAGE.get() && dp.isTwoPanels) { newScreen = (CellLayout) LayoutInflater.from(getContext()).inflate( R.layout.workspace_screen_foldable, this, false /* attachToRoot */); } else {