Dialing number refactor
This commit is contained in:
parent
41114e5f2c
commit
44547b05d0
3 changed files with 18 additions and 28 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue