Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0042aaa7 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊 Committed by Nishith Khanna
Browse files

camera: Hide multi-lens in panorama

parent 99d9a6f3
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -1105,6 +1105,10 @@ public class MainUI {
            int resource;
            int content_description;
            int switch_video_content_description;
            boolean panorama_recording = main_activity.getApplicationInterface().getPhotoMode()
                    == MyApplicationInterface.PhotoMode.Panorama &&
                    main_activity.getApplicationInterface().getGyroSensor().isRecording();
            boolean isQrMode = main_activity.getPreview().isQRCode();
            // The switch order is camera -> video -> qrcode -> camera...
            if( main_activity.getPreview().isVideo() ) {
                if( MyDebug.LOG )
@@ -1112,14 +1116,13 @@ public class MainUI {
                resource = main_activity.getPreview().isVideoRecording() ? R.drawable.take_video_recording : R.drawable.take_video_selector;
                content_description = main_activity.getPreview().isVideoRecording() ? R.string.stop_video : R.string.start_video;
                switch_video_content_description = R.string.switch_to_qrcode;
            } else if (main_activity.getPreview().isQRCode()) {
            } else if (isQrMode) {
                if (MyDebug.LOG)
                    Log.d(TAG, "set icon to qrcode");
                resource = R.drawable.empty;
                content_description = 0;
                switch_video_content_description = R.string.switch_to_photo;
            } else if( main_activity.getApplicationInterface().getPhotoMode() == MyApplicationInterface.PhotoMode.Panorama &&
                    main_activity.getApplicationInterface().getGyroSensor().isRecording() ) {
            } else if( panorama_recording ) {
                if( MyDebug.LOG )
                    Log.d(TAG, "set icon to recording panorama");
                resource = R.drawable.baseline_check_white_48;
@@ -1145,7 +1148,7 @@ public class MainUI {
            view.setContentDescription( main_activity.getResources().getString(switch_video_content_description) );
            if (main_activity.getPreview().isVideo()) {
                resource = R.drawable.ic_switch_qrcode;
            } else if (main_activity.getPreview().isQRCode()) {
            } else if (isQrMode) {
                resource = R.drawable.ic_photo_camera_white_48dp;
            } else { // camera
                resource = R.drawable.ic_videocam_white_48dp;
@@ -1154,13 +1157,11 @@ public class MainUI {
            view.setTag(resource); // for testing

            // Hide/Show gallery & switch camera icons.
            if (main_activity.getPreview().isQRCode()) {
                main_activity.findViewById(R.id.gallery).setVisibility(View.INVISIBLE);
                main_activity.findViewById(R.id.switch_camera).setVisibility(View.INVISIBLE);
            } else {
                main_activity.findViewById(R.id.gallery).setVisibility(View.VISIBLE);
                main_activity.findViewById(R.id.switch_camera).setVisibility(View.VISIBLE);
            }
            boolean showGalleryAndSwitch = isQrMode || panorama_recording;
            main_activity.findViewById(R.id.gallery).setVisibility(
                    showGalleryAndSwitch ? View.INVISIBLE : View.VISIBLE);
            main_activity.findViewById(R.id.switch_camera).setVisibility(
                    showGalleryAndSwitch ? View.INVISIBLE : View.VISIBLE);
        }
    }