sort search results on folder picker dialog respecting to config.directorySorting

This commit is contained in:
fatih ergin 2023-06-21 22:30:33 +03:00
parent 343962bfca
commit 7f88bb8795
1 changed files with 2 additions and 2 deletions

View File

@ -126,9 +126,9 @@ class PickDirectoryDialog(
val adapter = view.directories_grid.adapter as? DirectoryAdapter val adapter = view.directories_grid.adapter as? DirectoryAdapter
var dirsToShow = allDirectories var dirsToShow = allDirectories
if (query.isNotEmpty()) { if (query.isNotEmpty()) {
dirsToShow = dirsToShow.filter { it.name.contains(query, true) }.sortedBy { !it.name.startsWith(query, true) } dirsToShow = dirsToShow.filter { it.name.contains(query, true) }.toMutableList() as ArrayList
.toMutableList() as ArrayList
} }
dirsToShow = activity.getSortedDirectories(dirsToShow)
checkPlaceholderVisibility(dirsToShow) checkPlaceholderVisibility(dirsToShow)
val filteredFolderListUpdated = adapter?.dirs != dirsToShow val filteredFolderListUpdated = adapter?.dirs != dirsToShow