diff options
author | Jon Miranda <jonmiranda@google.com> | 2017-09-19 11:31:42 -0700 |
---|---|---|
committer | Jon Miranda <jonmiranda@google.com> | 2017-09-19 11:31:42 -0700 |
commit | 0cd04571d26f133900e7f42428d180371f23edce (patch) | |
tree | 3f76d7128314948278519295fe2a864ac588f210 /src/com/android/launcher3/DeviceProfile.java | |
parent | 2dd64c0710843b7caed646ccf5b3440f35c24cf0 (diff) | |
download | android_packages_apps_Trebuchet-0cd04571d26f133900e7f42428d180371f23edce.tar.gz android_packages_apps_Trebuchet-0cd04571d26f133900e7f42428d180371f23edce.tar.bz2 android_packages_apps_Trebuchet-0cd04571d26f133900e7f42428d180371f23edce.zip |
Change rule so that multi-window labels are shown if there is space.
ie. Taimen has enough room to show the labels in mw mode.
Bug: 65778773
Change-Id: If585f3f975b44d17ea6e07f23c50758998bbb564
Diffstat (limited to 'src/com/android/launcher3/DeviceProfile.java')
-rw-r--r-- | src/com/android/launcher3/DeviceProfile.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index dec0a92a9..824a554e2 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -277,8 +277,12 @@ public class DeviceProfile { DeviceProfile profile = new DeviceProfile(context, inv, mwSize, mwSize, mwSize.x, mwSize.y, isLandscape); - // Hide labels on the workspace. - profile.adjustToHideWorkspaceLabels(); + // If there isn't enough vertical cell padding with the labels displayed, hide the labels. + float workspaceCellPaddingY = profile.getCellSize().y - profile.iconSizePx + - iconDrawablePaddingPx - profile.iconTextSizePx; + if (workspaceCellPaddingY < profile.iconDrawablePaddingPx * 2) { + profile.adjustToHideWorkspaceLabels(); + } // We use these scales to measure and layout the widgets using their full invariant profile // sizes and then draw them scaled and centered to fit in their multi-window mode cellspans. |