diff options
author | Allan Wang <me@allanwang.ca> | 2017-10-24 23:29:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-24 23:29:55 -0400 |
commit | c2ca9066c6fd760bd6ef5d2f8f0530a89bfa7b66 (patch) | |
tree | a54665bb873b650b8f6f03b76cd59456ef79e296 /app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt | |
parent | 64dbf74b7a44a25f41ed7ff2ebfa11db0bc91769 (diff) | |
download | frost-c2ca9066c6fd760bd6ef5d2f8f0530a89bfa7b66.tar.gz frost-c2ca9066c6fd760bd6ef5d2f8f0530a89bfa7b66.tar.bz2 frost-c2ca9066c6fd760bd6ef5d2f8f0530a89bfa7b66.zip |
WIP: Feature/pip video 2 (#405)
* Add dependency
* Test new video view
* Add initial video bindings
* Implement drag to dismiss
* Begin initial integration
* Fix typo
* Fix up url formatter
* Update changelog
* Create first fully integrated video build
* Update translations
* Update translations 2
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt index 2d9915be..bf53c7eb 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt @@ -1,8 +1,10 @@ package com.pitchedapps.frost.web -import com.pitchedapps.frost.activities.WebOverlayBasicActivity +import com.pitchedapps.frost.activities.MainActivity import com.pitchedapps.frost.activities.WebOverlayActivity import com.pitchedapps.frost.activities.WebOverlayActivityBase +import com.pitchedapps.frost.activities.WebOverlayBasicActivity +import com.pitchedapps.frost.facebook.FB_URL_BASE import com.pitchedapps.frost.facebook.FbItem import com.pitchedapps.frost.facebook.USER_AGENT_BASIC import com.pitchedapps.frost.facebook.formattedFbUrl @@ -17,7 +19,7 @@ import com.pitchedapps.frost.utils.launchWebOverlay * cannot be resolved on a new window and must instead * by loaded in the current page * This helper method will collect all known cases and launch the overlay accordingly - * Returns {@code true} (default) if overlay is launched, {@code false} otherwise + * Returns {@code true} (default) if action is consumed, {@code false} otherwise * * If the request already comes from an instance of [WebOverlayActivity], we will then judge * whether the user agent string should be changed. All propagated results will return false, @@ -25,7 +27,6 @@ import com.pitchedapps.frost.utils.launchWebOverlay */ fun FrostWebViewCore.requestWebOverlay(url: String): Boolean { if (url == "#") return false - if (context is WebOverlayActivityBase) { L.v("Check web request from overlay", url) //already overlay; manage user agent @@ -70,10 +71,10 @@ fun FrostWebViewCore.requestWebOverlay(url: String): Boolean { /** * If the url contains any one of the whitelist segments, switch to the chat overlay */ -val messageWhitelist = setOf(FbItem.MESSAGES.url, FbItem.CHAT.url) +val messageWhitelist = setOf(FbItem.MESSAGES, FbItem.CHAT, FbItem.FEED_MOST_RECENT, FbItem.FEED_TOP_STORIES).map { it.url }.toSet() val String.shouldUseBasicAgent - get() = (messageWhitelist.any { contains(it) }) + get() = (messageWhitelist.any { contains(it) }) || this == FB_URL_BASE /** * The following components should never be launched in a new overlay |