From 527fda18f94037791a13ba453c9950d08541e520 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 26 May 2018 17:04:34 +0200 Subject: [PATCH] make sure hidden folders have "(hidden)" appended --- .../com/simplemobiletools/gallery/extensions/Context.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt index d8b9f702a..9ed2214b5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt @@ -293,6 +293,15 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly: } }) as ArrayList + val hiddenString = resources.getString(R.string.hidden) + filteredDirectories.forEach { + it.name = if (File(it.path).doesThisOrParentHaveNoMedia() && !it.path.isThisOrParentIncluded(includedPaths)) { + "${it.name.removeSuffix(hiddenString).trim()} $hiddenString" + } else { + it.name + } + } + val clone = filteredDirectories.clone() as ArrayList callback(clone.distinctBy { it.path.getDistinctPath() } as ArrayList)