fix #2053, add back the setting for toggling photo brightness, disable by default

This commit is contained in:
tibbi 2021-01-26 11:47:27 +01:00
parent 91a2ef72a7
commit d4110f182e
3 changed files with 33 additions and 1 deletions

View File

@ -64,6 +64,7 @@ class SettingsActivity : SimpleActivity() {
setupAppPasswordProtection() setupAppPasswordProtection()
setupFileDeletionPasswordProtection() setupFileDeletionPasswordProtection()
setupDeleteEmptyFolders() setupDeleteEmptyFolders()
setupAllowPhotoGestures()
setupAllowDownGesture() setupAllowDownGesture()
setupAllowRotatingWithGestures() setupAllowRotatingWithGestures()
setupShowNotch() 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() { private fun setupAllowDownGesture() {
settings_allow_down_gesture.isChecked = config.allowDownGesture settings_allow_down_gesture.isChecked = config.allowDownGesture
settings_allow_down_gesture_holder.setOnClickListener { settings_allow_down_gesture_holder.setOnClickListener {

View File

@ -269,7 +269,7 @@ class Config(context: Context) : BaseConfig(context) {
set(deleteEmptyFolders) = prefs.edit().putBoolean(DELETE_EMPTY_FOLDERS, deleteEmptyFolders).apply() set(deleteEmptyFolders) = prefs.edit().putBoolean(DELETE_EMPTY_FOLDERS, deleteEmptyFolders).apply()
var allowPhotoGestures: Boolean 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() set(allowPhotoGestures) = prefs.edit().putBoolean(ALLOW_PHOTO_GESTURES, allowPhotoGestures).apply()
var allowVideoGestures: Boolean var allowVideoGestures: Boolean

View File

@ -555,6 +555,29 @@
</RelativeLayout> </RelativeLayout>
<RelativeLayout
android:id="@+id/settings_allow_photo_gestures_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingStart="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/normal_margin"
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_allow_photo_gestures"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingStart="@dimen/medium_margin"
android:text="@string/allow_photo_gestures"
app:switchPadding="@dimen/medium_margin" />
</RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/settings_allow_down_gesture_holder" android:id="@+id/settings_allow_down_gesture_holder"
android:layout_width="match_parent" android:layout_width="match_parent"