diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-06-15 15:42:29 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-06-17 08:17:22 -0700 |
commit | bb011dad4e69bec027be1e00d573a3095b318b43 (patch) | |
tree | 71c459e2f2c45584075087ce843cdbf692dadaf5 /src/com/android/launcher3/InvariantDeviceProfile.java | |
parent | 0af8af3a6090bc0309cb126a1ccfb2a66e058783 (diff) | |
download | android_packages_apps_Trebuchet-bb011dad4e69bec027be1e00d573a3095b318b43.tar.gz android_packages_apps_Trebuchet-bb011dad4e69bec027be1e00d573a3095b318b43.tar.bz2 android_packages_apps_Trebuchet-bb011dad4e69bec027be1e00d573a3095b318b43.zip |
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
Diffstat (limited to 'src/com/android/launcher3/InvariantDeviceProfile.java')
-rw-r--r-- | src/com/android/launcher3/InvariantDeviceProfile.java | 17 |
1 files changed, 13 insertions, 4 deletions
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) { |