aboutsummaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-01-06 18:17:07 -0500
committerAllan Wang <me@allanwang.ca>2018-01-06 18:17:07 -0500
commit6843e83623d2fb9bb7f42d0d9f66ab90a5a47348 (patch)
tree8b9b89bbc4ae25f571a22c03a2da9a6ac4c64a73 /core/src
parentfea8de4bd215aa1933b695a93b1fa8d01e9f0bda (diff)
downloadkau-6843e83623d2fb9bb7f42d0d9f66ab90a5a47348.tar.gz
kau-6843e83623d2fb9bb7f42d0d9f66ab90a5a47348.tar.bz2
kau-6843e83623d2fb9bb7f42d0d9f66ab90a5a47348.zip
Add extra hook
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt b/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt
index ea552b8..8277c1d 100644
--- a/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt
+++ b/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt
@@ -80,10 +80,11 @@ class EmailBuilder(val email: String, val subject: String) {
return intent
}
- fun execute(context: Context) {
+ inline fun execute(context: Context, extras: Intent.() -> Unit = {}) {
val intent = getIntent(context)
+ intent.extras()
if (intent.resolveActivity(context.packageManager) != null)
- context.startActivity(Intent.createChooser(intent, context.resources.getString(R.string.kau_send_via)))
+ context.startActivity(Intent.createChooser(intent, context.string(R.string.kau_send_via)))
else
context.toast("Cannot resolve email activity", log = true)
}