From 75d9e039818585ee481d59d77267c14ff651d665 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 20 Aug 2018 20:24:39 +0200 Subject: [PATCH] enable SVG showing for people who upgrade the app --- .../simplemobiletools/gallery/activities/MainActivity.kt | 7 +++++++ .../kotlin/com/simplemobiletools/gallery/helpers/Config.kt | 4 ++++ .../com/simplemobiletools/gallery/helpers/Constants.kt | 1 + 3 files changed, 12 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 825a396fa..6ed9d73dc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -133,6 +133,13 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { config.saveFolderGrouping(SHOW_ALL, GROUP_BY_DATE_TAKEN or GROUP_DESCENDING) } + if (!config.wasSVGShowingHandled) { + config.wasSVGShowingHandled = true + if (config.filterMedia and TYPE_SVGS == 0) { + config.filterMedia += TYPE_SVGS + } + } + checkRecycleBinItems() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index ffee3cab3..9916efcee 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -346,6 +346,10 @@ class Config(context: Context) : BaseConfig(context) { get() = prefs.getBoolean(WAS_RECYCLE_BIN_PINNED, false) set(wasRecycleBinPinned) = prefs.edit().putBoolean(WAS_RECYCLE_BIN_PINNED, wasRecycleBinPinned).apply() + var wasSVGShowingHandled: Boolean + get() = prefs.getBoolean(WAS_SVG_SHOWING_HANDLED, false) + set(wasSVGShowingHandled) = prefs.edit().putBoolean(WAS_SVG_SHOWING_HANDLED, wasSVGShowingHandled).apply() + var groupBy: Int get() = prefs.getInt(GROUP_BY, GROUP_BY_NONE) set(groupBy) = prefs.edit().putInt(GROUP_BY, groupBy).apply() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index c7a3eb776..3fecd735f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -59,6 +59,7 @@ const val GROUP_BY = "group_by" const val EVER_SHOWN_FOLDERS = "ever_shown_folders" const val SHOW_RECYCLE_BIN_AT_FOLDERS = "show_recycle_bin_at_folders" const val ALLOW_ZOOMING_IMAGES = "allow_zooming_images" +const val WAS_SVG_SHOWING_HANDLED = "was_svg_showing_handled" // slideshow const val SLIDESHOW_INTERVAL = "slideshow_interval"