From 44c087b666886e0ca8e480a6ecbfcfebd13b4221 Mon Sep 17 00:00:00 2001 From: Arjan Schrijver Date: Sun, 31 Jul 2022 22:53:32 +0200 Subject: [PATCH] Fossil Hybrid HR: Fix watchface background fuzziness due to resizing --- .../devices/qhybrid/HybridHRWatchfaceDesignerActivity.java | 6 +++--- .../freeyourgadget/gadgetbridge/util/BitmapUtil.java | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceDesignerActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceDesignerActivity.java index 79671c859..6e18fd2f5 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceDesignerActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceDesignerActivity.java @@ -572,7 +572,7 @@ public class HybridHRWatchfaceDesignerActivity extends AbstractGBActivity implem wfFactory = new HybridHRWatchfaceFactory(watchfaceName); } wfFactory.setSettings(watchfaceSettings); - wfFactory.setBackground(processedBackgroundImage); + wfFactory.setBackground(selectedBackgroundImage); wfFactory.addWidgets(widgets); try { File tempFile = File.createTempFile("tmpWatchfaceFile", null); @@ -607,14 +607,14 @@ public class HybridHRWatchfaceDesignerActivity extends AbstractGBActivity implem public void onClick(DialogInterface dialog, int which) { findViewById(R.id.watchface_upload_progress_bar).setVisibility(View.VISIBLE); GBApplication.deviceService().onInstallApp(tempAppFileUri); - FossilHRInstallHandler.saveAppInCache(fossilFile, processedBackgroundImage, wfFactory.getPreviewImage(mContext), mCoordinator, HybridHRWatchfaceDesignerActivity.this); + FossilHRInstallHandler.saveAppInCache(fossilFile, selectedBackgroundImage, wfFactory.getPreviewImage(mContext), mCoordinator, HybridHRWatchfaceDesignerActivity.this); } }) .show(); } else { findViewById(R.id.watchface_upload_progress_bar).setVisibility(View.VISIBLE); GBApplication.deviceService().onInstallApp(tempAppFileUri); - FossilHRInstallHandler.saveAppInCache(fossilFile, processedBackgroundImage, wfFactory.getPreviewImage(mContext), mCoordinator, HybridHRWatchfaceDesignerActivity.this); + FossilHRInstallHandler.saveAppInCache(fossilFile, selectedBackgroundImage, wfFactory.getPreviewImage(mContext), mCoordinator, HybridHRWatchfaceDesignerActivity.this); } } } catch (IOException e) { diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/BitmapUtil.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/BitmapUtil.java index 905f2373f..ae9d0f71b 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/BitmapUtil.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/BitmapUtil.java @@ -173,8 +173,6 @@ public class BitmapUtil { float left = (squareBitmapWidth-srcBitmap.getWidth())/2; float top = (squareBitmapWidth-srcBitmap.getHeight())/2; canvas.drawBitmap(srcBitmap, left, top, paint); - // Free the native object associated with this bitmap. - srcBitmap.recycle(); // Return the circular bitmap return dstBitmap; }