mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
fix #1266, allow disabling rotating with gestures
This commit is contained in:
@ -61,6 +61,7 @@ class SettingsActivity : SimpleActivity() {
|
||||
setupAllowPhotoGestures()
|
||||
setupAllowVideoGestures()
|
||||
setupAllowDownGesture()
|
||||
setupAllowRotatingWithGestures()
|
||||
setupShowNotch()
|
||||
setupBottomActions()
|
||||
setupThumbnailVideoDuration()
|
||||
@ -349,6 +350,14 @@ class SettingsActivity : SimpleActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupAllowRotatingWithGestures() {
|
||||
settings_allow_rotating_with_gestures.isChecked = config.allowRotatingWithGestures
|
||||
settings_allow_rotating_with_gestures_holder.setOnClickListener {
|
||||
settings_allow_rotating_with_gestures.toggle()
|
||||
config.allowRotatingWithGestures = settings_allow_rotating_with_gestures.isChecked
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupShowNotch() {
|
||||
settings_show_notch_holder.beVisibleIf(isPiePlus())
|
||||
settings_show_notch.isChecked = config.showNotch
|
||||
@ -600,6 +609,7 @@ class SettingsActivity : SimpleActivity() {
|
||||
put(ALLOW_INSTANT_CHANGE, config.allowInstantChange)
|
||||
put(ALLOW_PHOTO_GESTURES, config.allowPhotoGestures)
|
||||
put(ALLOW_DOWN_GESTURE, config.allowDownGesture)
|
||||
put(ALLOW_ROTATING_WITH_GESTURES, config.allowRotatingWithGestures)
|
||||
put(SHOW_NOTCH, config.showNotch)
|
||||
put(SCREEN_ROTATION, config.screenRotation)
|
||||
put(ALLOW_ZOOMING_IMAGES, config.allowZoomingImages)
|
||||
@ -720,6 +730,7 @@ class SettingsActivity : SimpleActivity() {
|
||||
ALLOW_INSTANT_CHANGE -> config.allowInstantChange = value.toBoolean()
|
||||
ALLOW_PHOTO_GESTURES -> config.allowPhotoGestures = value.toBoolean()
|
||||
ALLOW_DOWN_GESTURE -> config.allowDownGesture = value.toBoolean()
|
||||
ALLOW_ROTATING_WITH_GESTURES -> config.allowRotatingWithGestures = value.toBoolean()
|
||||
SHOW_NOTCH -> config.showNotch = value.toBoolean()
|
||||
SCREEN_ROTATION -> config.screenRotation = value.toInt()
|
||||
ALLOW_ZOOMING_IMAGES -> config.allowZoomingImages = value.toBoolean()
|
||||
|
@ -459,6 +459,7 @@ class PhotoFragment : ViewPagerFragment() {
|
||||
regionDecoderFactory = regionDecoder
|
||||
maxScale = 10f
|
||||
beVisible()
|
||||
rotationEnabled = config.allowRotatingWithGestures
|
||||
isOneToOneZoomEnabled = config.allowOneToOneZoom
|
||||
orientation = newOrientation
|
||||
setImage(path)
|
||||
|
@ -456,6 +456,10 @@ class Config(context: Context) : BaseConfig(context) {
|
||||
get() = prefs.getBoolean(ALLOW_ONE_TO_ONE_ZOOM, false)
|
||||
set(allowOneToOneZoom) = prefs.edit().putBoolean(ALLOW_ONE_TO_ONE_ZOOM, allowOneToOneZoom).apply()
|
||||
|
||||
var allowRotatingWithGestures: Boolean
|
||||
get() = prefs.getBoolean(ALLOW_ROTATING_WITH_GESTURES, true)
|
||||
set(allowRotatingWithGestures) = prefs.edit().putBoolean(ALLOW_ROTATING_WITH_GESTURES, allowRotatingWithGestures).apply()
|
||||
|
||||
var lastEditorDrawColor: Int
|
||||
get() = prefs.getInt(LAST_EDITOR_DRAW_COLOR, primaryColor)
|
||||
set(lastEditorDrawColor) = prefs.edit().putInt(LAST_EDITOR_DRAW_COLOR, lastEditorDrawColor).apply()
|
||||
|
@ -75,6 +75,7 @@ const val LAST_EDITOR_CROP_OTHER_ASPECT_RATIO_Y = "last_editor_crop_other_aspect
|
||||
const val GROUP_DIRECT_SUBFOLDERS = "group_direct_subfolders"
|
||||
const val SHOW_WIDGET_FOLDER_NAME = "show_widget_folder_name"
|
||||
const val ALLOW_ONE_TO_ONE_ZOOM = "allow_one_to_one_zoom"
|
||||
const val ALLOW_ROTATING_WITH_GESTURES = "allow_rotating_with_gestures"
|
||||
const val LAST_EDITOR_DRAW_COLOR = "last_editor_draw_color"
|
||||
const val LAST_EDITOR_BRUSH_SIZE = "last_editor_brush_size"
|
||||
const val SHOW_NOTCH = "show_notch"
|
||||
|
Reference in New Issue
Block a user