mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
use a copy of Dirs arraylist before updating the directories adapter
This commit is contained in:
@ -928,15 +928,15 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||
}
|
||||
|
||||
private fun showSortedDirs(dirs: ArrayList<Directory>) {
|
||||
val updatedDirs = getUniqueSortedDirs(dirs)
|
||||
val updatedDirs = getUniqueSortedDirs(dirs).toMutableList() as ArrayList
|
||||
runOnUiThread {
|
||||
(directories_grid.adapter as? DirectoryAdapter)?.updateDirs(updatedDirs)
|
||||
}
|
||||
}
|
||||
|
||||
private fun getUniqueSortedDirs(dirs: ArrayList<Directory>): ArrayList<Directory> {
|
||||
val sortedDirs = dirs.distinctBy { it.path.getDistinctPath() } as ArrayList<Directory>
|
||||
return getSortedDirectories(sortedDirs)
|
||||
val distinctDirs = dirs.distinctBy { it.path.getDistinctPath() } as ArrayList<Directory>
|
||||
return getSortedDirectories(distinctDirs)
|
||||
}
|
||||
|
||||
private fun createDirectoryFromMedia(path: String, curMedia: ArrayList<Medium>, albumCovers: ArrayList<AlbumCover>, hiddenString: String,
|
||||
|
Reference in New Issue
Block a user