diff --git a/go/res/values/dimens.xml b/go/res/values/dimens.xml new file mode 100644 index 0000000000..f1b1053160 --- /dev/null +++ b/go/res/values/dimens.xml @@ -0,0 +1,20 @@ + + + + + + 60dp + \ No newline at end of file diff --git a/go/res/xml/device_profiles.xml b/go/res/xml/device_profiles.xml index 094fc745c4..487c026d6d 100644 --- a/go/res/xml/device_profiles.xml +++ b/go/res/xml/device_profiles.xml @@ -25,7 +25,7 @@ launcher:numColumns="4" launcher:numFolderRows="4" launcher:numFolderColumns="4" - launcher:iconSize="56" + launcher:iconSize="60" launcher:iconTextSize="14.0" launcher:defaultLayoutId="@xml/default_workspace_4x4" /> diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index dec0a92a9e..69ee03e9e3 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -350,9 +350,18 @@ public class DeviceProfile { iconTextSizePx = (int) (Utilities.pxFromSp(inv.iconTextSize, dm) * scale); iconDrawablePaddingPx = (int) (iconDrawablePaddingOriginalPx * scale); - cellWidthPx = iconSizePx + iconDrawablePaddingPx; cellHeightPx = iconSizePx + iconDrawablePaddingPx + Utilities.calculateTextHeight(iconTextSizePx); + int cellYPadding = (getCellSize().y - cellHeightPx) / 2; + if (iconDrawablePaddingPx > cellYPadding && !isVerticalBarLayout() + && !inMultiWindowMode()) { + // Ensures that the label is closer to its corresponding icon. This is not an issue + // with vertical bar layout or multi-window mode since the issue is handled separately + // with their calls to {@link #adjustToHideWorkspaceLabels}. + cellHeightPx -= (iconDrawablePaddingPx - cellYPadding); + iconDrawablePaddingPx = cellYPadding; + } + cellWidthPx = iconSizePx + iconDrawablePaddingPx; // All apps allAppsIconTextSizePx = iconTextSizePx; @@ -755,11 +764,14 @@ public class DeviceProfile { return new int[] { padding.left - mInsets.left, padding.right + mInsets.left}; } + public boolean inMultiWindowMode() { + return this != inv.landscapeProfile && this != inv.portraitProfile; + } + public boolean shouldIgnoreLongPressToOverview(float touchX) { - boolean inMultiWindowMode = this != inv.landscapeProfile && this != inv.portraitProfile; boolean touchedLhsEdge = mInsets.left == 0 && touchX < edgeMarginPx; boolean touchedRhsEdge = mInsets.right == 0 && touchX > (widthPx - edgeMarginPx); - return !inMultiWindowMode && (touchedLhsEdge || touchedRhsEdge); + return !inMultiWindowMode() && (touchedLhsEdge || touchedRhsEdge); } private static Context getContext(Context c, int orientation) {