From d4110f182e229a7c35541ef63952a491b923d003 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 26 Jan 2021 11:47:27 +0100 Subject: [PATCH] fix #2053, add back the setting for toggling photo brightness, disable by default --- .../pro/activities/SettingsActivity.kt | 9 ++++++++ .../gallery/pro/helpers/Config.kt | 2 +- app/src/main/res/layout/activity_settings.xml | 23 +++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt index 45279a23d..7c43dfb1d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt @@ -64,6 +64,7 @@ class SettingsActivity : SimpleActivity() { setupAppPasswordProtection() setupFileDeletionPasswordProtection() setupDeleteEmptyFolders() + setupAllowPhotoGestures() setupAllowDownGesture() setupAllowRotatingWithGestures() setupShowNotch() @@ -348,6 +349,14 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupAllowPhotoGestures() { + settings_allow_photo_gestures.isChecked = config.allowPhotoGestures + settings_allow_photo_gestures_holder.setOnClickListener { + settings_allow_photo_gestures.toggle() + config.allowPhotoGestures = settings_allow_photo_gestures.isChecked + } + } + private fun setupAllowDownGesture() { settings_allow_down_gesture.isChecked = config.allowDownGesture settings_allow_down_gesture_holder.setOnClickListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt index bc5e2f9a2..a47cd8f08 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Config.kt @@ -269,7 +269,7 @@ class Config(context: Context) : BaseConfig(context) { set(deleteEmptyFolders) = prefs.edit().putBoolean(DELETE_EMPTY_FOLDERS, deleteEmptyFolders).apply() var allowPhotoGestures: Boolean - get() = prefs.getBoolean(ALLOW_PHOTO_GESTURES, true) + get() = prefs.getBoolean(ALLOW_PHOTO_GESTURES, false) set(allowPhotoGestures) = prefs.edit().putBoolean(ALLOW_PHOTO_GESTURES, allowPhotoGestures).apply() var allowVideoGestures: Boolean diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index ae582dca5..8a05df610 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -555,6 +555,29 @@ + + + + + +