From 1b474d66f349d39f8fc94e6e950c8c166be83b4e Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 12 May 2018 23:55:40 +0200 Subject: [PATCH] fix #765, avoid showing hidden items when inappropriate at Show All Folders --- .../com/simplemobiletools/gallery/extensions/Context.kt | 5 ++++- 1 file changed, 4 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 c465a9c5e..0a70c6a61 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt @@ -289,7 +289,7 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag val shouldShowHidden = config.shouldShowHidden var filteredMedia = media if (!shouldShowHidden) { - filteredMedia = media.filter { !it.name.startsWith('.') } as ArrayList + filteredMedia = media.filter { !it.path.contains("/.") } as ArrayList } val filterMedia = config.filterMedia @@ -303,6 +303,9 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag } }) as ArrayList + Medium.sorting = config.getFileSorting(path) + filteredMedia.sort() + callback(filteredMedia) media.filter { !getDoesFilePathExist(it.path) }.forEach { mediumDao.deleteMediumPath(it.path)