OSDN Git Service

Ensure we don't go over the icon size limitation
authorMartin Brabham <optedoblivion@cyngn.com>
Mon, 4 Jan 2016 21:53:43 +0000 (13:53 -0800)
committerMartin Brabham <optedoblivion@cyngn.com>
Mon, 4 Jan 2016 21:53:45 +0000 (13:53 -0800)
Change-Id: Id6209acc0c18b27d0a2826acdc1c7a83efb744ad
Ticket-Id: CYNGNOS-1427

src/com/android/launcher3/BubbleTextView.java

index b957c47..adc153f 100644 (file)
@@ -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);