Caching icon labels to bitmaps for better performance

Change-Id: I78a3c116c1103b5b994a47f2cfcff18c0a9b31b8
This commit is contained in:
Michael Jurka
2010-11-17 12:33:46 -08:00
parent 49767aefe5
commit 67b2f6cba5
4 changed files with 144 additions and 13 deletions

View File

@@ -39,7 +39,7 @@ import com.android.launcher2.PagedView.PagedViewIconCache;
* 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 @@ public class PagedViewIcon extends TextView implements Checkable {
mIcon = info.iconBitmap;
setCompoundDrawablesWithIntrinsicBounds(null, new FastBitmapDrawable(mIcon), null, null);
setText(info.title);
buildAndEnableCache();
setTag(info);
queueHolographicOutlineCreation();
@@ -153,6 +154,7 @@ public class PagedViewIcon extends TextView implements Checkable {
modelIconCache.getFullResIcon(info, packageManager), mContext);
setCompoundDrawablesWithIntrinsicBounds(null, new FastBitmapDrawable(mIcon), null, null);
setText(info.loadLabel(packageManager));
buildAndEnableCache();
setTag(info);
queueHolographicOutlineCreation();