mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-02-17 04:10:39 +01:00
properly sort search results
This commit is contained in:
parent
dfbb2288d4
commit
5097bf382c
@ -312,7 +312,9 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
|
||||
|
||||
private fun searchFiles(text: String, path: String): ArrayList<ListItem> {
|
||||
val files = ArrayList<ListItem>()
|
||||
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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user