mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-02-17 04:00:35 +01:00
take Default number into consideration at new conversations
This commit is contained in:
parent
9755ab8c3a
commit
ade0e86116
@ -145,14 +145,19 @@ class NewConversationActivity : SimpleActivity() {
|
||||
val contact = it as SimpleContact
|
||||
val phoneNumbers = contact.phoneNumbers
|
||||
if (phoneNumbers.size > 1) {
|
||||
val items = ArrayList<RadioItem>()
|
||||
phoneNumbers.forEachIndexed { index, phoneNumber ->
|
||||
val type = getPhoneNumberTypeText(phoneNumber.type, phoneNumber.label)
|
||||
items.add(RadioItem(index, "${phoneNumber.normalizedNumber} ($type)", phoneNumber.normalizedNumber))
|
||||
}
|
||||
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)
|
||||
items.add(RadioItem(index, "${phoneNumber.normalizedNumber} ($type)", phoneNumber.normalizedNumber))
|
||||
}
|
||||
|
||||
RadioGroupDialog(this, items) {
|
||||
launchThreadActivity(it as String, contact.name)
|
||||
RadioGroupDialog(this, items) {
|
||||
launchThreadActivity(it as String, contact.name)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
launchThreadActivity(phoneNumbers.first().normalizedNumber, contact.name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user