From c25ce6eafee753837c71799c569b3e9926cdd138 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 7 Mar 2020 23:21:22 +0100 Subject: [PATCH] fix a glitch at including/excluding folders --- .../com/simplemobiletools/gallery/pro/extensions/String.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt index ccfaa425b..2c0420b9a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt @@ -7,9 +7,9 @@ import com.simplemobiletools.commons.helpers.NOMEDIA import java.io.File import java.io.IOException -fun String.isThisOrParentIncluded(includedPaths: MutableSet) = includedPaths.any { startsWith(it, true) } +fun String.isThisOrParentIncluded(includedPaths: MutableSet) = includedPaths.any { equals(it, true) } || includedPaths.any { "$this/".startsWith("$it/", true) } -fun String.isThisOrParentExcluded(excludedPaths: MutableSet) = excludedPaths.any { startsWith(it, true) } +fun String.isThisOrParentExcluded(excludedPaths: MutableSet) = excludedPaths.any { equals(it, true) } || excludedPaths.any { "$this/".startsWith("$it/", true) } fun String.shouldFolderBeVisible(excludedPaths: MutableSet, includedPaths: MutableSet, showHidden: Boolean): Boolean { if (isEmpty()) {