take Default number into consideration at new conversations
This commit is contained in:
parent
9755ab8c3a
commit
ade0e86116
1 changed files with 12 additions and 7 deletions
|
|
@ -145,6 +145,10 @@ class NewConversationActivity : SimpleActivity() {
|
|||
val contact = it as SimpleContact
|
||||
val phoneNumbers = contact.phoneNumbers
|
||||
if (phoneNumbers.size > 1) {
|
||||
val primaryNumber = contact.phoneNumbers.find { it.isPrimary }
|
||||
if (primaryNumber != null) {
|
||||
launchThreadActivity(primaryNumber.value, contact.name)
|
||||
} else {
|
||||
val items = ArrayList<RadioItem>()
|
||||
phoneNumbers.forEachIndexed { index, phoneNumber ->
|
||||
val type = getPhoneNumberTypeText(phoneNumber.type, phoneNumber.label)
|
||||
|
|
@ -154,6 +158,7 @@ class NewConversationActivity : SimpleActivity() {
|
|||
RadioGroupDialog(this, items) {
|
||||
launchThreadActivity(it as String, contact.name)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
launchThreadActivity(phoneNumbers.first().normalizedNumber, contact.name)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue