diff options
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt | 5 |
1 files changed, 5 insertions, 0 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 6db7179d..a8e7c64c 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt @@ -81,6 +81,8 @@ import org.apache.commons.text.StringEscapeUtils import org.jsoup.Jsoup import org.jsoup.nodes.Document import org.jsoup.nodes.Element +import java.net.URLEncoder +import java.nio.charset.StandardCharsets /** * Created by Allan Wang on 2017-06-03. @@ -370,6 +372,9 @@ val dependentSegments = arrayOf( inline val String?.isExplicitIntent get() = this != null && (startsWith("intent://") || startsWith("market://")) +fun String.urlEncode(): String = + URLEncoder.encode(this, StandardCharsets.UTF_8.name()) + fun Context.frostChangelog() = showChangelog(R.xml.frost_changelog) fun Context.frostUriFromFile(file: File): Uri = |