mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
fix: always dial primary number by default
This commit is contained in:
@@ -291,10 +291,10 @@ class DialpadActivity : SimpleActivity() {
|
|||||||
val contact = it as Contact
|
val contact = it as Contact
|
||||||
if (config.showCallConfirmation) {
|
if (config.showCallConfirmation) {
|
||||||
CallConfirmationDialog(this@DialpadActivity, contact.getNameToDisplay()) {
|
CallConfirmationDialog(this@DialpadActivity, contact.getNameToDisplay()) {
|
||||||
startCallIntent(contact.phoneNumbers.first().normalizedNumber)
|
startCallIntent(contact.getPrimaryNumber() ?: return@CallConfirmationDialog)
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
startCallIntent(contact.phoneNumbers.first().normalizedNumber)
|
startCallIntent(contact.getPrimaryNumber() ?: return@ContactsAdapter)
|
||||||
}
|
}
|
||||||
}.apply {
|
}.apply {
|
||||||
dialpad_list.adapter = this
|
dialpad_list.adapter = this
|
||||||
|
@@ -224,9 +224,7 @@ class ContactsAdapter(
|
|||||||
private fun getSelectedItems() = contacts.filter { selectedKeys.contains(it.rawId) } as ArrayList<Contact>
|
private fun getSelectedItems() = contacts.filter { selectedKeys.contains(it.rawId) } as ArrayList<Contact>
|
||||||
|
|
||||||
private fun getSelectedPhoneNumber(): String? {
|
private fun getSelectedPhoneNumber(): String? {
|
||||||
val numbers = getSelectedItems().firstOrNull()?.phoneNumbers
|
return getSelectedItems().firstOrNull()?.getPrimaryNumber()
|
||||||
val primaryNumber = numbers?.firstOrNull { it.isPrimary }
|
|
||||||
return primaryNumber?.normalizedNumber ?: numbers?.firstOrNull()?.normalizedNumber
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun tryCreateShortcut() {
|
private fun tryCreateShortcut() {
|
||||||
|
Reference in New Issue
Block a user