diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-05-22 12:25:45 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2015-06-03 19:07:44 -0700 |
commit | 53d7ee4285842732517edcccbdcaa92dccb1e107 (patch) | |
tree | 95f5a6520d621ab43c122ed37b7d12f45633b41e /src/com/android/launcher3/BubbleTextView.java | |
parent | f4fe7fc5449bbfcfa7e95c7f9040c81d833a1fdb (diff) | |
download | android_packages_apps_Trebuchet-53d7ee4285842732517edcccbdcaa92dccb1e107.tar.gz android_packages_apps_Trebuchet-53d7ee4285842732517edcccbdcaa92dccb1e107.tar.bz2 android_packages_apps_Trebuchet-53d7ee4285842732517edcccbdcaa92dccb1e107.zip |
Fixing different bitmap sizes in different orientations
> Using a single bitmap icon size
> Picking up appropriate density for satisfy the required icon size
> Fixing some icon size assumptions during icon animations
Bug: 19514688
Change-Id: Ia7a1d0d2c03a9d39ccc241fa4ae3eb8a0f374585
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r-- | src/com/android/launcher3/BubbleTextView.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 314c21f64..f4e306af3 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -57,6 +57,7 @@ public class BubbleTextView extends TextView { private static final int DISPLAY_WORKSPACE = 0; private static final int DISPLAY_ALL_APPS = 1; + private final Launcher mLauncher; private Drawable mIcon; private final Drawable mBackground; private final CheckLongPressHelper mLongPressHelper; @@ -91,8 +92,8 @@ public class BubbleTextView extends TextView { public BubbleTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); - LauncherAppState app = LauncherAppState.getInstance(); - DeviceProfile grid = ((Launcher) context).getDeviceProfile(); + mLauncher = (Launcher) context; + DeviceProfile grid = mLauncher.getDeviceProfile(); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.BubbleTextView, defStyle, 0); @@ -142,7 +143,7 @@ public class BubbleTextView extends TextView { boolean promiseStateChanged) { Bitmap b = info.getIcon(iconCache); - FastBitmapDrawable iconDrawable = Utilities.createIconDrawable(b); + FastBitmapDrawable iconDrawable = mLauncher.createIconDrawable(b); iconDrawable.setGhostModeEnabled(info.isDisabled != 0); setIcon(iconDrawable, mIconSize); @@ -158,7 +159,7 @@ public class BubbleTextView extends TextView { } public void applyFromApplicationInfo(AppInfo info) { - setIcon(Utilities.createIconDrawable(info.iconBitmap), mIconSize); + setIcon(mLauncher.createIconDrawable(info.iconBitmap), mIconSize); setText(info.title); if (info.contentDescription != null) { setContentDescription(info.contentDescription); @@ -171,7 +172,7 @@ public class BubbleTextView extends TextView { } public void applyFromPackageItemInfo(PackageItemInfo info) { - setIcon(Utilities.createIconDrawable(info.iconBitmap), mIconSize); + setIcon(mLauncher.createIconDrawable(info.iconBitmap), mIconSize); setText(info.title); if (info.contentDescription != null) { setContentDescription(info.contentDescription); |