aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-09-29 02:49:16 -0700
committerAllan Wang <me@allanwang.ca>2019-09-29 02:49:16 -0700
commit14573f9ac4cb9cfb799e1cd20d78202599d55e25 (patch)
treee37a63bd7dd67f321cfdc29e0cc469a67ab621f1 /app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
parentc8b32c0b37e0aae1a6df607806c6511ed91082f8 (diff)
downloadfrost-14573f9ac4cb9cfb799e1cd20d78202599d55e25.tar.gz
frost-14573f9ac4cb9cfb799e1cd20d78202599d55e25.tar.bz2
frost-14573f9ac4cb9cfb799e1cd20d78202599d55e25.zip
Disable swipe to refresh for composer and sharer urls
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt7
1 files changed, 6 insertions, 1 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 187ab9eb..0988e331 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
@@ -89,7 +89,9 @@ class FrostJSI(val web: FrostWebView) {
@JavascriptInterface
fun longClick(start: Boolean) {
activity?.viewPager?.enableSwipe = !start
- web.parent.swipeEnabled = !start
+ if (web.frostWebClient.urlSupportsRefresh) {
+ web.parent.swipeEnabled = !start
+ }
}
/**
@@ -97,6 +99,9 @@ class FrostJSI(val web: FrostWebView) {
*/
@JavascriptInterface
fun disableSwipeRefresh(disable: Boolean) {
+ if (!web.frostWebClient.urlSupportsRefresh) {
+ return
+ }
web.parent.swipeEnabled = !disable
if (disable) {
// locked onto an input field; ensure content is visible