summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorMartin Brabham <optedoblivion@cyngn.com>2016-01-04 13:53:43 -0800
committerMartin Brabham <optedoblivion@cyngn.com>2016-01-04 13:53:45 -0800
commit514f98d4bcff049450fe950182bcf057a8ddd62d (patch)
tree87d3ab412674d0733456696df451b2fec60515ef /src/com/android
parent6be1ecfa158d635ae7823c21de39646a81ead82f (diff)
downloadandroid_packages_apps_Trebuchet-514f98d4bcff049450fe950182bcf057a8ddd62d.tar.gz
android_packages_apps_Trebuchet-514f98d4bcff049450fe950182bcf057a8ddd62d.tar.bz2
android_packages_apps_Trebuchet-514f98d4bcff049450fe950182bcf057a8ddd62d.zip
Ensure we don't go over the icon size limitation
Change-Id: Id6209acc0c18b27d0a2826acdc1c7a83efb744ad Ticket-Id: CYNGNOS-1427
Diffstat (limited to 'src/com/android')
-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 b957c47be..adc153f2e 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);