diff options
author | cretin45 <cretin45@gmail.com> | 2016-02-29 11:23:05 -0800 |
---|---|---|
committer | Ed Carrigan <cretin45@gmail.com> | 2016-02-29 12:02:05 -0800 |
commit | 1e085760ee52ab91d2ae34b32583c0507c818747 (patch) | |
tree | b8ba3969a91510b02381cac7daa166b6c023bad6 | |
parent | e0a796cd23f21b407041fb97154fcee8b31f7088 (diff) | |
download | android_packages_apps_Trebuchet-1e085760ee52ab91d2ae34b32583c0507c818747.tar.gz android_packages_apps_Trebuchet-1e085760ee52ab91d2ae34b32583c0507c818747.tar.bz2 android_packages_apps_Trebuchet-1e085760ee52ab91d2ae34b32583c0507c818747.zip |
Trebuchet: Scale icons in portrait if using condensed grid
Issue-id: CYNGNOS-1993
Change-Id: I4b74402ebf61a7faed28a74683d87592121bb090
(cherry picked from commit c5454ec15b2849bc25cbe5812a7334af0d4c6397)
-rw-r--r-- | src/com/android/launcher3/DeviceProfile.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 29dec439c..51c634d4f 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -159,7 +159,7 @@ public class DeviceProfile { } // Calculate the remaining vars - updateAvailableDimensions(dm, res); + updateAvailableDimensions(dm, res, isLandscape); computeAllAppsButtonSize(context); // Search Bar @@ -181,7 +181,7 @@ public class DeviceProfile { allAppsButtonVisualSize = (int) (hotseatIconSizePx * (1 - padding)); } - private void updateAvailableDimensions(DisplayMetrics dm, Resources res) { + private void updateAvailableDimensions(DisplayMetrics dm, Resources res, boolean isLandscape) { // Check to see if the icons fit in the new available height. If not, then we need to // shrink the icon size. float scale = 1f; @@ -192,6 +192,9 @@ public class DeviceProfile { // We only care about the top and bottom workspace padding, which is not affected by RTL. Rect workspacePadding = getWorkspacePadding(false /* isLayoutRtl */); int maxHeight = (availableHeightPx - workspacePadding.top - workspacePadding.bottom); + if (!isLandscape) { //Include the hotseat and search bar if portrait + maxHeight -= (hotseatBarHeightPx + searchBarSpaceHeightPx); + } if (usedHeight > maxHeight) { scale = maxHeight / usedHeight; drawablePadding = 0; |