diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt index 6ec7fd70b..792bc009d 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt @@ -1029,3 +1029,10 @@ fun Context.updateBottomTabItemColors(view: View?, isActive: Boolean) { view?.findViewById(R.id.tab_item_icon)?.applyColorFilter(color) view?.findViewById(R.id.tab_item_label)?.setTextColor(color) } + +fun Context.sendEmailIntent(recipient: String) { + Intent(Intent.ACTION_SENDTO).apply { + data = Uri.fromParts(KEY_MAILTO, recipient, null) + launchActivityIntent(this) + } +} diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/Constants.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/Constants.kt index 38781d448..8fa09ec38 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/Constants.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/Constants.kt @@ -35,6 +35,7 @@ const val SAVE_DISCARD_PROMPT_INTERVAL = 1000L const val SD_OTG_PATTERN = "^/storage/[A-Za-z0-9]{4}-[A-Za-z0-9]{4}$" const val SD_OTG_SHORT = "^[A-Za-z0-9]{4}-[A-Za-z0-9]{4}$" const val KEY_PHONE = "phone" +const val KEY_MAILTO = "mailto" const val CONTACT_ID = "contact_id" const val IS_PRIVATE = "is_private" const val MD5 = "MD5"