summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-06-06 13:37:31 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-06-06 13:37:31 -0700
commit89f80baa3654bfd4bd1875fa95628bb2e39548e0 (patch)
treefcd1c0e362c60e35ef6c8ee630ff700c43b16373
parent498601a89635d24286a1a112062c05d9bbd9e2de (diff)
parent5b7fcb7a8bee95b5c59dd296c6b022e3d1c55102 (diff)
downloadandroid_packages_apps_Trebuchet-89f80baa3654bfd4bd1875fa95628bb2e39548e0.zip
android_packages_apps_Trebuchet-89f80baa3654bfd4bd1875fa95628bb2e39548e0.tar.gz
android_packages_apps_Trebuchet-89f80baa3654bfd4bd1875fa95628bb2e39548e0.tar.bz2
am 5b7fcb7a: Merge "Defer loading widget previews until after All Apps transition" into jb-dev
* commit '5b7fcb7a8bee95b5c59dd296c6b022e3d1c55102': Defer loading widget previews until after All Apps transition
-rw-r--r--src/com/android/launcher2/AppsCustomizePagedView.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 45bb08a..ac6ec88 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -310,6 +310,8 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
private boolean mInTransition;
private ArrayList<AsyncTaskPageData> mDeferredSyncWidgetPageItems =
new ArrayList<AsyncTaskPageData>();
+ private ArrayList<Runnable> mDeferredPrepareLoadWidgetPreviewsTasks =
+ new ArrayList<Runnable>();
// Used for drawing shortcut previews
BitmapCache mCachedShortcutPreviewBitmap = new BitmapCache();
@@ -944,6 +946,10 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
onSyncWidgetPageItems(d);
}
mDeferredSyncWidgetPageItems.clear();
+ for (Runnable r : mDeferredPrepareLoadWidgetPreviewsTasks) {
+ r.run();
+ }
+ mDeferredPrepareLoadWidgetPreviewsTasks.clear();
mForceDrawAllChildrenNextFrame = !toWorkspace;
}
@@ -1027,6 +1033,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
}
mDeferredSyncWidgetPageItems.clear();
+ mDeferredPrepareLoadWidgetPreviewsTasks.clear();
}
public void setContentType(ContentType type) {
@@ -1515,8 +1522,12 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
loadWidgetPreviewsInBackground(null, data);
onSyncWidgetPageItems(data);
} else {
- prepareLoadWidgetPreviewsTask(page, items,
- maxPreviewWidth, maxPreviewHeight, mWidgetCountX);
+ if (mInTransition) {
+ mDeferredPrepareLoadWidgetPreviewsTasks.add(this);
+ } else {
+ prepareLoadWidgetPreviewsTask(page, items,
+ maxPreviewWidth, maxPreviewHeight, mWidgetCountX);
+ }
}
}
});