Skip to content

Commit 4dbb8f8

Browse files
author
Jan Guegel
committed
use normalizeString() for StorageFragment
Signed-off-by: Jan Guegel <[email protected]>
1 parent 775e1fb commit 4dbb8f8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/src/main/kotlin/org/fossify/filemanager/fragments/StorageFragment.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import org.fossify.commons.extensions.getLongValue
2828
import org.fossify.commons.extensions.getProperBackgroundColor
2929
import org.fossify.commons.extensions.getProperPrimaryColor
3030
import org.fossify.commons.extensions.getStringValue
31+
import org.fossify.commons.extensions.normalizeString
3132
import org.fossify.commons.extensions.queryCursor
3233
import org.fossify.commons.extensions.showErrorToast
3334
import org.fossify.commons.extensions.updateTextColors
@@ -340,6 +341,7 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
340341
}
341342

342343
override fun searchQueryChanged(text: String) {
344+
val normalizedText = text.normalizeString()
343345
lastSearchedText = text
344346
binding.apply {
345347
if (text.isNotEmpty()) {
@@ -364,7 +366,10 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
364366
} else {
365367
showProgressBar()
366368
ensureBackgroundThread {
367-
val filtered = allDeviceListItems.filter { it.mName.contains(text, true) }.toMutableList() as ArrayList<ListItem>
369+
val filtered = allDeviceListItems.filter {
370+
it.mName.normalizeString().contains(normalizedText, true)
371+
}.toMutableList() as ArrayList<ListItem>
372+
368373
if (lastSearchedText != text) {
369374
return@ensureBackgroundThread
370375
}

0 commit comments

Comments
 (0)