Skip to content

Commit b948390

Browse files
committed
fix some weird sorting at search results
1 parent e665c38 commit b948390

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
175175

176176
items_fastscroller.allowBubbleDisplay = true
177177
items_fastscroller.setViews(items_list, mView.items_swipe_refresh) {
178-
items_fastscroller.updateBubbleText(storedItems.getOrNull(it)?.getBubbleText(context, storedDateFormat, storedTimeFormat) ?: "")
178+
items_fastscroller.updateBubbleText(storedItems.getOrNull(it)?.getBubbleText(context, storedDateFormat, storedTimeFormat)
179+
?: "")
179180
}
180181

181182
getRecyclerLayoutManager().onRestoreInstanceState(scrollStates[currentPath])
@@ -348,7 +349,7 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
348349
val sorting = context!!.config.getFolderSorting(path)
349350
FileDirItem.sorting = context!!.config.getFolderSorting(currentPath)
350351
val isSortingBySize = sorting and SORT_BY_SIZE != 0
351-
File(path).listFiles()?.forEach {
352+
File(path).listFiles()?.sortedBy { it.isDirectory }?.forEach {
352353
if (it.isDirectory) {
353354
files.addAll(searchFiles(text, it.absolutePath))
354355
} else {
@@ -360,7 +361,6 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
360361
}
361362
}
362363
}
363-
files.sort()
364364
return files
365365
}
366366

0 commit comments

Comments
 (0)