From 97554c36edf0ae5246c9a715f12dbc5da14c8ae3 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 1 Mar 2017 22:33:49 +0100 Subject: [PATCH] add an extra check to avoid displaying hidden folders if shouldnt --- .../gallery/asynctasks/GetDirectoriesAsynctask.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index 04188f1fe..c2d883404 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -71,6 +71,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va private fun groupDirectories(media: ArrayList): Map { val hidden = context.resources.getString(R.string.hidden) val directories = LinkedHashMap() + val showHidden = config.showHiddenFolders for ((name, path, isVideo, dateModified, dateTaken, size) in media) { if (shouldStop) cancel(true) @@ -91,6 +92,9 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va if (File(parentDir).containsNoMedia()) { dirName += " $hidden" + + if (!showHidden) + continue } val directory = Directory(parentDir, path, dirName, 1, dateModified, dateTaken, size)