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:
Sunny Goyal
2016-06-15 15:42:29 -07:00
parent 0af8af3a60
commit bb011dad4e
13 changed files with 99 additions and 108 deletions

View File

@@ -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) {