Loading app/src/main/java/net/sourceforge/opencamera/MainActivity.java +10 −1 Original line number Diff line number Diff line Loading @@ -473,6 +473,8 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen takePhotoVideoButton.setVisibility(View.GONE); View cancelPanoramaButton = findViewById(R.id.cancel_panorama); cancelPanoramaButton.setVisibility(View.GONE); View finishPanoramaButton = findViewById(R.id.finish_panorama); finishPanoramaButton.setVisibility(View.GONE); // We initialise optional controls to invisible/gone, so they don't show while the camera is opening - the actual visibility is // set in cameraSetup(). Loading Loading @@ -2037,6 +2039,13 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen applicationInterface.stopPanorama(true); } public void clickedFinishPanorama(View view) { if (MyDebug.LOG) { Log.d(TAG, "clickedFinishPanorama"); } this.takePicture(false); } public void clickedCycleRaw(View view) { if( MyDebug.LOG ) Log.d(TAG, "clickedCycleRaw"); Loading app/src/main/java/net/sourceforge/opencamera/MyApplicationInterface.java +2 −6 Original line number Diff line number Diff line Loading @@ -1889,9 +1889,7 @@ public class MyApplicationInterface extends BasicApplicationInterface { panorama_pic_accepted = false; panorama_dir_left_to_right = true; main_activity.getMainUI().setTakePhotoIcon(); View cancelPanoramaButton = main_activity.findViewById(R.id.cancel_panorama); cancelPanoramaButton.setVisibility(View.VISIBLE); main_activity.getMainUI().handlePanoromaModeButtonsVisibility(); main_activity.getMainUI().closeExposureUI(); // close seekbars if open (popup is already closed when taking a photo) // taking the photo will end up calling MainUI.showGUI(), which will hide the other on-screen icons } Loading Loading @@ -1927,9 +1925,7 @@ public class MyApplicationInterface extends BasicApplicationInterface { if( is_cancelled ) { imageSaver.flushImageBatch(); } main_activity.getMainUI().setTakePhotoIcon(); View cancelPanoramaButton = main_activity.findViewById(R.id.cancel_panorama); cancelPanoramaButton.setVisibility(View.GONE); main_activity.getMainUI().handlePanoromaModeButtonsVisibility(); main_activity.getMainUI().showGUI(); // refresh UI icons now that we've stopped panorama } Loading app/src/main/java/net/sourceforge/opencamera/ui/MainUI.java +38 −9 Original line number Diff line number Diff line Loading @@ -595,6 +595,9 @@ public class MainUI { view = main_activity.findViewById(R.id.cancel_panorama); setViewRotation(view, ui_rotation); view = main_activity.findViewById(R.id.finish_panorama); setViewRotation(view, ui_rotation); view = main_activity.findViewById(R.id.switch_video); setViewRotation(view, ui_rotation); Loading Loading @@ -977,14 +980,6 @@ public class MainUI { content_description = main_activity.getPreview().isVideoRecording() ? R.string.stop_video : R.string.start_video; switch_video_content_description = R.string.switch_to_photo; } else if( main_activity.getApplicationInterface().getPhotoMode() == MyApplicationInterface.PhotoMode.Panorama && main_activity.getApplicationInterface().getGyroSensor().isRecording() ) { if( MyDebug.LOG ) Log.d(TAG, "set icon to recording panorama"); resource = R.drawable.ic_done; content_description = R.string.finish_panorama; switch_video_content_description = R.string.switch_to_video; } else { if( MyDebug.LOG ) Log.d(TAG, "set icon to photo"); Loading @@ -1004,6 +999,33 @@ public class MainUI { } } /** * Show/hide photoShutter, panorama cancel & finish buttons on photoMode. * If user save not to show photoShutter button, don't show photoShutter & panorama finish buttons. * If user wants to view the shutter button, update the shutterButton's icon to the appropriate one. */ public void handlePanoromaModeButtonsVisibility() { boolean isPanoramaRunning = (main_activity.getApplicationInterface().getPhotoMode() == MyApplicationInterface.PhotoMode.Panorama && main_activity.getApplicationInterface().getGyroSensor().isRecording()); View view = main_activity.findViewById(R.id.cancel_panorama); view.setVisibility(isPanoramaRunning ? View.VISIBLE : View.GONE); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(main_activity); if (!sharedPreferences.getBoolean(PreferenceKeys.ShowTakePhotoPreferenceKey, true)) { return; } view = main_activity.findViewById(R.id.finish_panorama); view.setVisibility(isPanoramaRunning ? View.VISIBLE : View.GONE); view = main_activity.findViewById(R.id.take_photo); view.setVisibility(isPanoramaRunning ? View.INVISIBLE : View.VISIBLE); if (!isPanoramaRunning) { setTakePhotoIcon(); } } /** Set content description for switch camera button. */ public void setSwitchCameraContentDescription() { Loading Loading @@ -1291,7 +1313,9 @@ public class MainUI { focusBracketingTargetSeekBar.setVisibility(visibility); String pref_immersive_mode = sharedPreferences.getString(PreferenceKeys.ImmersiveModePreferenceKey, "immersive_mode_low_profile"); if( pref_immersive_mode.equals("immersive_mode_everything") ) { if( sharedPreferences.getBoolean(PreferenceKeys.ShowTakePhotoPreferenceKey, true) ) { final boolean showTakePhotoPreferenceKey = sharedPreferences.getBoolean(PreferenceKeys.ShowTakePhotoPreferenceKey, true); if (showTakePhotoPreferenceKey) { View takePhotoButton = main_activity.findViewById(R.id.take_photo); takePhotoButton.setVisibility(visibility); } Loading @@ -1306,6 +1330,11 @@ public class MainUI { if( main_activity.getApplicationInterface().getGyroSensor().isRecording() ) { View cancelPanoramaButton = main_activity.findViewById(R.id.cancel_panorama); cancelPanoramaButton.setVisibility(visibility); if (showTakePhotoPreferenceKey) { View finishPanoramaButton = main_activity.findViewById(R.id.finish_panorama); finishPanoramaButton.setVisibility(visibility); } } } if( !immersive_mode ) { Loading app/src/main/res/layout/activity_main.xml +34 −5 Original line number Diff line number Diff line Loading @@ -28,7 +28,21 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" android:clickable="false" android:focusable="false"/> android:focusable="false" android:visibility="invisible"/> <View android:id="@+id/place_holder_center_view" android:layout_width="1dp" android:layout_height="1dp" android:background="@android:color/transparent" android:clickable="false" android:focusable="false" android:visibility="invisible" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" /> <ImageButton android:id="@+id/take_photo" Loading Loading @@ -87,12 +101,12 @@ <ImageButton android:id="@+id/cancel_panorama" android:layout_width="@dimen/onscreen_bottom_button_size" android:layout_height="@dimen/onscreen_bottom_button_size" app:layout_constraintTop_toBottomOf="@id/gallery" app:layout_constraintBottom_toTopOf="@id/take_photo" android:layout_width="@dimen/onscreen_bottom_panorama_button_size" android:layout_height="@dimen/onscreen_bottom_panorama_button_size" app:layout_constraintBottom_toTopOf="@id/place_holder_center_view" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" android:layout_marginBottom="13dp" android:background="@null" android:contentDescription="@string/cancel_panorama" android:onClick="clickedCancelPanorama" Loading @@ -100,6 +114,21 @@ android:src="@drawable/ic_cancel" android:visibility="gone" /> <ImageButton android:id="@+id/finish_panorama" android:layout_width="@dimen/onscreen_bottom_panorama_button_size" android:layout_height="@dimen/onscreen_bottom_panorama_button_size" app:layout_constraintTop_toBottomOf="@id/place_holder_center_view" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" android:layout_marginTop="13dp" android:background="@null" android:contentDescription="@string/finish_panorama" android:onClick="clickedFinishPanorama" android:scaleType="fitCenter" android:src="@drawable/ic_done" android:visibility="gone" /> <ImageButton android:id="@+id/switch_video" android:layout_width="@dimen/onscreen_bottom_button_size" Loading app/src/main/res/values/dimens.xml +1 −0 Original line number Diff line number Diff line Loading @@ -10,5 +10,6 @@ <dimen name="onscreen_button_padding">0dp</dimen> <dimen name="shutter_button_size">70dp</dimen> <dimen name="onscreen_bottom_button_size">36dp</dimen> <dimen name="onscreen_bottom_panorama_button_size">48dp</dimen> <dimen name="zoom_seekbar_hw_diff">195dp</dimen> </resources> Loading
app/src/main/java/net/sourceforge/opencamera/MainActivity.java +10 −1 Original line number Diff line number Diff line Loading @@ -473,6 +473,8 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen takePhotoVideoButton.setVisibility(View.GONE); View cancelPanoramaButton = findViewById(R.id.cancel_panorama); cancelPanoramaButton.setVisibility(View.GONE); View finishPanoramaButton = findViewById(R.id.finish_panorama); finishPanoramaButton.setVisibility(View.GONE); // We initialise optional controls to invisible/gone, so they don't show while the camera is opening - the actual visibility is // set in cameraSetup(). Loading Loading @@ -2037,6 +2039,13 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen applicationInterface.stopPanorama(true); } public void clickedFinishPanorama(View view) { if (MyDebug.LOG) { Log.d(TAG, "clickedFinishPanorama"); } this.takePicture(false); } public void clickedCycleRaw(View view) { if( MyDebug.LOG ) Log.d(TAG, "clickedCycleRaw"); Loading
app/src/main/java/net/sourceforge/opencamera/MyApplicationInterface.java +2 −6 Original line number Diff line number Diff line Loading @@ -1889,9 +1889,7 @@ public class MyApplicationInterface extends BasicApplicationInterface { panorama_pic_accepted = false; panorama_dir_left_to_right = true; main_activity.getMainUI().setTakePhotoIcon(); View cancelPanoramaButton = main_activity.findViewById(R.id.cancel_panorama); cancelPanoramaButton.setVisibility(View.VISIBLE); main_activity.getMainUI().handlePanoromaModeButtonsVisibility(); main_activity.getMainUI().closeExposureUI(); // close seekbars if open (popup is already closed when taking a photo) // taking the photo will end up calling MainUI.showGUI(), which will hide the other on-screen icons } Loading Loading @@ -1927,9 +1925,7 @@ public class MyApplicationInterface extends BasicApplicationInterface { if( is_cancelled ) { imageSaver.flushImageBatch(); } main_activity.getMainUI().setTakePhotoIcon(); View cancelPanoramaButton = main_activity.findViewById(R.id.cancel_panorama); cancelPanoramaButton.setVisibility(View.GONE); main_activity.getMainUI().handlePanoromaModeButtonsVisibility(); main_activity.getMainUI().showGUI(); // refresh UI icons now that we've stopped panorama } Loading
app/src/main/java/net/sourceforge/opencamera/ui/MainUI.java +38 −9 Original line number Diff line number Diff line Loading @@ -595,6 +595,9 @@ public class MainUI { view = main_activity.findViewById(R.id.cancel_panorama); setViewRotation(view, ui_rotation); view = main_activity.findViewById(R.id.finish_panorama); setViewRotation(view, ui_rotation); view = main_activity.findViewById(R.id.switch_video); setViewRotation(view, ui_rotation); Loading Loading @@ -977,14 +980,6 @@ public class MainUI { content_description = main_activity.getPreview().isVideoRecording() ? R.string.stop_video : R.string.start_video; switch_video_content_description = R.string.switch_to_photo; } else if( main_activity.getApplicationInterface().getPhotoMode() == MyApplicationInterface.PhotoMode.Panorama && main_activity.getApplicationInterface().getGyroSensor().isRecording() ) { if( MyDebug.LOG ) Log.d(TAG, "set icon to recording panorama"); resource = R.drawable.ic_done; content_description = R.string.finish_panorama; switch_video_content_description = R.string.switch_to_video; } else { if( MyDebug.LOG ) Log.d(TAG, "set icon to photo"); Loading @@ -1004,6 +999,33 @@ public class MainUI { } } /** * Show/hide photoShutter, panorama cancel & finish buttons on photoMode. * If user save not to show photoShutter button, don't show photoShutter & panorama finish buttons. * If user wants to view the shutter button, update the shutterButton's icon to the appropriate one. */ public void handlePanoromaModeButtonsVisibility() { boolean isPanoramaRunning = (main_activity.getApplicationInterface().getPhotoMode() == MyApplicationInterface.PhotoMode.Panorama && main_activity.getApplicationInterface().getGyroSensor().isRecording()); View view = main_activity.findViewById(R.id.cancel_panorama); view.setVisibility(isPanoramaRunning ? View.VISIBLE : View.GONE); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(main_activity); if (!sharedPreferences.getBoolean(PreferenceKeys.ShowTakePhotoPreferenceKey, true)) { return; } view = main_activity.findViewById(R.id.finish_panorama); view.setVisibility(isPanoramaRunning ? View.VISIBLE : View.GONE); view = main_activity.findViewById(R.id.take_photo); view.setVisibility(isPanoramaRunning ? View.INVISIBLE : View.VISIBLE); if (!isPanoramaRunning) { setTakePhotoIcon(); } } /** Set content description for switch camera button. */ public void setSwitchCameraContentDescription() { Loading Loading @@ -1291,7 +1313,9 @@ public class MainUI { focusBracketingTargetSeekBar.setVisibility(visibility); String pref_immersive_mode = sharedPreferences.getString(PreferenceKeys.ImmersiveModePreferenceKey, "immersive_mode_low_profile"); if( pref_immersive_mode.equals("immersive_mode_everything") ) { if( sharedPreferences.getBoolean(PreferenceKeys.ShowTakePhotoPreferenceKey, true) ) { final boolean showTakePhotoPreferenceKey = sharedPreferences.getBoolean(PreferenceKeys.ShowTakePhotoPreferenceKey, true); if (showTakePhotoPreferenceKey) { View takePhotoButton = main_activity.findViewById(R.id.take_photo); takePhotoButton.setVisibility(visibility); } Loading @@ -1306,6 +1330,11 @@ public class MainUI { if( main_activity.getApplicationInterface().getGyroSensor().isRecording() ) { View cancelPanoramaButton = main_activity.findViewById(R.id.cancel_panorama); cancelPanoramaButton.setVisibility(visibility); if (showTakePhotoPreferenceKey) { View finishPanoramaButton = main_activity.findViewById(R.id.finish_panorama); finishPanoramaButton.setVisibility(visibility); } } } if( !immersive_mode ) { Loading
app/src/main/res/layout/activity_main.xml +34 −5 Original line number Diff line number Diff line Loading @@ -28,7 +28,21 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" android:clickable="false" android:focusable="false"/> android:focusable="false" android:visibility="invisible"/> <View android:id="@+id/place_holder_center_view" android:layout_width="1dp" android:layout_height="1dp" android:background="@android:color/transparent" android:clickable="false" android:focusable="false" android:visibility="invisible" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" /> <ImageButton android:id="@+id/take_photo" Loading Loading @@ -87,12 +101,12 @@ <ImageButton android:id="@+id/cancel_panorama" android:layout_width="@dimen/onscreen_bottom_button_size" android:layout_height="@dimen/onscreen_bottom_button_size" app:layout_constraintTop_toBottomOf="@id/gallery" app:layout_constraintBottom_toTopOf="@id/take_photo" android:layout_width="@dimen/onscreen_bottom_panorama_button_size" android:layout_height="@dimen/onscreen_bottom_panorama_button_size" app:layout_constraintBottom_toTopOf="@id/place_holder_center_view" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" android:layout_marginBottom="13dp" android:background="@null" android:contentDescription="@string/cancel_panorama" android:onClick="clickedCancelPanorama" Loading @@ -100,6 +114,21 @@ android:src="@drawable/ic_cancel" android:visibility="gone" /> <ImageButton android:id="@+id/finish_panorama" android:layout_width="@dimen/onscreen_bottom_panorama_button_size" android:layout_height="@dimen/onscreen_bottom_panorama_button_size" app:layout_constraintTop_toBottomOf="@id/place_holder_center_view" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" android:layout_marginTop="13dp" android:background="@null" android:contentDescription="@string/finish_panorama" android:onClick="clickedFinishPanorama" android:scaleType="fitCenter" android:src="@drawable/ic_done" android:visibility="gone" /> <ImageButton android:id="@+id/switch_video" android:layout_width="@dimen/onscreen_bottom_button_size" Loading
app/src/main/res/values/dimens.xml +1 −0 Original line number Diff line number Diff line Loading @@ -10,5 +10,6 @@ <dimen name="onscreen_button_padding">0dp</dimen> <dimen name="shutter_button_size">70dp</dimen> <dimen name="onscreen_bottom_button_size">36dp</dimen> <dimen name="onscreen_bottom_panorama_button_size">48dp</dimen> <dimen name="zoom_seekbar_hw_diff">195dp</dimen> </resources>