From dda66bf127f752063721afe1b291a799fd254539 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 23 Mar 2017 21:02:32 +0100 Subject: [PATCH] add a settings toggle for autorotating the screen --- .../gallery/activities/SettingsActivity.kt | 9 +++++++++ app/src/main/res/layout/activity_settings.xml | 20 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt index 4dc8bd47a..82cc82658 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -34,6 +34,7 @@ class SettingsActivity : SimpleActivity() { setupAnimateGifs() setupMaxBrightness() setupCropThumbnails() + setupAutoRotateScreen() setupShowMedia() updateTextColors(settings_holder) } @@ -104,6 +105,14 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupAutoRotateScreen() { + settings_auto_rotate_screen.isChecked = config.autoRotateScreen + settings_auto_rotate_screen_holder.setOnClickListener { + settings_auto_rotate_screen.toggle() + config.autoRotateScreen = settings_auto_rotate_screen.isChecked + } + } + private fun setupShowMedia() { settings_show_media.text = getShowMediaText() settings_show_media_holder.setOnClickListener { diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 1e6033fd8..99b371696 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -188,6 +188,26 @@ + + + + + +