Skip to content

Commit 5097bf3

Browse files
committed
properly sort search results
1 parent dfbb228 commit 5097bf3

File tree

1 file changed

+4
-1
lines changed
  • app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments

1 file changed

+4
-1
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,9 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
312312

313313
private fun searchFiles(text: String, path: String): ArrayList<ListItem> {
314314
val files = ArrayList<ListItem>()
315-
val isSortingBySize = context!!.config.getFolderSorting(path) and SORT_BY_SIZE != 0
315+
val sorting = context!!.config.getFolderSorting(path)
316+
FileDirItem.sorting = context!!.config.getFolderSorting(currentPath)
317+
val isSortingBySize = sorting and SORT_BY_SIZE != 0
316318
File(path).listFiles()?.forEach {
317319
if (it.isDirectory) {
318320
files.addAll(searchFiles(text, it.absolutePath))
@@ -325,6 +327,7 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
325327
}
326328
}
327329
}
330+
files.sort()
328331
return files
329332
}
330333

0 commit comments

Comments
 (0)