From 4c551386b100ea4b694c1e8f44596ba369e6b068 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Tue, 2 Jul 2019 16:29:28 -0700 Subject: Prevent horizontal swipes if html element can scroll horizontally --- app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt | 5 +++++ 1 file changed, 5 insertions(+) (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 0d980ba0..d75a4f1f 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt @@ -140,4 +140,9 @@ class FrostJSI(val web: FrostWebView) { html ?: return header?.offer(html) } + + @JavascriptInterface + fun allowHorizontalScrolling(enable: Boolean) { + activity?.viewPager?.enableSwipe = enable + } } -- cgit v1.2.3