summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/AutoInstallsLayout.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-06-15 15:42:29 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-06-17 08:17:22 -0700
commitbb011dad4e69bec027be1e00d573a3095b318b43 (patch)
tree71c459e2f2c45584075087ce843cdbf692dadaf5 /src/com/android/launcher3/AutoInstallsLayout.java
parent0af8af3a6090bc0309cb126a1ccfb2a66e058783 (diff)
downloadandroid_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/AutoInstallsLayout.java')
-rw-r--r--src/com/android/launcher3/AutoInstallsLayout.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/com/android/launcher3/AutoInstallsLayout.java b/src/com/android/launcher3/AutoInstallsLayout.java
index f3a2bdc98..0d5043bb2 100644
--- a/src/com/android/launcher3/AutoInstallsLayout.java
+++ b/src/com/android/launcher3/AutoInstallsLayout.java
@@ -37,6 +37,7 @@ import android.util.Patterns;
import com.android.launcher3.LauncherProvider.SqlArguments;
import com.android.launcher3.LauncherSettings.Favorites;
+import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.util.Thunk;
import org.xmlpull.v1.XmlPullParser;
@@ -157,7 +158,7 @@ public class AutoInstallsLayout {
protected final Resources mSourceRes;
protected final int mLayoutId;
- private final int mHotseatAllAppsRank;
+ private final InvariantDeviceProfile mIdp;
private final int mRowCount;
private final int mColumnCount;
@@ -181,10 +182,9 @@ public class AutoInstallsLayout {
mSourceRes = res;
mLayoutId = layoutId;
- InvariantDeviceProfile idp = LauncherAppState.getInstance().getInvariantDeviceProfile();
- mHotseatAllAppsRank = idp.hotseatAllAppsRank;
- mRowCount = idp.numRows;
- mColumnCount = idp.numColumns;
+ mIdp = LauncherAppState.getInstance().getInvariantDeviceProfile();
+ mRowCount = mIdp.numRows;
+ mColumnCount = mIdp.numColumns;
}
/**
@@ -231,7 +231,8 @@ public class AutoInstallsLayout {
out[0] = Favorites.CONTAINER_HOTSEAT;
// Hack: hotseat items are stored using screen ids
long rank = Long.parseLong(getAttributeValue(parser, ATTR_RANK));
- out[1] = (rank < mHotseatAllAppsRank) ? rank : (rank + 1);
+ out[1] = (FeatureFlags.NO_ALL_APPS_ICON || rank < mIdp.getAllAppsButtonRank())
+ ? rank : (rank + 1);
} else {
out[0] = Favorites.CONTAINER_DESKTOP;
out[1] = Long.parseLong(getAttributeValue(parser, ATTR_SCREEN));