summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/PagedViewIcon.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2010-10-20 17:49:27 -0700
committerWinson Chung <winsonc@google.com>2010-10-20 18:39:54 -0700
commitdf4b83dd9d6380ab963c62d1f9d1312efc87cb0f (patch)
treee8fd6a182f7af67fc7779207b4e2fed696f56ce5 /src/com/android/launcher2/PagedViewIcon.java
parentbae3d061cc16ad005302b5eec404c4c0bc3a7421 (diff)
downloadandroid_packages_apps_Trebuchet-df4b83dd9d6380ab963c62d1f9d1312efc87cb0f.tar.gz
android_packages_apps_Trebuchet-df4b83dd9d6380ab963c62d1f9d1312efc87cb0f.tar.bz2
android_packages_apps_Trebuchet-df4b83dd9d6380ab963c62d1f9d1312efc87cb0f.zip
More spacing changes for AllApps.
- Also testing a simple scale of existing icons in lieu of high res icons. Change-Id: Ib9758064536cd1b1704344ea885bccdc93dd3466
Diffstat (limited to 'src/com/android/launcher2/PagedViewIcon.java')
-rw-r--r--src/com/android/launcher2/PagedViewIcon.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/com/android/launcher2/PagedViewIcon.java b/src/com/android/launcher2/PagedViewIcon.java
index 0f7898b27..010c573f1 100644
--- a/src/com/android/launcher2/PagedViewIcon.java
+++ b/src/com/android/launcher2/PagedViewIcon.java
@@ -54,6 +54,7 @@ public class PagedViewIcon extends TextView implements Checkable {
private Object mIconCacheKey;
private PagedViewIconCache mIconCache;
+ private int mScaledIconSize;
private int mAlpha;
private int mHolographicAlpha;
@@ -82,6 +83,7 @@ public class PagedViewIcon extends TextView implements Checkable {
mHoloOutlineColor = a.getColor(R.styleable.PagedViewIcon_outlineColor, 0);
mCheckedBlurColor = a.getColor(R.styleable.PagedViewIcon_checkedBlurColor, 0);
mCheckedOutlineColor = a.getColor(R.styleable.PagedViewIcon_checkedOutlineColor, 0);
+ mScaledIconSize = a.getDimensionPixelSize(R.styleable.PagedViewIcon_scaledIconSize, 64);
a.recycle();
if (sHolographicOutlineHelper == null) {
@@ -93,13 +95,21 @@ public class PagedViewIcon extends TextView implements Checkable {
setBackgroundDrawable(null);
}
- public void applyFromApplicationInfo(ApplicationInfo info, PagedViewIconCache cache) {
+ public void applyFromApplicationInfo(ApplicationInfo info, PagedViewIconCache cache,
+ boolean scaleUp) {
mIconCache = cache;
mIconCacheKey = info;
mHolographicOutline = mIconCache.getOutline(mIconCacheKey);
+ Bitmap icon;
+ if (scaleUp) {
+ icon = Bitmap.createScaledBitmap(info.iconBitmap, mScaledIconSize,
+ mScaledIconSize, true);
+ } else {
+ icon = info.iconBitmap;
+ }
setCompoundDrawablesWithIntrinsicBounds(null,
- new FastBitmapDrawable(info.iconBitmap), null, null);
+ new FastBitmapDrawable(icon), null, null);
setText(info.title);
setTag(info);
}