From 7f88bb8795dc239ee2362ce0033981a84dc1a33b Mon Sep 17 00:00:00 2001 From: fatih ergin Date: Wed, 21 Jun 2023 22:30:33 +0300 Subject: [PATCH] sort search results on folder picker dialog respecting to config.directorySorting --- .../gallery/pro/dialogs/PickDirectoryDialog.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt index 52b387df4..b5d5690f0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt @@ -126,9 +126,9 @@ class PickDirectoryDialog( val adapter = view.directories_grid.adapter as? DirectoryAdapter var dirsToShow = allDirectories if (query.isNotEmpty()) { - dirsToShow = dirsToShow.filter { it.name.contains(query, true) }.sortedBy { !it.name.startsWith(query, true) } - .toMutableList() as ArrayList + dirsToShow = dirsToShow.filter { it.name.contains(query, true) }.toMutableList() as ArrayList } + dirsToShow = activity.getSortedDirectories(dirsToShow) checkPlaceholderVisibility(dirsToShow) val filteredFolderListUpdated = adapter?.dirs != dirsToShow