From 41ab8d4d6b0e0fd236671ee7deff418b1ce79308 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 23 May 2018 13:52:09 +0200 Subject: [PATCH] fix #774, avoid showing Excluded images at Show All Folders Content --- .../simplemobiletools/gallery/extensions/Context.kt | 10 ++++++++++ .../com/simplemobiletools/gallery/models/Directory.kt | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) 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 783792998..22b8b7ec9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt @@ -292,6 +292,16 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag filteredMedia = media.filter { !it.path.contains("/.") } as ArrayList } + if (path == "/") { + val excludedFolders = config.excludedFolders + filteredMedia = filteredMedia.filter { + val mediumPath = it.path + excludedFolders.none { + mediumPath.startsWith(it, true) + } + } as ArrayList + } + val filterMedia = config.filterMedia filteredMedia = (when { getVideosOnly -> filteredMedia.filter { it.type == TYPE_VIDEOS } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt index 6d8c217a1..ce5777efa 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt @@ -24,7 +24,7 @@ data class Directory( companion object { private const val serialVersionUID = -6553345863555455L - var sorting: Int = 0 + var sorting = 0 } override fun compareTo(other: Directory): Int {