Fixing issues with holographic outline cache in AllApps/Customize.
- Fixing issue where the outline cache was not properly used when changing orientations
- Making the outline cache static, and shared across both the AllApps/Customize (since they
share an Apps view)
- Making sure that holographic outlines for items on only one page are not created, since
the holographic outlines will never be shown in that case.
- No longer clearing outline cache as frequently
Change-Id: I291db3802260249d0470d2637d871958baa8ebff
diff --git a/src/com/android/launcher2/AllAppsPagedView.java b/src/com/android/launcher2/AllAppsPagedView.java
index a424bc6..f7d9f0e 100644
--- a/src/com/android/launcher2/AllAppsPagedView.java
+++ b/src/com/android/launcher2/AllAppsPagedView.java
@@ -322,7 +322,7 @@
mApps = list;
Collections.sort(mApps, LauncherModel.APP_NAME_COMPARATOR);
mFilteredApps = rebuildFilteredApps(mApps);
- mPageViewIconCache.clear();
+ mPageViewIconCache.retainAllApps(list);
invalidatePageData();
}
@@ -367,7 +367,7 @@
int removeIndex = findAppByComponent(mApps, info);
if (removeIndex > -1) {
mApps.remove(removeIndex);
- mPageViewIconCache.removeOutline(info);
+ mPageViewIconCache.removeOutline(new PagedViewIconCache.Key(info));
}
}
mFilteredApps = rebuildFilteredApps(mApps);
@@ -478,11 +478,12 @@
}
// Actually reapply to the existing text views
+ final int numPages = getPageCount();
for (int i = startIndex; i < endIndex; ++i) {
final int index = i - startIndex;
final ApplicationInfo info = mFilteredApps.get(i);
PagedViewIcon icon = (PagedViewIcon) layout.getChildAt(index);
- icon.applyFromApplicationInfo(info, mPageViewIconCache, true);
+ icon.applyFromApplicationInfo(info, mPageViewIconCache, true, (numPages > 1));
PagedViewCellLayout.LayoutParams params =
(PagedViewCellLayout.LayoutParams) icon.getLayoutParams();