diff options
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 dc2d7549..62330e4d 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/WebContextMenu.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/WebContextMenu.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2018 Allan Wang + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ package com.pitchedapps.frost.utils import android.content.Context @@ -41,7 +57,9 @@ class WebContext(val unformattedUrl: String, val text: String?) { enum class WebContextType(val textId: Int, val onClick: (c: Context, wc: WebContext) -> Unit) { OPEN_LINK(R.string.open_link, { c, wc -> c.launchWebOverlay(wc.unformattedUrl) }), 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) }), + 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) }), DEBUG_LINK(R.string.debug_link, { c, wc -> c.materialDialogThemed { @@ -63,4 +81,4 @@ enum class WebContextType(val textId: Int, val onClick: (c: Context, wc: WebCont val values = values() operator fun get(index: Int) = values[index] } -}
\ No newline at end of file +} |