diff options
author | Allan Wang <me@allanwang.ca> | 2019-08-06 00:52:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-06 00:52:23 -0700 |
commit | d500d1dd6e05c6128dcb15fe8e15acb2aaf979cd (patch) | |
tree | 98caedbfd7a6b154ca6401c6a389cb5a08bdee3d /app/src/main/kotlin/com/pitchedapps/frost/utils/WebContextMenu.kt | |
parent | c78e670c2ac74e0c1b1fda4259cdcf69949e0d95 (diff) | |
parent | 59a462e6f23d046236bc20e6ac9c9464ed670f58 (diff) | |
download | frost-d500d1dd6e05c6128dcb15fe8e15acb2aaf979cd.tar.gz frost-d500d1dd6e05c6128dcb15fe8e15acb2aaf979cd.tar.bz2 frost-d500d1dd6e05c6128dcb15fe8e15acb2aaf979cd.zip |
Merge pull request #1503 from AllanWang/format
Format
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 | 8 |
1 files changed, 6 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 0a3be830..7fdd485d 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/WebContextMenu.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/WebContextMenu.kt @@ -33,7 +33,8 @@ import com.pitchedapps.frost.facebook.formattedFbUrl fun Context.showWebContextMenu(wc: WebContext) { if (wc.isEmpty) return var title = wc.url ?: string(R.string.menu) - title = title.substring(title.indexOf("m/") + 1) //just so if defaults to 0 in case it's not .com/ + title = + title.substring(title.indexOf("m/") + 1) //just so if defaults to 0 in case it's not .com/ if (title.length > 100) title = title.substring(0, 100) + '\u2026' val menuItems = WebContextType.values @@ -63,7 +64,10 @@ enum class WebContextType( val constraint: (wc: WebContext) -> Boolean, val onClick: (c: Context, wc: WebContext) -> Unit ) { - OPEN_LINK(R.string.open_link, { it.hasUrl }, { c, wc -> c.launchWebOverlay(wc.unformattedUrl!!) }), + OPEN_LINK( + R.string.open_link, + { it.hasUrl }, + { c, wc -> c.launchWebOverlay(wc.unformattedUrl!!) }), 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) }), |