summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2015-07-13 23:24:00 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-07-13 23:24:02 +0000
commitaf2637376f5fb37d1dfa598a8c95a623367501ce (patch)
treee7e5d657594778211ec8f241fb46c8009e1bc4ed /src
parentcbab1cb44f4fca4ea80ec2aeb63b55b9ea5d9e2e (diff)
parent4f3bfadbf472665ea8431cf2616d56a9445df466 (diff)
downloadandroid_packages_apps_Trebuchet-af2637376f5fb37d1dfa598a8c95a623367501ce.tar.gz
android_packages_apps_Trebuchet-af2637376f5fb37d1dfa598a8c95a623367501ce.tar.bz2
android_packages_apps_Trebuchet-af2637376f5fb37d1dfa598a8c95a623367501ce.zip
Merge "Fixing regression in calculating workspace padding." into ub-launcher3-burnaby
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/DeviceProfile.java22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index a50540d26..62b05b0d6 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -265,7 +265,7 @@ public class DeviceProfile {
if (isTablet) {
// Pad the left and right of the workspace to ensure consistent spacing
// between all icons
- int width = isLandscape ? Math.max(widthPx, heightPx) : Math.min(widthPx, heightPx);
+ int width = getCurrentWidth();
// XXX: If the icon size changes across orientations, we will have to take
// that into account here too.
int gap = (int) ((width - 2 * edgeMarginPx -
@@ -301,12 +301,8 @@ public class DeviceProfile {
// Pad the left and right of the workspace to ensure consistent spacing
// between all icons
float gapScale = 1f + (dragViewScale - 1f) / 2f;
- int width = isLandscape
- ? Math.max(widthPx, heightPx)
- : Math.min(widthPx, heightPx);
- int height = isLandscape
- ? Math.max(widthPx, heightPx)
- : Math.min(widthPx, heightPx);
+ int width = getCurrentWidth();
+ int height = getCurrentHeight();
int paddingTop = searchBarBounds.bottom;
int paddingBottom = hotseatBarHeightPx + pageIndicatorHeightPx;
int availableWidth = Math.max(0, width - (int) ((inv.numColumns * cellWidthPx) +
@@ -517,4 +513,16 @@ public class DeviceProfile {
}
}
}
+
+ private int getCurrentWidth() {
+ return isLandscape
+ ? Math.max(widthPx, heightPx)
+ : Math.min(widthPx, heightPx);
+ }
+
+ private int getCurrentHeight() {
+ return isLandscape
+ ? Math.min(widthPx, heightPx)
+ : Math.max(widthPx, heightPx);
+ }
}