diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-03-19 14:31:19 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2015-03-20 17:31:11 -0700 |
commit | 5b0e669169ea2c951bf2f6f71faf793b24db3c23 (patch) | |
tree | 32ab7b4381d40ee1e6b7a66691feb4439e6253cd /src/com/android/launcher3/Workspace.java | |
parent | 71c3baf5ebc520d5146946e0d7907a5dc12366db (diff) | |
download | android_packages_apps_Trebuchet-5b0e669169ea2c951bf2f6f71faf793b24db3c23.tar.gz android_packages_apps_Trebuchet-5b0e669169ea2c951bf2f6f71faf793b24db3c23.tar.bz2 android_packages_apps_Trebuchet-5b0e669169ea2c951bf2f6f71faf793b24db3c23.zip |
Rewrite: Widget preview loader logic
> Widget previews are saved in data dir instead of cache dir
> Expiring widget previews similar to IconCache
> Removed support for setting thread priorities
Bug: 19865031
Change-Id: Ib6033c2b1ff8ae61bba8762ca994ccd8217d3c75
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); |