Skip to content

Commit fa0836d

Browse files
MHShettythestinger
authored andcommitted
Workaround inconsistent behavior of default value of save image/video as previewed
1 parent c1b13b7 commit fa0836d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

app/src/main/java/app/grapheneos/camera/CamConfig.kt

+23
Original file line numberDiff line numberDiff line change
@@ -732,13 +732,36 @@ class CamConfig(private val mActivity: MainActivity) {
732732
editor.putBoolean(SettingValues.Key.CAMERA_SOUNDS, SettingValues.Default.CAMERA_SOUNDS)
733733
}
734734

735+
// Note: This is a workaround to keep save image/video as previewed 'on' by
736+
// default starting from v73 and 'off' by default for versions before that
737+
//
738+
// If its not a fresh install (before v73)
739+
if (commonPref.contains(SettingValues.Key.SAVE_IMAGE_AS_PREVIEW)) {
740+
// If save video as previewed was not previously set
741+
if (!commonPref.contains(SettingValues.Key.SAVE_VIDEO_AS_PREVIEW)) {
742+
// Explicitly set the value for this setting as false for them
743+
// to ensure consistent behavior
744+
editor.putBoolean(
745+
SettingValues.Key.SAVE_VIDEO_AS_PREVIEW,
746+
false
747+
)
748+
}
749+
}
750+
735751
if (!commonPref.contains(SettingValues.Key.SAVE_IMAGE_AS_PREVIEW)) {
736752
editor.putBoolean(
737753
SettingValues.Key.SAVE_IMAGE_AS_PREVIEW,
738754
SettingValues.Default.SAVE_IMAGE_AS_PREVIEW
739755
)
740756
}
741757

758+
if (!commonPref.contains(SettingValues.Key.SAVE_IMAGE_AS_PREVIEW)) {
759+
editor.putBoolean(
760+
SettingValues.Key.SAVE_VIDEO_AS_PREVIEW,
761+
SettingValues.Default.SAVE_VIDEO_AS_PREVIEW
762+
)
763+
}
764+
742765
if (!commonPref.contains(SettingValues.Key.GRID)) {
743766
// Index for Grid.values() Default: NONE
744767
editor.putInt(SettingValues.Key.GRID, SettingValues.Default.GRID_TYPE_INDEX)

0 commit comments

Comments
 (0)