diff --git a/app/build.gradle b/app/build.gradle index f2e254506..fb3bc6b85 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -75,7 +75,7 @@ dependencies { implementation 'com.squareup.picasso:picasso:2.71828' implementation 'com.caverock:androidsvg-aar:1.3' implementation 'com.github.tibbi:gestureviews:bd0a8e67a1' - implementation 'com.github.tibbi:subsampling-scale-image-view:6c14987053' + implementation 'com.github.tibbi:subsampling-scale-image-view:fac1948e41' kapt 'com.github.bumptech.glide:compiler:4.8.0' // keep it here too, not just in Commons, else loading SVGs wont work kapt 'androidx.room:room-compiler:2.0.0' 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 74a08ee54..e6e2b07d3 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 @@ -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() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt index bb3c38d68..ea835b8e7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt @@ -459,6 +459,7 @@ class PhotoFragment : ViewPagerFragment() { regionDecoderFactory = regionDecoder maxScale = 10f beVisible() + rotationEnabled = config.allowRotatingWithGestures isOneToOneZoomEnabled = config.allowOneToOneZoom orientation = newOrientation setImage(path) 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 f715686b4..cfba026ae 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 @@ -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() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt index d3f5588a8..6a6591701 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt @@ -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" diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index bf10bce55..f26ac6ac0 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -694,6 +694,30 @@ + + + + + +