Dialing number refactor

This commit is contained in:
Agnieszka C 2021-10-18 18:19:26 +02:00
parent 41114e5f2c
commit 44547b05d0
3 changed files with 18 additions and 28 deletions

View file

@ -129,18 +129,7 @@ class ConversationsAdapter(
private fun dialNumber() {
val conversation = getSelectedItems().firstOrNull() ?: return
Intent(Intent.ACTION_DIAL).apply {
data = Uri.fromParts("tel", conversation.phoneNumber, null)
try {
activity.startActivity(this)
finishActMode()
} catch (e: ActivityNotFoundException) {
activity.toast(R.string.no_app_found)
} catch (e: Exception) {
activity.showErrorToast(e)
}
}
activity.dialNumber(conversation.phoneNumber) { finishActMode() }
}
private fun copyNumberToClipboard() {