show labels too at calling contacts with multiple numbers

This commit is contained in:
tibbi 2022-02-06 11:35:11 +01:00
parent 6333db4a8d
commit e303b8b62a
1 changed files with 3 additions and 2 deletions

View File

@ -102,11 +102,12 @@ class FavoritesFragment(context: Context, attributeSet: AttributeSet) : MyViewPa
} else {
val items = ArrayList<RadioItem>()
phoneNumbers.forEachIndexed { index, phoneNumber ->
items.add(RadioItem(index, phoneNumber.normalizedNumber))
val type = context.getPhoneNumberTypeText(phoneNumber.type, phoneNumber.label)
items.add(RadioItem(index, "${phoneNumber.normalizedNumber} ($type)", phoneNumber.normalizedNumber))
}
RadioGroupDialog(activity!!, items) {
activity?.launchCallIntent(phoneNumbers[it as Int].normalizedNumber)
activity?.launchCallIntent(it as String)
}
}
}