From db278b4aa24ca34012f3ff6a128aa514bb979901 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 26 Apr 2018 09:48:05 +0200 Subject: [PATCH] add another extra check to avoid showing duplicate folders --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 40ae7d726..a6fec1db6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -679,7 +679,9 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } private fun showSortedDirs(dirs: ArrayList) { - val sortedDirs = getSortedDirectories(dirs).clone() as ArrayList + var sortedDirs = getSortedDirectories(dirs).clone() as ArrayList + sortedDirs = sortedDirs.distinctBy { it.path.toLowerCase() } as ArrayList + runOnUiThread { (directories_grid.adapter as DirectoryAdapter).updateDirs(sortedDirs) }