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) }