diff options
author | Allan Wang <me@allanwang.ca> | 2017-07-25 15:18:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-25 15:18:12 -0700 |
commit | d94bc858c8a0c273d87d705eb06d35cfd9cf9e08 (patch) | |
tree | 05220a36a87a73388b89901f4fe5cd09d3fd48d5 /app/src/main/kotlin/com/pitchedapps/frost/utils/WebContextMenu.kt | |
parent | 913eaf7ea029030d7354a3969dc6aa87b0a51b1a (diff) | |
download | frost-d94bc858c8a0c273d87d705eb06d35cfd9cf9e08.tar.gz frost-d94bc858c8a0c273d87d705eb06d35cfd9cf9e08.tar.bz2 frost-d94bc858c8a0c273d87d705eb06d35cfd9cf9e08.zip |
Update image downloads , IAB, and many issue reports (#95)v1.4
* Remove iab proguard line
* Remove dup vending aidl
* Fix double calling issue
* Change pro logging
* Remove async call
* Allow for multiple result flags from settings
* Rename restore to get
* Remove remaining async
* Add null checks across web clients
* Do not delete temp file on save
* Implement image logic
* Update file chooser
* Update travis
* Add intent checker
* Update dependencies
* Update dependencies
* Add debugging option
* Switch context for login glide
* Scan newly added files
* Update theme
* Allow image downloading in messages
* Finalize beta release
* Build to beta
* Update strings
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils/WebContextMenu.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/WebContextMenu.kt | 22 |
1 files changed, 20 insertions, 2 deletions
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 40de99bf..ea66030f 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/WebContextMenu.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/WebContextMenu.kt @@ -1,12 +1,14 @@ package com.pitchedapps.frost.utils import android.content.Context +import ca.allanwang.kau.email.sendEmail import ca.allanwang.kau.utils.copyToClipboard import ca.allanwang.kau.utils.shareText import ca.allanwang.kau.utils.string import ca.allanwang.kau.utils.toast import com.pitchedapps.frost.R import com.pitchedapps.frost.activities.MainActivity +import com.pitchedapps.frost.facebook.formattedFbUrl /** * Created by Allan Wang on 2017-07-07. @@ -34,12 +36,28 @@ fun Context.showWebContextMenu(wc: WebContext) { } } -class WebContext(val url: String, val text: String?) +class WebContext(val unformattedUrl: String, val text: String?) { + val url = unformattedUrl.formattedFbUrl +} enum class WebContextType(val textId: Int, val onClick: (c: Context, wc: WebContext) -> Unit) { COPY_LINK(R.string.copy_link, { c, wc -> c.copyToClipboard(wc.url) }), COPY_TEXT(R.string.copy_text, { c, wc -> if (wc.text != null) c.copyToClipboard(wc.text) else c.toast(R.string.no_text) }), - SHARE_LINK(R.string.share_link, { c, wc -> c.shareText(wc.url) }) + SHARE_LINK(R.string.share_link, { c, wc -> c.shareText(wc.url) }), + DEBUG_LINK(R.string.debug_link, { c, wc -> + c.materialDialogThemed { + title(R.string.debug_link) + content(R.string.debug_link_desc) + positiveText(R.string.kau_ok) + onPositive { _, _ -> + c.sendEmail(R.string.dev_email, R.string.debug_link_subject) { + message = c.string(R.string.debug_link_content) + addItem("Unformatted url", wc.unformattedUrl) + addItem("Formatted url", wc.url) + } + } + } + }) ; companion object { |