From 5097bf382c706e36da5ca662dc02a4c0604216d4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 29 Mar 2019 11:22:41 +0100 Subject: [PATCH] properly sort search results --- .../filemanager/pro/fragments/ItemsFragment.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt index 68acb420..c6d1a7bf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt @@ -312,7 +312,9 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb private fun searchFiles(text: String, path: String): ArrayList { val files = ArrayList() - val isSortingBySize = context!!.config.getFolderSorting(path) and SORT_BY_SIZE != 0 + val sorting = context!!.config.getFolderSorting(path) + FileDirItem.sorting = context!!.config.getFolderSorting(currentPath) + val isSortingBySize = sorting and SORT_BY_SIZE != 0 File(path).listFiles()?.forEach { if (it.isDirectory) { files.addAll(searchFiles(text, it.absolutePath)) @@ -325,6 +327,7 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb } } } + files.sort() return files }