Adding outline cache for PagedViewIcons.
Change-Id: I258740a0323660edd73b5f40d61d509455ae195b
diff --git a/src/com/android/launcher2/AllAppsPagedView.java b/src/com/android/launcher2/AllAppsPagedView.java
index 378c248..a673304 100644
--- a/src/com/android/launcher2/AllAppsPagedView.java
+++ b/src/com/android/launcher2/AllAppsPagedView.java
@@ -211,6 +211,7 @@
mApps = list;
Collections.sort(mApps, LauncherModel.APP_NAME_COMPARATOR);
mFilteredApps = rebuildFilteredApps(mApps);
+ mPageViewIconCache.clear();
invalidatePageData();
}
@@ -236,9 +237,11 @@
// loop through all the apps and remove apps that have the same component
final int length = list.size();
for (int i = 0; i < length; ++i) {
- int removeIndex = findAppByComponent(mApps, list.get(i));
+ final ApplicationInfo info = list.get(i);
+ int removeIndex = findAppByComponent(mApps, info);
if (removeIndex > -1) {
mApps.remove(removeIndex);
+ mPageViewIconCache.removeOutline(info);
}
}
mFilteredApps = rebuildFilteredApps(mApps);
@@ -327,16 +330,13 @@
// actually reapply to the existing text views
for (int i = startIndex; i < endIndex; ++i) {
- int index = i - startIndex;
- ApplicationInfo info = mFilteredApps.get(i);
- TextView text = (TextView) layout.getChildAt(index);
- text.setCompoundDrawablesWithIntrinsicBounds(null,
- new FastBitmapDrawable(info.iconBitmap), null, null);
- text.setText(info.title);
- text.setTag(info);
+ final int index = i - startIndex;
+ final ApplicationInfo info = mFilteredApps.get(i);
+ PagedViewIcon icon = (PagedViewIcon) layout.getChildAt(index);
+ icon.applyFromApplicationInfo(info, mPageViewIconCache);
PagedViewCellLayout.LayoutParams params =
- (PagedViewCellLayout.LayoutParams) text.getLayoutParams();
+ (PagedViewCellLayout.LayoutParams) icon.getLayoutParams();
params.cellX = index % mCellCountX;
params.cellY = index / mCellCountX;
}