summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/DeviceProfile.java
diff options
context:
space:
mode:
authorAndroid Build Merger (Role) <android-build-merger@google.com>2017-10-03 18:27:55 +0000
committerAndroid Build Merger (Role) <android-build-merger@google.com>2017-10-03 18:27:55 +0000
commit8c23068b7c31acccde214ac15c9e282e59aabd8e (patch)
tree41bb322626dc827f1414a55a9d4adb9f1b55ee04 /src/com/android/launcher3/DeviceProfile.java
parent37920966888587900885c88a63785cb16567684c (diff)
parent846455e1ffdca9bac72b96ba61d2e42cd45cf4ce (diff)
downloadandroid_packages_apps_Trebuchet-8c23068b7c31acccde214ac15c9e282e59aabd8e.tar.gz
android_packages_apps_Trebuchet-8c23068b7c31acccde214ac15c9e282e59aabd8e.tar.bz2
android_packages_apps_Trebuchet-8c23068b7c31acccde214ac15c9e282e59aabd8e.zip
[automerger] Larger icons for L3Go and spacing changes. am: 846455e1ff
Change-Id: Iec2b04651788abaa3abb8a1b295a7f5eb1f92355
Diffstat (limited to 'src/com/android/launcher3/DeviceProfile.java')
-rw-r--r--src/com/android/launcher3/DeviceProfile.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 824a554e2..8f7e8822b 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -354,9 +354,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;
@@ -759,11 +768,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) {