summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/InvariantDeviceProfile.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/InvariantDeviceProfile.java')
-rw-r--r--src/com/android/launcher3/InvariantDeviceProfile.java17
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) {