mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
fix: dialpad call confirmation
This commit is contained in:
@@ -20,6 +20,7 @@ import android.view.ViewConfiguration
|
|||||||
import androidx.core.content.res.ResourcesCompat
|
import androidx.core.content.res.ResourcesCompat
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import com.reddit.indicatorfastscroll.FastScrollItemIndicator
|
import com.reddit.indicatorfastscroll.FastScrollItemIndicator
|
||||||
|
import com.simplemobiletools.commons.dialogs.CallConfirmationDialog
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.helpers.*
|
import com.simplemobiletools.commons.helpers.*
|
||||||
import com.simplemobiletools.commons.models.contacts.Contact
|
import com.simplemobiletools.commons.models.contacts.Contact
|
||||||
@@ -287,7 +288,14 @@ class DialpadActivity : SimpleActivity() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
ContactsAdapter(this, filtered, dialpad_list, null, text) {
|
ContactsAdapter(this, filtered, dialpad_list, null, text) {
|
||||||
startCallIntent((it as Contact).phoneNumbers.first().normalizedNumber)
|
val contact = it as Contact
|
||||||
|
if (config.showCallConfirmation) {
|
||||||
|
CallConfirmationDialog(this@DialpadActivity, contact.getNameToDisplay()) {
|
||||||
|
startCallIntent(contact.phoneNumbers.first().normalizedNumber)
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
startCallIntent(contact.phoneNumbers.first().normalizedNumber)
|
||||||
|
}
|
||||||
}.apply {
|
}.apply {
|
||||||
dialpad_list.adapter = this
|
dialpad_list.adapter = this
|
||||||
}
|
}
|
||||||
@@ -306,12 +314,24 @@ class DialpadActivity : SimpleActivity() {
|
|||||||
private fun initCall(number: String = dialpad_input.value, handleIndex: Int) {
|
private fun initCall(number: String = dialpad_input.value, handleIndex: Int) {
|
||||||
if (number.isNotEmpty()) {
|
if (number.isNotEmpty()) {
|
||||||
if (handleIndex != -1 && areMultipleSIMsAvailable()) {
|
if (handleIndex != -1 && areMultipleSIMsAvailable()) {
|
||||||
|
if (config.showCallConfirmation) {
|
||||||
|
CallConfirmationDialog(this, number) {
|
||||||
callContactWithSim(number, handleIndex == 0)
|
callContactWithSim(number, handleIndex == 0)
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
callContactWithSim(number, handleIndex == 0)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (config.showCallConfirmation) {
|
||||||
|
CallConfirmationDialog(this, number) {
|
||||||
|
startCallIntent(number)
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
startCallIntent(number)
|
startCallIntent(number)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun speedDial(id: Int): Boolean {
|
private fun speedDial(id: Int): Boolean {
|
||||||
if (dialpad_input.value.length == 1) {
|
if (dialpad_input.value.length == 1) {
|
||||||
|
Reference in New Issue
Block a user