From 74d1aba50294760beec1267ed08cdc55f2704515 Mon Sep 17 00:00:00 2001 From: Nishith Khanna Date: Tue, 24 Dec 2024 17:47:19 +0530 Subject: [PATCH] Hide switch button when video is recording --- .../java/net/sourceforge/opencamera/ui/MainUI.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/net/sourceforge/opencamera/ui/MainUI.java b/app/src/main/java/net/sourceforge/opencamera/ui/MainUI.java index bd0e1ec0..9def30f6 100644 --- a/app/src/main/java/net/sourceforge/opencamera/ui/MainUI.java +++ b/app/src/main/java/net/sourceforge/opencamera/ui/MainUI.java @@ -1244,12 +1244,13 @@ public class MainUI { == MyApplicationInterface.PhotoMode.Panorama && main_activity.getApplicationInterface().getGyroSensor().isRecording(); boolean isQrMode = main_activity.getPreview().isQRCode(); + boolean video_recording = main_activity.getPreview().isVideoRecording(); // The switch order is camera -> video -> qrcode -> camera... if( main_activity.getPreview().isVideo() ) { if( MyDebug.LOG ) Log.d(TAG, "set icon to video"); - resource = main_activity.getPreview().isVideoRecording() ? R.drawable.ic_camera_video_recording : R.drawable.ic_camera_video; - content_description = main_activity.getPreview().isVideoRecording() ? R.string.stop_video : R.string.start_video; + resource = video_recording ? R.drawable.ic_camera_video_recording : R.drawable.ic_camera_video; + content_description = video_recording ? R.string.stop_video : R.string.start_video; switch_video_content_description = R.string.switch_to_qrcode; } else if (isQrMode) { if (MyDebug.LOG) @@ -1291,11 +1292,12 @@ public class MainUI { view.setTag(resource); // for testing // Hide/Show gallery & switch camera icons. - boolean showGalleryAndSwitch = isQrMode || panorama_recording; + boolean showGallery = isQrMode || panorama_recording; + boolean showSwitch = isQrMode || panorama_recording || video_recording; main_activity.findViewById(R.id.gallery).setVisibility( - showGalleryAndSwitch ? View.INVISIBLE : View.VISIBLE); + showGallery ? View.INVISIBLE : View.VISIBLE); main_activity.findViewById(R.id.switch_camera).setVisibility( - showGalleryAndSwitch ? View.INVISIBLE : View.VISIBLE); + showSwitch ? View.INVISIBLE : View.VISIBLE); } } /** -- GitLab