diff options
author | Winson Chung <winsonc@google.com> | 2013-12-11 23:52:06 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-12-11 23:52:07 +0000 |
commit | 1239b9da8901f1384aa30f88f8b660078d37ea82 (patch) | |
tree | 25fb00699faf0e3c3a308110d36be8657d032365 /src/com/android | |
parent | fe69287b97d16c8941ab9463e4868fca45ad8152 (diff) | |
parent | dcd27ba90940f29bfc185c86c1b5b789e0d8f2de (diff) | |
download | android_packages_apps_Trebuchet-1239b9da8901f1384aa30f88f8b660078d37ea82.tar.gz android_packages_apps_Trebuchet-1239b9da8901f1384aa30f88f8b660078d37ea82.tar.bz2 android_packages_apps_Trebuchet-1239b9da8901f1384aa30f88f8b660078d37ea82.zip |
Merge "Fixing issue with Widget sizes being icorrectly reported." into jb-ub-now-kermit
Diffstat (limited to 'src/com/android')
-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 72399e4ec..4f16835d7 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), |