Merge pull request #1493 from Naveen3Singh/add_extension

Add `Context.sendEmailIntent` extension
This commit is contained in:
Tibor Kaputa 2022-08-30 15:43:45 +02:00 committed by GitHub
commit 141660c8f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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"