diff options
author | Winson Chung <winsonc@google.com> | 2013-12-11 15:28:15 -0800 |
---|---|---|
committer | Danesh M <daneshm90@gmail.com> | 2014-06-06 22:54:22 -0700 |
commit | f805d1cb9207e7c35e7333b1a4bde152be8e1b09 (patch) | |
tree | dd3354b33e27b2b812d21fda703f1c3d0c338df0 /src | |
parent | 8ca776ecd499f99e618e3f9227e4ea0600fe7b4f (diff) | |
download | android_packages_apps_Trebuchet-f805d1cb9207e7c35e7333b1a4bde152be8e1b09.tar.gz android_packages_apps_Trebuchet-f805d1cb9207e7c35e7333b1a4bde152be8e1b09.tar.bz2 android_packages_apps_Trebuchet-f805d1cb9207e7c35e7333b1a4bde152be8e1b09.zip |
Fixing issue with Widget sizes being icorrectly reported.
Change-Id: I8474514cc3722d8450c707b7fd1ccea2ea344a59
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 9fa215684..d2c9d3e7e 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -3264,13 +3264,11 @@ public class Workspace extends SmoothPagedView display.getCurrentSizeRange(smallestSize, largestSize); int countX = (int) grid.numColumns; int countY = (int) grid.numRows; - int constrainedLongEdge = largestSize.y; - int constrainedShortEdge = smallestSize.y; if (orientation == CellLayout.LANDSCAPE) { if (mLandscapeCellLayoutMetrics == null) { Rect padding = grid.getWorkspacePadding(CellLayout.LANDSCAPE); - int width = constrainedLongEdge - padding.left - padding.right; - int height = constrainedShortEdge - padding.top - padding.bottom; + int width = largestSize.x - padding.left - padding.right; + int height = smallestSize.y - padding.top - padding.bottom; mLandscapeCellLayoutMetrics = new Rect(); mLandscapeCellLayoutMetrics.set( grid.calculateCellWidth(width, countX), @@ -3280,8 +3278,8 @@ public class Workspace extends SmoothPagedView } else if (orientation == CellLayout.PORTRAIT) { if (mPortraitCellLayoutMetrics == null) { Rect padding = grid.getWorkspacePadding(CellLayout.PORTRAIT); - int width = constrainedShortEdge - padding.left - padding.right; - int height = constrainedLongEdge - padding.top - padding.bottom; + int width = smallestSize.x - padding.left - padding.right; + int height = largestSize.y - padding.top - padding.bottom; mPortraitCellLayoutMetrics = new Rect(); mPortraitCellLayoutMetrics.set( grid.calculateCellWidth(width, countX), |