Merge pull request #1493 from Naveen3Singh/add_extension
Add `Context.sendEmailIntent` extension
This commit is contained in:
commit
141660c8f9
2 changed files with 8 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue