Add Context.sendEmailIntent extension

This commit is contained in:
Naveen 2022-08-30 15:46:30 +05:30
parent 2122bbc6a3
commit cc9aed8d18
2 changed files with 8 additions and 0 deletions

View file

@ -1029,3 +1029,10 @@ fun Context.updateBottomTabItemColors(view: View?, isActive: Boolean) {
view?.findViewById<ImageView>(R.id.tab_item_icon)?.applyColorFilter(color)
view?.findViewById<TextView>(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)
}
}

View file

@ -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"