From a5faf7a0a5dc7e8ea543061abe4e196e8fb1c991 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 23 Mar 2017 20:32:52 +0100 Subject: [PATCH] add a settings checkbox for cropping thumbnails --- .../gallery/activities/SettingsActivity.kt | 25 +++++++++++++------ app/src/main/res/layout/activity_settings.xml | 20 +++++++++++++++ 2 files changed, 37 insertions(+), 8 deletions(-) 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 6aeb9cc4a..4dc8bd47a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/SettingsActivity.kt @@ -33,6 +33,7 @@ class SettingsActivity : SimpleActivity() { setupLoopVideos() setupAnimateGifs() setupMaxBrightness() + setupCropThumbnails() setupShowMedia() updateTextColors(settings_holder) } @@ -87,6 +88,22 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupMaxBrightness() { + settings_max_brightness.isChecked = config.maxBrightness + settings_max_brightness_holder.setOnClickListener { + settings_max_brightness.toggle() + config.maxBrightness = settings_max_brightness.isChecked + } + } + + private fun setupCropThumbnails() { + settings_crop_thumbnails.isChecked = config.cropThumbnails + settings_crop_thumbnails_holder.setOnClickListener { + settings_crop_thumbnails.toggle() + config.cropThumbnails = settings_crop_thumbnails.isChecked + } + } + private fun setupShowMedia() { settings_show_media.text = getShowMediaText() settings_show_media_holder.setOnClickListener { @@ -102,14 +119,6 @@ class SettingsActivity : SimpleActivity() { } } - private fun setupMaxBrightness() { - settings_max_brightness.isChecked = config.maxBrightness - settings_max_brightness_holder.setOnClickListener { - settings_max_brightness.toggle() - config.maxBrightness = settings_max_brightness.isChecked - } - } - private fun getShowMediaText() = getString(when (config.showMedia) { IMAGES_AND_VIDEOS -> R.string.images_and_videos IMAGES -> R.string.images diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 513f393d5..1e6033fd8 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -168,6 +168,26 @@ + + + + + +