diff --git a/app/src/main/java/app/grapheneos/camera/CamConfig.kt b/app/src/main/java/app/grapheneos/camera/CamConfig.kt index 7cf74d3fe..f2a91c04c 100644 --- a/app/src/main/java/app/grapheneos/camera/CamConfig.kt +++ b/app/src/main/java/app/grapheneos/camera/CamConfig.kt @@ -138,9 +138,9 @@ class CamConfig(private val mActivity: MainActivity) { const val SCAN_ALL_CODES = false - const val SAVE_IMAGE_AS_PREVIEW = false + const val SAVE_IMAGE_AS_PREVIEW = true - const val SAVE_VIDEO_AS_PREVIEW = false + const val SAVE_VIDEO_AS_PREVIEW = true const val STORAGE_LOCATION = "" @@ -734,6 +734,22 @@ class CamConfig(private val mActivity: MainActivity) { editor.putBoolean(SettingValues.Key.CAMERA_SOUNDS, SettingValues.Default.CAMERA_SOUNDS) } + // Note: This is a workaround to keep save image/video as previewed 'on' by + // default starting from v73 and 'off' by default for versions before that + // + // If its not a fresh install (before v73) + if (commonPref.contains(SettingValues.Key.SAVE_IMAGE_AS_PREVIEW)) { + // If save video as previewed was not previously set + if (!commonPref.contains(SettingValues.Key.SAVE_VIDEO_AS_PREVIEW)) { + // Explicitly set the value for this setting as false for them + // to ensure consistent behavior + editor.putBoolean( + SettingValues.Key.SAVE_VIDEO_AS_PREVIEW, + false + ) + } + } + if (!commonPref.contains(SettingValues.Key.SAVE_IMAGE_AS_PREVIEW)) { editor.putBoolean( SettingValues.Key.SAVE_IMAGE_AS_PREVIEW, @@ -741,6 +757,13 @@ class CamConfig(private val mActivity: MainActivity) { ) } + if (!commonPref.contains(SettingValues.Key.SAVE_IMAGE_AS_PREVIEW)) { + editor.putBoolean( + SettingValues.Key.SAVE_VIDEO_AS_PREVIEW, + SettingValues.Default.SAVE_VIDEO_AS_PREVIEW + ) + } + if (!commonPref.contains(SettingValues.Key.GRID)) { // Index for Grid.values() Default: NONE editor.putInt(SettingValues.Key.GRID, SettingValues.Default.GRID_TYPE_INDEX)