summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Brabham <optedoblivion@cyngn.com>2016-01-04 13:53:43 -0800
committerTom Powell <zifnab@zifnab06.net>2017-03-26 16:13:55 -0700
commite461793b6c2fec4ba3bd154be83f670a7a09ff92 (patch)
tree40ce563004f421c5e0433411c719b5b5b5eac70e
parent7fa3faa3bf0594a4cf7273430df78a2ac8024838 (diff)
downloadandroid_packages_apps_Trebuchet-e461793b6c2fec4ba3bd154be83f670a7a09ff92.zip
android_packages_apps_Trebuchet-e461793b6c2fec4ba3bd154be83f670a7a09ff92.tar.gz
android_packages_apps_Trebuchet-e461793b6c2fec4ba3bd154be83f670a7a09ff92.tar.bz2
Ensure we don't go over the icon size limitation
Change-Id: Id6209acc0c18b27d0a2826acdc1c7a83efb744ad Ticket-Id: CYNGNOS-1427
-rw-r--r--src/com/android/launcher3/BubbleTextView.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index b957c47..adc153f 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -172,6 +172,12 @@ public class BubbleTextView extends TextView
boolean promiseStateChanged) {
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);
+ }
+
FastBitmapDrawable iconDrawable = mLauncher.createIconDrawable(b);
iconDrawable.setGhostModeEnabled(info.isDisabled != 0);