diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index ee9920b88..8e628723f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -928,15 +928,15 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } private fun showSortedDirs(dirs: ArrayList) { - val updatedDirs = getUniqueSortedDirs(dirs) + val updatedDirs = getUniqueSortedDirs(dirs).toMutableList() as ArrayList runOnUiThread { (directories_grid.adapter as? DirectoryAdapter)?.updateDirs(updatedDirs) } } private fun getUniqueSortedDirs(dirs: ArrayList): ArrayList { - val sortedDirs = dirs.distinctBy { it.path.getDistinctPath() } as ArrayList - return getSortedDirectories(sortedDirs) + val distinctDirs = dirs.distinctBy { it.path.getDistinctPath() } as ArrayList + return getSortedDirectories(distinctDirs) } private fun createDirectoryFromMedia(path: String, curMedia: ArrayList, albumCovers: ArrayList, hiddenString: String,