diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-03-21 01:19:25 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-03-21 01:19:26 +0000 |
commit | 244fa8c9a215db48645ad372a6b33404cdc65e64 (patch) | |
tree | b9587cad5c01ec63c5eed9e6b4eb8af67154d952 /src/com/android/launcher3/Workspace.java | |
parent | e85d7145222ba1311cd9280726d8419b84f2f94b (diff) | |
parent | 5b0e669169ea2c951bf2f6f71faf793b24db3c23 (diff) | |
download | android_packages_apps_Trebuchet-244fa8c9a215db48645ad372a6b33404cdc65e64.tar.gz android_packages_apps_Trebuchet-244fa8c9a215db48645ad372a6b33404cdc65e64.tar.bz2 android_packages_apps_Trebuchet-244fa8c9a215db48645ad372a6b33404cdc65e64.zip |
Merge "Rewrite: Widget preview loader logic" into ub-launcher3-burnaby
Diffstat (limited to 'src/com/android/launcher3/Workspace.java')
-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 37265fe47..c274e4d4e 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -366,13 +366,12 @@ public class Workspace extends SmoothPagedView // estimate the size of a widget with spans hSpan, vSpan. return MAX_VALUE for each // dimension if unsuccessful - public int[] estimateItemSize(int hSpan, int vSpan, - ItemInfo itemInfo, boolean springLoaded) { + public int[] estimateItemSize(ItemInfo itemInfo, boolean springLoaded) { int[] size = new int[2]; if (getChildCount() > 0) { // Use the first non-custom page to estimate the child position CellLayout cl = (CellLayout) getChildAt(numCustomPages()); - Rect r = estimateItemPosition(cl, itemInfo, 0, 0, hSpan, vSpan); + Rect r = estimateItemPosition(cl, itemInfo, 0, 0, itemInfo.spanX, itemInfo.spanY); size[0] = r.width(); size[1] = r.height(); if (springLoaded) { @@ -2065,7 +2064,7 @@ public class Workspace extends SmoothPagedView } public void onDragStartedWithItem(PendingAddItemInfo info, Bitmap b, boolean clipAlpha) { - int[] size = estimateItemSize(info.spanX, info.spanY, info, false); + int[] size = estimateItemSize(info, false); // The outline is used to visualize where the item will land if dropped mDragOutline = createDragOutline(b, DRAG_BITMAP_PADDING, size[0], size[1], clipAlpha); @@ -4032,8 +4031,7 @@ public class Workspace extends SmoothPagedView } public Bitmap createWidgetBitmap(ItemInfo widgetInfo, View layout) { - int[] unScaledSize = mLauncher.getWorkspace().estimateItemSize(widgetInfo.spanX, - widgetInfo.spanY, widgetInfo, false); + int[] unScaledSize = mLauncher.getWorkspace().estimateItemSize(widgetInfo, false); int visibility = layout.getVisibility(); layout.setVisibility(VISIBLE); |