diff options
author | Winson Chung <winsonc@google.com> | 2013-12-11 15:28:15 -0800 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2013-12-11 15:28:15 -0800 |
commit | dcd27ba90940f29bfc185c86c1b5b789e0d8f2de (patch) | |
tree | c2444ed860831842a6394640e1fa4d8f7fa63d4c /src | |
parent | 33231f587e1a6f716af68e6198df774d2847a8e5 (diff) | |
download | android_packages_apps_Trebuchet-dcd27ba90940f29bfc185c86c1b5b789e0d8f2de.tar.gz android_packages_apps_Trebuchet-dcd27ba90940f29bfc185c86c1b5b789e0d8f2de.tar.bz2 android_packages_apps_Trebuchet-dcd27ba90940f29bfc185c86c1b5b789e0d8f2de.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 bf4f561e0..a1eb27dba 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -3115,13 +3115,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), @@ -3131,8 +3129,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), |