aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/utils
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2021-01-11 21:26:02 -0800
committerAllan Wang <me@allanwang.ca>2021-01-11 21:26:02 -0800
commit3174728996fd970846f110f6cb349d7cd2caf9ba (patch)
treed08aebee5ca79113f7f153b08c043bfd79f94808 /app/src/main/kotlin/com/pitchedapps/frost/utils
parent58dbac5b01f9532375fd235fb21209424b6cf26a (diff)
downloadfrost-3174728996fd970846f110f6cb349d7cd2caf9ba.tar.gz
frost-3174728996fd970846f110f6cb349d7cd2caf9ba.tar.bz2
frost-3174728996fd970846f110f6cb349d7cd2caf9ba.zip
Add back email sender with blank email and remove more senders
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt13
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/WebContextMenu.kt15
2 files changed, 13 insertions, 15 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
index fab121a9..e7bc1542 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
@@ -397,11 +397,22 @@ fun Context.frostUri(entry: String): Uri {
return uri
}
+inline fun Context.sendFrostEmail(
+ @StringRes subjectId: Int,
+ crossinline builder: EmailBuilder.() -> Unit
+) =
+ sendFrostEmail(string(subjectId), builder)
+
+inline fun Context.sendFrostEmail(subjectId: String, crossinline builder: EmailBuilder.() -> Unit) =
+ sendEmail("", subjectId) {
+ builder()
+ addFrostDetails()
+ }
+
fun EmailBuilder.addFrostDetails() {
val prefs = Prefs.get()
addItem("Prev version", prefs.prevVersionCode.toString())
val proTag = "FO"
-// if (IS_FROST_PRO) "TY" else "FP"
addItem("Random Frost ID", "${prefs.frostId}-$proTag")
addItem("Locale", Locale.getDefault().displayName)
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/WebContextMenu.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/WebContextMenu.kt
index 3ab924e2..03dbb9fb 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/WebContextMenu.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/WebContextMenu.kt
@@ -75,20 +75,7 @@ enum class WebContextType(
{ c, wc, fc -> c.launchWebOverlay(wc.url!!, fc, Prefs.get()) }),
COPY_LINK(R.string.copy_link, { it.hasUrl }, { c, wc, _ -> c.copyToClipboard(wc.url) }),
COPY_TEXT(R.string.copy_text, { it.hasText }, { c, wc, _ -> c.copyToClipboard(wc.text) }),
- SHARE_LINK(R.string.share_link, { it.hasUrl }, { c, wc, _ -> c.shareText(wc.url) }),
- DEBUG_LINK(R.string.debug_link, { it.hasUrl }, { c, wc, _ ->
- c.materialDialog {
- title(R.string.debug_link)
- message(R.string.debug_link_desc)
- positiveButton(R.string.kau_ok) {
- c.sendFrostEmail(R.string.debug_link_subject) {
- message = c.string(R.string.debug_link_content)
- addItem("Unformatted url", wc.unformattedUrl!!)
- addItem("Formatted url", wc.url!!)
- }
- }
- }
- })
+ SHARE_LINK(R.string.share_link, { it.hasUrl }, { c, wc, _ -> c.shareText(wc.url) })
;
companion object {