From 14573f9ac4cb9cfb799e1cd20d78202599d55e25 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 29 Sep 2019 02:49:16 -0700 Subject: Disable swipe to refresh for composer and sharer urls --- app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt') 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 -- cgit v1.2.3