aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/web
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-02-16 21:51:02 -0500
committerGitHub <noreply@github.com>2018-02-16 21:51:02 -0500
commitfec23276e8290d4600ef79c54b5fcb00673daa83 (patch)
treec1e7710e91b4152bf40f736294aef12a635535b2 /app/src/main/kotlin/com/pitchedapps/frost/web
parentd68ea6d7eb8cadf687308fa3204386b79df0556b (diff)
downloadfrost-fec23276e8290d4600ef79c54b5fcb00673daa83.tar.gz
frost-fec23276e8290d4600ef79c54b5fcb00673daa83.tar.bz2
frost-fec23276e8290d4600ef79c54b5fcb00673daa83.zip
Update/misc (#728)
* Update basic agent check; fixes #714 * Disable swipe on long click * Remove duplicate code * Update dependencies * Update dependencies 2 * Add debug keystore * Update versions * Fix duplicate notification * Fix duplicate notification sound; addreesses #725 * Update changelog * Clean up
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt8
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt11
2 files changed, 15 insertions, 4 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
index 4a3fa2a2..564b0e04 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
@@ -2,6 +2,7 @@ package com.pitchedapps.frost.web
import android.webkit.JavascriptInterface
import com.pitchedapps.frost.activities.MainActivity
+import com.pitchedapps.frost.contracts.MainActivityContract
import com.pitchedapps.frost.contracts.VideoViewHolder
import com.pitchedapps.frost.facebook.FbCookie
import com.pitchedapps.frost.utils.*
@@ -63,6 +64,7 @@ class FrostJSI(val web: FrostWebView) {
@JavascriptInterface
fun longClick(start: Boolean) {
activity?.viewPager?.enableSwipe = !start
+ web.parent.swipeEnabled = !start
}
/**
@@ -70,7 +72,11 @@ class FrostJSI(val web: FrostWebView) {
*/
@JavascriptInterface
fun disableSwipeRefresh(disable: Boolean) {
- web.post { web.parent.swipeEnabled = !disable }
+ web.parent.swipeEnabled = !disable
+ if (disable) {
+ // locked onto an input field; ensure content is visible
+ (context as? MainActivityContract)?.collapseAppBar()
+ }
}
@JavascriptInterface
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 8df5b065..7e5f1632 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt
@@ -72,6 +72,11 @@ fun FrostWebView.requestWebOverlay(url: String): Boolean {
*/
val messageWhitelist = setOf(FbItem.MESSAGES, FbItem.CHAT, FbItem.FEED_MOST_RECENT, FbItem.FEED_TOP_STORIES).map { it.url }.toSet()
-val String.shouldUseBasicAgent
- get() = !contains("story.php") //we will use basic agent for anything that isn't a comment section
-// get() = (messageWhitelist.any { contains(it) }) || this == FB_URL_BASE \ No newline at end of file
+val String.shouldUseBasicAgent: Boolean
+ get() {
+ if (contains("story.php")) // do not use basic for comment section
+ return false
+ if (contains("/events/")) // do not use for events (namely the map)
+ return false
+ return true // use for everything else
+ } \ No newline at end of file