avoid showing contacts without phone numbers at the dialpad

This commit is contained in:
tibbi 2023-04-07 18:09:45 +02:00
parent 7730baff13
commit 846f668d59
1 changed files with 6 additions and 2 deletions

View File

@ -137,10 +137,14 @@ class DialpadActivity : SimpleActivity() {
dialpad_call_button.setOnClickListener { initCall(dialpad_input.value, 0) } dialpad_call_button.setOnClickListener { initCall(dialpad_input.value, 0) }
dialpad_input.onTextChangeListener { dialpadValueChanged(it) } dialpad_input.onTextChangeListener { dialpadValueChanged(it) }
dialpad_input.requestFocus() dialpad_input.requestFocus()
ContactsHelper(this).getContacts{ gotContacts(it) }
dialpad_input.disableKeyboard() dialpad_input.disableKeyboard()
ContactsHelper(this).getContacts { allContacts ->
val contactsWithNumber = allContacts.filter { it.phoneNumbers.isNotEmpty() }.toList() as ArrayList<Contact>
gotContacts(contactsWithNumber)
}
val properPrimaryColor = getProperPrimaryColor() val properPrimaryColor = getProperPrimaryColor()
val callIconId = if (areMultipleSIMsAvailable()) { val callIconId = if (areMultipleSIMsAvailable()) {
val callIcon = resources.getColoredDrawableWithColor(R.drawable.ic_phone_two_vector, properPrimaryColor.getContrastColor()) val callIcon = resources.getColoredDrawableWithColor(R.drawable.ic_phone_two_vector, properPrimaryColor.getContrastColor())