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