check contact real phone numbers too, not just the cleared ones

This commit is contained in:
tibbi 2018-09-24 14:15:08 +02:00
parent 2beb5eb3a6
commit 2aadd93fa6
1 changed files with 4 additions and 1 deletions

View File

@ -94,6 +94,9 @@ class DialpadActivity : SimpleActivity() {
private fun dialpadValueChanged(text: String) {
val numericOnly = text.replace(PHONE_NUMBER_PATTERN.toRegex(), "")
val filtered = contacts.filter { it.cleanPhoneNumbers.any { it.value.contains(text) || it.value.contains(numericOnly) } }
val filtered = contacts.filter {
it.phoneNumbers.any { it.value.contains(text) || it.value.contains(numericOnly) } ||
it.cleanPhoneNumbers.any { it.value.contains(text) || it.value.contains(numericOnly) }
}
}
}