Caching icon labels to bitmaps for better performance
Change-Id: I78a3c116c1103b5b994a47f2cfcff18c0a9b31b8
diff --git a/src/com/android/launcher2/PagedViewIcon.java b/src/com/android/launcher2/PagedViewIcon.java
index b9b9b37..9e48351 100644
--- a/src/com/android/launcher2/PagedViewIcon.java
+++ b/src/com/android/launcher2/PagedViewIcon.java
@@ -39,7 +39,7 @@
* An icon on a PagedView, specifically for items in the launcher's paged view (with compound
* drawables on the top).
*/
-public class PagedViewIcon extends TextView implements Checkable {
+public class PagedViewIcon extends CacheableTextView implements Checkable {
private static final String TAG = "PagedViewIcon";
// holographic outline
@@ -138,6 +138,7 @@
mIcon = info.iconBitmap;
setCompoundDrawablesWithIntrinsicBounds(null, new FastBitmapDrawable(mIcon), null, null);
setText(info.title);
+ buildAndEnableCache();
setTag(info);
queueHolographicOutlineCreation();
@@ -153,6 +154,7 @@
modelIconCache.getFullResIcon(info, packageManager), mContext);
setCompoundDrawablesWithIntrinsicBounds(null, new FastBitmapDrawable(mIcon), null, null);
setText(info.loadLabel(packageManager));
+ buildAndEnableCache();
setTag(info);
queueHolographicOutlineCreation();