From d203c1fced74650835ea4fe32a087545b4bb299f Mon Sep 17 00:00:00 2001 From: gmasil <54176035+gmasil@users.noreply.github.com> Date: Fri, 22 Sep 2023 17:11:47 +0200 Subject: [PATCH] move option animate gifs to main settings --- .../gallery/pro/activities/SettingsActivity.kt | 9 +++++++++ .../dialogs/ChangeFileThumbnailStyleDialog.kt | 3 --- app/src/main/res/layout/activity_settings.xml | 15 +++++++++++++++ .../dialog_change_file_thumbnail_style.xml | 16 ---------------- 4 files changed, 24 insertions(+), 19 deletions(-) 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 bce00c216..ead9601c3 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 @@ -66,6 +66,7 @@ class SettingsActivity : SimpleActivity() { setupOpenVideosOnSeparateScreen() setupMaxBrightness() setupCropThumbnails() + setupAnimateGifs() setupDarkBackground() setupScrollHorizontally() setupScreenRotation() @@ -310,6 +311,14 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupAnimateGifs() { + binding.settingsAnimateGifs.isChecked = config.animateGifs + binding.settingsAnimateGifsHolder.setOnClickListener { + binding.settingsAnimateGifs.toggle() + config.animateGifs = binding.settingsAnimateGifs.isChecked + } + } + private fun setupDarkBackground() { binding.settingsBlackBackground.isChecked = config.blackBackground binding.settingsBlackBackgroundHolder.setOnClickListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeFileThumbnailStyleDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeFileThumbnailStyleDialog.kt index 2070f406d..0429f05e1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeFileThumbnailStyleDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeFileThumbnailStyleDialog.kt @@ -17,13 +17,11 @@ class ChangeFileThumbnailStyleDialog(val activity: BaseSimpleActivity) : DialogI init { binding = DialogChangeFileThumbnailStyleBinding.inflate(activity.layoutInflater).apply { dialogFileStyleRoundedCorners.isChecked = config.fileRoundedCorners - dialogFileStyleAnimateGifs.isChecked = config.animateGifs dialogFileStyleShowThumbnailVideoDuration.isChecked = config.showThumbnailVideoDuration dialogFileStyleShowThumbnailFileTypes.isChecked = config.showThumbnailFileTypes dialogFileStyleMarkFavoriteItems.isChecked = config.markFavoriteItems dialogFileStyleRoundedCornersHolder.setOnClickListener { dialogFileStyleRoundedCorners.toggle() } - dialogFileStyleAnimateGifsHolder.setOnClickListener { dialogFileStyleAnimateGifs.toggle() } dialogFileStyleShowThumbnailVideoDurationHolder.setOnClickListener { dialogFileStyleShowThumbnailVideoDuration.toggle() } dialogFileStyleShowThumbnailFileTypesHolder.setOnClickListener { dialogFileStyleShowThumbnailFileTypes.toggle() } dialogFileStyleMarkFavoriteItemsHolder.setOnClickListener { dialogFileStyleMarkFavoriteItems.toggle() } @@ -59,7 +57,6 @@ class ChangeFileThumbnailStyleDialog(val activity: BaseSimpleActivity) : DialogI override fun onClick(dialog: DialogInterface, which: Int) { config.fileRoundedCorners = binding.dialogFileStyleRoundedCorners.isChecked - config.animateGifs = binding.dialogFileStyleAnimateGifs.isChecked config.showThumbnailVideoDuration = binding.dialogFileStyleShowThumbnailVideoDuration.isChecked config.showThumbnailFileTypes = binding.dialogFileStyleShowThumbnailFileTypes.isChecked config.markFavoriteItems = binding.dialogFileStyleMarkFavoriteItems.isChecked diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index bf1afdddc..08d5f7b3d 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -326,6 +326,21 @@ + + + + + + - - - - - -