mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
improving search, ignore accents
This commit is contained in:
@@ -133,7 +133,10 @@ class ContactsFragment(context: Context, attributeSet: AttributeSet) : MyViewPag
|
|||||||
|
|
||||||
override fun onSearchQueryChanged(text: String) {
|
override fun onSearchQueryChanged(text: String) {
|
||||||
val contacts = allContacts.filter {
|
val contacts = allContacts.filter {
|
||||||
it.name.contains(text, true) || it.doesContainPhoneNumber(text)
|
it.doesContainPhoneNumber(text) ||
|
||||||
|
it.name.contains(text, true) ||
|
||||||
|
it.name.normalizeString().contains(text, true) ||
|
||||||
|
it.name.contains(text.normalizeString(), true)
|
||||||
}.toMutableList() as ArrayList<SimpleContact>
|
}.toMutableList() as ArrayList<SimpleContact>
|
||||||
|
|
||||||
fragment_placeholder.beVisibleIf(contacts.isEmpty())
|
fragment_placeholder.beVisibleIf(contacts.isEmpty())
|
||||||
|
Reference in New Issue
Block a user