From e3f0d7ea56b28becd3cf784d464555a905b341ff Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 28 May 2017 23:09:00 +0200 Subject: [PATCH] do not cache media while temporarily showing hidden is enabled --- .../simplemobiletools/gallery/activities/MainActivity.kt | 6 ++++-- .../simplemobiletools/gallery/activities/MediaActivity.kt | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) 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 907b3883b..e2c9649b9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -342,8 +342,10 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } private fun storeDirectories() { - val directories = Gson().toJson(mDirs) - config.directories = directories + if (!config.temporarilyShowHidden) { + val directories = Gson().toJson(mDirs) + config.directories = directories + } } private fun setupAdapter() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 3c9fab44c..f3b861a9b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -399,9 +399,11 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { } private fun storeFolder() { - val subList = mMedia.subList(0, Math.min(SAVE_MEDIA_CNT, mMedia.size)) - val json = Gson().toJson(subList) - config.saveFolderMedia(mPath, json) + if (!config.temporarilyShowHidden) { + val subList = mMedia.subList(0, Math.min(SAVE_MEDIA_CNT, mMedia.size)) + val json = Gson().toJson(subList) + config.saveFolderMedia(mPath, json) + } } override fun deleteFiles(files: ArrayList) {