aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/ca/allanwang
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-01-06 18:05:25 -0500
committerAllan Wang <me@allanwang.ca>2018-01-06 18:05:25 -0500
commitfea8de4bd215aa1933b695a93b1fa8d01e9f0bda (patch)
tree9dd9435b328d02edd2ee2d8d9b76cb00a8eb4303 /core/src/main/kotlin/ca/allanwang
parent401e8db1e6d34f3fcb3b1b96d225f7aa6c17d292 (diff)
downloadkau-fea8de4bd215aa1933b695a93b1fa8d01e9f0bda.tar.gz
kau-fea8de4bd215aa1933b695a93b1fa8d01e9f0bda.tar.bz2
kau-fea8de4bd215aa1933b695a93b1fa8d01e9f0bda.zip
Add breakpoint to email builder
Diffstat (limited to 'core/src/main/kotlin/ca/allanwang')
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt7
1 files changed, 6 insertions, 1 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 6576657..ea552b8 100644
--- a/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt
+++ b/core/src/main/kotlin/ca/allanwang/kau/email/EmailBuilder.kt
@@ -33,7 +33,7 @@ class EmailBuilder(val email: String, val subject: String) {
data class Package(val packageName: String, val appName: String)
- fun execute(context: Context) {
+ fun getIntent(context: Context): Intent {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("mailto:$email"))
intent.putExtra(Intent.EXTRA_SUBJECT, subject)
val emailBuilder = StringBuilder()
@@ -77,6 +77,11 @@ class EmailBuilder(val email: String, val subject: String) {
emailBuilder.append("\n").append(footer)
intent.putExtra(Intent.EXTRA_TEXT, emailBuilder.toString())
+ return intent
+ }
+
+ fun execute(context: Context) {
+ val intent = getIntent(context)
if (intent.resolveActivity(context.packageManager) != null)
context.startActivity(Intent.createChooser(intent, context.resources.getString(R.string.kau_send_via)))
else