diff options
author | Allan Wang <me@allanwang.ca> | 2017-07-16 17:26:58 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-16 17:26:58 -0700 |
commit | d90cb9b61cd2e033b46f4780ad1340c5f35b7751 (patch) | |
tree | 0294ce22bacb463c9cc95de8dc5581c1bd59a108 /app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt | |
parent | c3f1fc6a8b3216442a018bb04843dfa68d738918 (diff) | |
download | frost-d90cb9b61cd2e033b46f4780ad1340c5f35b7751.tar.gz frost-d90cb9b61cd2e033b46f4780ad1340c5f35b7751.tar.bz2 frost-d90cb9b61cd2e033b46f4780ad1340c5f35b7751.zip |
Add image viewing and downloading (#63)v1.3
* Commence aggressive image caching
* Add glide toggle and css url parsing
* Add image hook and refractor activities
* Update version analytics
* Implemented imageactivity but glide will not load
* Create working image loader
* Finalize image view
* Finalize image view logic
* Remove custom cache experiment
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt index e53bb202..622be067 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt @@ -14,10 +14,10 @@ class FbUrlFormatter(url: String) { init { var cleanedUrl = url - discardable.forEach { cleanedUrl = cleanedUrl.replace(it, "") } + discardable.forEach { cleanedUrl = cleanedUrl.replace(it, "", true) } val changed = cleanedUrl != url //note that discardables strip away the first ? - decoder.forEach { (k, v) -> cleanedUrl = cleanedUrl.replace(k, v) } - val qm = cleanedUrl.indexOf(if (changed)"&" else "?") + decoder.forEach { (k, v) -> cleanedUrl = cleanedUrl.replace(k, v, true) } + val qm = cleanedUrl.indexOf(if (changed) "&" else "?") if (qm > -1) { cleanedUrl.substring(qm + 1).split("&").forEach { val p = it.split("=") @@ -72,7 +72,15 @@ class FbUrlFormatter(url: String) { "%60" to "`", "%3B" to ";", "%2F" to "/", "%3F" to "?", "%3A" to ":", "%40" to "@", "%3D" to "=", "%26" to "&", "%24" to "$", "%2B" to "+", "%22" to "\"", "%2C" to ",", - "%20" to " " + "%20" to " ", + //css + "\\3C " to "<", "\\3E " to ">", "\\23 " to "#", "\\25 " to "%", + "\\7B " to "{", "\\7D " to "}", "\\7C " to "|", "\\5C " to "\\", + "\\5E " to "^", "\\7E " to "~", "\\5B " to "[", "\\5D " to "]", + "\\60 " to "`", "\\3B " to ";", "\\2F " to "/", "\\3F " to "?", + "\\3A " to ":", "\\40 " to "@", "\\3D " to "=", "\\26 " to "&", + "\\24 " to "$", "\\2B " to "+", "\\22 " to "\"", "\\2C " to ",", + "\\20 " to " " ) } }
\ No newline at end of file |