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

Commit a59165ac authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

camera: Hide multi-lens in panorama

parent 2ad7b64f
Loading
Loading
Loading
Loading
+12 −11
Original line number Original line Diff line number Diff line
@@ -1071,6 +1071,10 @@ public class MainUI {
            int resource;
            int resource;
            int content_description;
            int content_description;
            int switch_video_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...
            // The switch order is camera -> video -> qrcode -> camera...
            if( main_activity.getPreview().isVideo() ) {
            if( main_activity.getPreview().isVideo() ) {
                if( MyDebug.LOG )
                if( MyDebug.LOG )
@@ -1078,14 +1082,13 @@ public class MainUI {
                resource = main_activity.getPreview().isVideoRecording() ? R.drawable.take_video_recording : R.drawable.take_video_selector;
                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;
                content_description = main_activity.getPreview().isVideoRecording() ? R.string.stop_video : R.string.start_video;
                switch_video_content_description = R.string.switch_to_qrcode;
                switch_video_content_description = R.string.switch_to_qrcode;
            } else if (main_activity.getPreview().isQRCode()) {
            } else if (isQrMode) {
                if (MyDebug.LOG)
                if (MyDebug.LOG)
                    Log.d(TAG, "set icon to qrcode");
                    Log.d(TAG, "set icon to qrcode");
                resource = R.drawable.empty;
                resource = R.drawable.empty;
                content_description = 0;
                content_description = 0;
                switch_video_content_description = R.string.switch_to_photo;
                switch_video_content_description = R.string.switch_to_photo;
            } else if( main_activity.getApplicationInterface().getPhotoMode() == MyApplicationInterface.PhotoMode.Panorama &&
            } else if( panorama_recording ) {
                    main_activity.getApplicationInterface().getGyroSensor().isRecording() ) {
                if( MyDebug.LOG )
                if( MyDebug.LOG )
                    Log.d(TAG, "set icon to recording panorama");
                    Log.d(TAG, "set icon to recording panorama");
                resource = R.drawable.baseline_check_white_48;
                resource = R.drawable.baseline_check_white_48;
@@ -1111,7 +1114,7 @@ public class MainUI {
            view.setContentDescription( main_activity.getResources().getString(switch_video_content_description) );
            view.setContentDescription( main_activity.getResources().getString(switch_video_content_description) );
            if (main_activity.getPreview().isVideo()) {
            if (main_activity.getPreview().isVideo()) {
                resource = R.drawable.ic_switch_qrcode;
                resource = R.drawable.ic_switch_qrcode;
            } else if (main_activity.getPreview().isQRCode()) {
            } else if (isQrMode) {
                resource = R.drawable.ic_photo_camera_white_48dp;
                resource = R.drawable.ic_photo_camera_white_48dp;
            } else { // camera
            } else { // camera
                resource = R.drawable.ic_videocam_white_48dp;
                resource = R.drawable.ic_videocam_white_48dp;
@@ -1120,13 +1123,11 @@ public class MainUI {
            view.setTag(resource); // for testing
            view.setTag(resource); // for testing


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