From e6d4b10cdd4582e6d5977dbd3d0d2f02494780af Mon Sep 17 00:00:00 2001 From: althafvly Date: Thu, 26 Sep 2024 16:22:30 +0530 Subject: [PATCH] camera: Don't disable preview bitmap if its enabled already --- .../java/net/sourceforge/opencamera/preview/Preview.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/sourceforge/opencamera/preview/Preview.java b/app/src/main/java/net/sourceforge/opencamera/preview/Preview.java index 78fcee290..2f9777857 100644 --- a/app/src/main/java/net/sourceforge/opencamera/preview/Preview.java +++ b/app/src/main/java/net/sourceforge/opencamera/preview/Preview.java @@ -1128,8 +1128,11 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu public void onSurfaceTextureUpdated(@NonNull SurfaceTexture arg0) { refreshPreviewBitmap(); + boolean previewBitmapWasEnabled = isPreviewBitmapEnabled(); if (isQRCode()) { - enablePreviewBitmap(); + if (!previewBitmapWasEnabled) { + enablePreviewBitmap(); + } TextureView textureView = (TextureView) this.cameraSurface; Bitmap bitmap = textureView.getBitmap(preview_bitmap); @@ -1158,7 +1161,7 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu } else { // K1ZFP TODO Error 1 } - } else { + } else if (!previewBitmapWasEnabled) { disablePreviewBitmap(); } } -- GitLab