diff options
author | LuK1337 <priv.luk@gmail.com> | 2023-04-10 13:06:05 +0200 |
---|---|---|
committer | LuK1337 <priv.luk@gmail.com> | 2023-04-10 13:06:05 +0200 |
commit | a5741ab03c27bfe93f00d9524296b1be6d22f81c (patch) | |
tree | 854eda24b9715c1e867305bf66188f1dc6f39cab | |
parent | 9829b6105a12cbeae9e70dd8011659865f967c34 (diff) |
Aperture: Add toggle for FFC horizontal flip
Change-Id: I88be24eb602fb60d13174ad626ad3ef06876097d
4 files changed, 21 insertions, 0 deletions
diff --git a/app/src/main/java/org/lineageos/aperture/CameraActivity.kt b/app/src/main/java/org/lineageos/aperture/CameraActivity.kt index 357a6db..21598d3 100644 --- a/app/src/main/java/org/lineageos/aperture/CameraActivity.kt +++ b/app/src/main/java/org/lineageos/aperture/CameraActivity.kt @@ -874,6 +874,9 @@ open class CameraActivity : AppCompatActivity() { if (!singleCaptureMode) { location = this@CameraActivity.location } + if (camera.cameraFacing == CameraFacing.FRONT) { + isReversedHorizontal = sharedPreferences.photoFfcMirror + } }, photoOutputStream ) diff --git a/app/src/main/java/org/lineageos/aperture/SharedPreferencesExt.kt b/app/src/main/java/org/lineageos/aperture/SharedPreferencesExt.kt index 37d2515..b8791a0 100644 --- a/app/src/main/java/org/lineageos/aperture/SharedPreferencesExt.kt +++ b/app/src/main/java/org/lineageos/aperture/SharedPreferencesExt.kt @@ -139,6 +139,15 @@ internal var SharedPreferences.photoCaptureMode: Int ) } +private const val PHOTO_FFC_MIRROR = "photo_ffc_mirror" +private const val PHOTO_FFC_MIRROR_DEFAULT = true + +internal var SharedPreferences.photoFfcMirror: Boolean + get() = getBoolean(PHOTO_FFC_MIRROR, PHOTO_FFC_MIRROR_DEFAULT) + set(value) = edit { + putBoolean(PHOTO_FFC_MIRROR, value) + } + private const val PHOTO_FLASH_MODE_KEY = "photo_flash_mode" private const val PHOTO_FLASH_MODE_DEFAULT = "auto" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 52a2197..7e4ad4c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -99,6 +99,8 @@ <string name="photo_capture_mode_maximize_quality">Maximize quality</string> <string name="photo_capture_mode_minimize_latency">Minimize latency</string> <string name="photo_capture_mode_zsl">Zero shutter lag (experimental)</string> + <string name="photo_ffc_mirror_title">Mirror front camera</string> + <string name="photo_ffc_mirror_summary">Save front camera photos as they appear in the preview</string> <!-- Video Preferences --> <string name="video_stabilization_title">Enable video stabilization</string> diff --git a/app/src/main/res/xml/root_preferences.xml b/app/src/main/res/xml/root_preferences.xml index 8edce91..b71d2e1 100644 --- a/app/src/main/res/xml/root_preferences.xml +++ b/app/src/main/res/xml/root_preferences.xml @@ -52,6 +52,13 @@ app:title="@string/photo_capture_mode_title" app:useSimpleSummaryProvider="true" /> + <SwitchPreference + app:defaultValue="true" + app:iconSpaceReserved="false" + app:key="photo_ffc_mirror" + app:summary="@string/photo_ffc_mirror_summary" + app:title="@string/photo_ffc_mirror_title" /> + </PreferenceCategory> <PreferenceCategory |