OSDN Git Service

Limit AllApps insets to certain device configurations. (Bug 11451335)
authorWinson Chung <winsonc@google.com>
Wed, 4 Dec 2013 20:51:53 +0000 (12:51 -0800)
committerWinson Chung <winsonc@google.com>
Wed, 4 Dec 2013 20:52:39 +0000 (20:52 +0000)
Change-Id: I0b7172bb8c2e8cfb06ef4ff097bdc632d6be0548

src/com/android/launcher3/DeviceProfile.java

index 9e1f1a7..ec5e81f 100644 (file)
@@ -703,7 +703,8 @@ public class DeviceProfile {
                 paddingTB = Math.min(paddingTB, (int)((paddingLR + paddingTB) * 0.75f));
                 int maxAllAppsWidth = (allAppsNumCols * (allAppsCellWidthPx + 2 * paddingLR));
                 int gridPaddingLR = (availableWidthPx - maxAllAppsWidth) / 2;
-                if (gridPaddingLR > (allAppsCellWidthPx / 4)) {
+                // Only adjust the side paddings on landscape phones, or tablets
+                if ((isTablet() || isLandscape) && gridPaddingLR > (allAppsCellWidthPx / 4)) {
                     padding.left = padding.right = gridPaddingLR;
                 }
                 // The icons are centered, so we can't just offset by the page indicator height