From 646f804627625bfccb817bae720ae1336b39dc46 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Mon, 26 Jul 2021 11:56:22 +0100 Subject: [PATCH] Add overviewShowAsGrid to DeviceProfile - Simplified a lot of dp.isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get() usage Bug: 194194694 Test: manual Change-Id: Idfb0ad192048106bbe6f8e2a28fa5613b86e5208 --- .../launcher3/uioverrides/states/OverviewState.java | 3 +-- .../com/android/quickstep/BaseActivityInterface.java | 3 +-- .../src/com/android/quickstep/TaskViewUtils.java | 5 ++--- .../com/android/quickstep/fallback/RecentsState.java | 7 +------ .../src/com/android/quickstep/views/RecentsView.java | 6 +++--- .../com/android/quickstep/views/TaskMenuView.java | 3 +-- .../android/quickstep/views/TaskThumbnailView.java | 3 +-- .../src/com/android/quickstep/views/TaskView.java | 12 ++++-------- src/com/android/launcher3/DeviceProfile.java | 9 +++++---- 9 files changed, 19 insertions(+), 32 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java index 90e17c0276..1302ac00af 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java @@ -28,7 +28,6 @@ import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.R; import com.android.launcher3.Workspace; -import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.util.Themes; import com.android.quickstep.SysUINavigationMode; import com.android.quickstep.util.LayoutUtils; @@ -104,7 +103,7 @@ public class OverviewState extends LauncherState { @Override public boolean displayOverviewTasksAsGrid(DeviceProfile deviceProfile) { - return deviceProfile.isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get(); + return deviceProfile.overviewShowAsGrid; } @Override diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index 11fb1d0beb..db56231be9 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -48,7 +48,6 @@ import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.anim.PendingAnimation; -import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.statehandlers.DepthController; import com.android.launcher3.statemanager.BaseState; import com.android.launcher3.statemanager.StatefulActivity; @@ -207,7 +206,7 @@ public abstract class BaseActivityInterface { * For this state, whether tasks should layout as a grid rather than a list. */ public boolean displayOverviewTasksAsGrid(DeviceProfile deviceProfile) { - return hasFlag(FLAG_SHOW_AS_GRID) && showAsGrid(deviceProfile); - } - - private boolean showAsGrid(DeviceProfile deviceProfile) { - return deviceProfile.isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get(); + return hasFlag(FLAG_SHOW_AS_GRID) && deviceProfile.overviewShowAsGrid; } /** diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 6ea4a0d09c..ef305acbf7 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -1139,7 +1139,7 @@ public abstract class RecentsView