From f82b09470bf47957e9c483792199d8940fc8ac6c Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 27 Feb 2017 20:04:27 +0100 Subject: [PATCH] simplify the hidden folder check --- .../com/simplemobiletools/gallery/extensions/context.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 9553fed46..1877868b1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt @@ -88,10 +88,11 @@ fun Context.getParents(): ArrayList { } private fun isFolderVisible(path: String, noMediaFolders: ArrayList): Boolean { - val parts = path.split("/") - return if (parts.any { it.startsWith(".") }) { + return if (path.contains("/.")) { false - } else !noMediaFolders.any { path.startsWith(it) } + } else { + !noMediaFolders.any { path.startsWith(it) } + } } fun Context.getNoMediaFolders(): ArrayList {