diff options
author | Winson Chung <winsonc@google.com> | 2011-01-05 13:54:43 -0800 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-01-05 16:23:55 -0800 |
commit | 0499834db3f9dc6fb0f5f57b5876b8503bce5189 (patch) | |
tree | f2606e09998f9821e760ea2f6de6ffa5c08e3592 /src/com/android/launcher2/PagedViewIcon.java | |
parent | a6612cd45fc77e4f44fcdd1a74833a61bf440720 (diff) | |
download | android_packages_apps_Trebuchet-0499834db3f9dc6fb0f5f57b5876b8503bce5189.tar.gz android_packages_apps_Trebuchet-0499834db3f9dc6fb0f5f57b5876b8503bce5189.tar.bz2 android_packages_apps_Trebuchet-0499834db3f9dc6fb0f5f57b5876b8503bce5189.zip |
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
Diffstat (limited to 'src/com/android/launcher2/PagedViewIcon.java')
-rw-r--r-- | src/com/android/launcher2/PagedViewIcon.java | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/com/android/launcher2/PagedViewIcon.java b/src/com/android/launcher2/PagedViewIcon.java index e4049eb19..6ce308b1d 100644 --- a/src/com/android/launcher2/PagedViewIcon.java +++ b/src/com/android/launcher2/PagedViewIcon.java @@ -32,7 +32,6 @@ import android.util.AttributeSet; import android.widget.Checkable; import com.android.launcher.R; -import com.android.launcher2.PagedView.PagedViewIconCache; @@ -50,7 +49,7 @@ public class PagedViewIcon extends CacheableTextView implements Checkable { private Bitmap mHolographicOutline; private Bitmap mIcon; - private Object mIconCacheKey; + private PagedViewIconCache.Key mIconCacheKey; private PagedViewIconCache mIconCache; private int mAlpha = 255; @@ -140,26 +139,23 @@ public class PagedViewIcon extends CacheableTextView implements Checkable { } public void applyFromApplicationInfo(ApplicationInfo info, PagedViewIconCache cache, - boolean scaleUp) { - mIconCache = cache; - mIconCacheKey = info; - mHolographicOutline = mIconCache.getOutline(mIconCacheKey); - + boolean scaleUp, boolean createHolographicOutlines) { mIcon = info.iconBitmap; setCompoundDrawablesWithIntrinsicBounds(null, new FastBitmapDrawable(mIcon), null, null); setText(info.title); buildAndEnableCache(); setTag(info); - queueHolographicOutlineCreation(); + if (createHolographicOutlines) { + mIconCache = cache; + mIconCacheKey = new PagedViewIconCache.Key(info); + mHolographicOutline = mIconCache.getOutline(mIconCacheKey); + queueHolographicOutlineCreation(); + } } public void applyFromResolveInfo(ResolveInfo info, PackageManager packageManager, - PagedViewIconCache cache, IconCache modelIconCache) { - mIconCache = cache; - mIconCacheKey = info; - mHolographicOutline = mIconCache.getOutline(mIconCacheKey); - + PagedViewIconCache cache, IconCache modelIconCache, boolean createHolographicOutlines) { mIcon = Utilities.createIconBitmap( modelIconCache.getFullResIcon(info, packageManager), mContext); setCompoundDrawablesWithIntrinsicBounds(null, new FastBitmapDrawable(mIcon), null, null); @@ -167,7 +163,12 @@ public class PagedViewIcon extends CacheableTextView implements Checkable { buildAndEnableCache(); setTag(info); - queueHolographicOutlineCreation(); + if (createHolographicOutlines) { + mIconCache = cache; + mIconCacheKey = new PagedViewIconCache.Key(info); + mHolographicOutline = mIconCache.getOutline(mIconCacheKey); + queueHolographicOutlineCreation(); + } } @Override |