mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
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
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user