summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Shvadskiy <ashvadskiy@cyngn.com>2016-05-02 13:13:28 -0700
committerTom Powell <zifnab@zifnab06.net>2017-03-26 16:21:55 -0700
commitbf2936147231a13c913e9367cae119b79f1d64b6 (patch)
treea3cf9893404bc07df545df3bdd980911eb67b8ca
parentb6f1500e0ce19d4a8061f0697cae3811645d9de4 (diff)
downloadandroid_packages_apps_Trebuchet-bf2936147231a13c913e9367cae119b79f1d64b6.zip
android_packages_apps_Trebuchet-bf2936147231a13c913e9367cae119b79f1d64b6.tar.gz
android_packages_apps_Trebuchet-bf2936147231a13c913e9367cae119b79f1d64b6.tar.bz2
Use bitmap filtering for shrinking app icons
Change-Id: I54d1bff08c947f54ec0d35ec08b557ddd8e31e23 issue-id: CRACKLING-1051
-rw-r--r--src/com/android/launcher3/BubbleTextView.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index adc153f..96c638c 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -170,12 +170,17 @@ public class BubbleTextView extends TextView
public void applyFromShortcutInfo(ShortcutInfo info, IconCache iconCache,
boolean promiseStateChanged) {
- Bitmap b = info.getIcon(iconCache);
+ Drawable iconDrawable;
+ if (info.customDrawable != null) {
+ iconDrawable = info.customDrawable;
+ } else {
+ Bitmap b = info.getIcon(iconCache);
- if (b.getWidth() > mIconSize || b.getHeight() > mIconSize) {
- b = Bitmap.createScaledBitmap(b, mIconSize, mIconSize, false);
- info.setIcon(b);
- info.updateIcon(iconCache);
+ if (b.getWidth() > mIconSize || b.getHeight() > mIconSize) {
+ b = Bitmap.createScaledBitmap(b, mIconSize, mIconSize, true);
+ info.setIcon(b);
+ info.updateIcon(iconCache);
+ }
}
FastBitmapDrawable iconDrawable = mLauncher.createIconDrawable(b);