From bb011dad4e69bec027be1e00d573a3095b318b43 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Wed, 15 Jun 2016 15:42:29 -0700 Subject: Adding a flag (enabled by default) to remove the all-apps button. All apps can still be opened by clicking the caret. Bug: 29398447 Change-Id: I61f1b05cea83a0a49d7cc16c518c5419618ba779 --- src/com/android/launcher3/InvariantDeviceProfile.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/com/android/launcher3/InvariantDeviceProfile.java') diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java index 0742df9b4..da95d66f9 100644 --- a/src/com/android/launcher3/InvariantDeviceProfile.java +++ b/src/com/android/launcher3/InvariantDeviceProfile.java @@ -23,6 +23,8 @@ import android.util.DisplayMetrics; import android.view.Display; import android.view.WindowManager; +import com.android.launcher3.config.FeatureFlags; +import com.android.launcher3.config.ProviderConfig; import com.android.launcher3.util.Thunk; import java.util.ArrayList; @@ -77,9 +79,6 @@ public class InvariantDeviceProfile { float hotseatIconSize; int defaultLayoutId; - // Derived invariant properties - public int hotseatAllAppsRank; - DeviceProfile landscapeProfile; DeviceProfile portraitProfile; @@ -141,7 +140,6 @@ public class InvariantDeviceProfile { numRows = closestProfile.numRows; numColumns = closestProfile.numColumns; numHotseatIcons = closestProfile.numHotseatIcons; - hotseatAllAppsRank = (int) (numHotseatIcons / 2); defaultLayoutId = closestProfile.defaultLayoutId; numFolderRows = closestProfile.numFolderRows; numFolderColumns = closestProfile.numFolderColumns; @@ -304,6 +302,17 @@ public class InvariantDeviceProfile { return this; } + public int getAllAppsButtonRank() { + if (ProviderConfig.IS_DOGFOOD_BUILD && FeatureFlags.NO_ALL_APPS_ICON) { + throw new IllegalAccessError("Accessing all apps rank when all-apps is disabled"); + } + return numHotseatIcons / 2; + } + + public boolean isAllAppsButtonRank(int rank) { + return rank == getAllAppsButtonRank(); + } + private float weight(float x0, float y0, float x1, float y1, float pow) { float d = dist(x0, y0, x1, y1); if (Float.compare(d, 0f) == 0) { -- cgit v1.2.3