From 44c3b0d1a060a3cf16838ecc40e80c84325ffc56 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 12 Jul 2020 21:36:12 +0200 Subject: [PATCH] search the given string at phone numbers too, not just names --- .../simplemobiletools/dialer/fragments/ContactsFragment.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/fragments/ContactsFragment.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/fragments/ContactsFragment.kt index af678289..2a2c1d9a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/fragments/ContactsFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/fragments/ContactsFragment.kt @@ -154,7 +154,10 @@ class ContactsFragment(context: Context, attributeSet: AttributeSet) : MyViewPag } fun onSearchQueryChanged(text: String) { - val contacts = allContacts.filter { it.name.contains(text, true) }.toMutableList() as ArrayList + val contacts = allContacts.filter { + it.name.contains(text, true) || it.doesContainPhoneNumber(text) + }.toMutableList() as ArrayList + (fragment_list.adapter as? ContactsAdapter)?.updateItems(contacts, text) setupLetterFastscroller(contacts) }