summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcretin45 <cretin45@gmail.com>2016-02-29 11:23:05 -0800
committerTom Powell <zifnab@zifnab06.net>2017-03-26 16:17:18 -0700
commitca7e9a72fd1a180b63e2cf0f1d05784e7af2c6fb (patch)
treebbc0cbba85be85feda3709bafb5369be95eca7ef
parentb12488fd22d398d07c2a2e63a7b053157ef655ea (diff)
downloadandroid_packages_apps_Trebuchet-ca7e9a72fd1a180b63e2cf0f1d05784e7af2c6fb.zip
android_packages_apps_Trebuchet-ca7e9a72fd1a180b63e2cf0f1d05784e7af2c6fb.tar.gz
android_packages_apps_Trebuchet-ca7e9a72fd1a180b63e2cf0f1d05784e7af2c6fb.tar.bz2
Trebuchet: Scale icons in portrait if using condensed grid
Issue-id: CYNGNOS-1993 Change-Id: I4b74402ebf61a7faed28a74683d87592121bb090
-rw-r--r--src/com/android/launcher3/DeviceProfile.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 4c5d3ff..70df522 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -160,7 +160,7 @@ public class DeviceProfile {
}
// Calculate the remaining vars
- updateAvailableDimensions(dm, res);
+ updateAvailableDimensions(dm, res, isLandscape);
computeAllAppsButtonSize(context);
// Search Bar
@@ -182,7 +182,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;
@@ -193,6 +193,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;