Skip to content

Commit bce66e3

Browse files
committed
do not trim searched text on main tab
1 parent b850c19 commit bce66e3

File tree

1 file changed

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

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,22 +295,21 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
295295
}
296296

297297
override fun searchQueryChanged(text: String) {
298-
val searchText = text.trim()
299-
lastSearchedText = searchText
298+
lastSearchedText = text
300299
if (context == null) {
301300
return
302301
}
303302

304303
items_swipe_refresh.isEnabled = text.isEmpty() && activity?.config?.enablePullToRefresh != false
305304
when {
306-
searchText.isEmpty() -> {
305+
text.isEmpty() -> {
307306
items_fastscroller.beVisible()
308307
getRecyclerAdapter()?.updateItems(itemsIgnoringSearch)
309308
items_placeholder.beGone()
310309
items_placeholder_2.beGone()
311310
hideProgressBar()
312311
}
313-
searchText.length == 1 -> {
312+
text.length == 1 -> {
314313
items_fastscroller.beGone()
315314
items_placeholder.beVisible()
316315
items_placeholder_2.beVisible()
@@ -319,10 +318,10 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
319318
else -> {
320319
showProgressBar()
321320
ensureBackgroundThread {
322-
val files = searchFiles(searchText, currentPath)
321+
val files = searchFiles(text, currentPath)
323322
files.sortBy { it.getParentPath() }
324323

325-
if (lastSearchedText != searchText) {
324+
if (lastSearchedText != text) {
326325
return@ensureBackgroundThread
327326
}
328327

0 commit comments

Comments
 (0)