From 228008e42c37ead50584d15022a3521eadd51e1b Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Thu, 9 Dec 2021 16:14:06 +0000 Subject: [PATCH] Bangle.js - Minor tweaks to sizes for drawableToBitmap --- .../devices/banglejs/BangleJSDeviceSupport.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java index fd164dd01..cbbf72b36 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java @@ -633,15 +633,14 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport { return bitmapDrawable.getBitmap(); } } - int w = 1; - int h = 8; + int w = 24; + int h = 24; if (drawable.getIntrinsicWidth() > 0 && drawable.getIntrinsicHeight() > 0) { - - } else { w = drawable.getIntrinsicWidth(); h = drawable.getIntrinsicHeight(); - if (w>64) w=64; - if (h>64) h=64; + // don't allocate anything too big + if (w>24) w=24; + if (h>24) h=24; } Bitmap bitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888); // Single color bitmap will be created of 1x1 pixel