aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/web/NestedWebView.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-07-02 16:29:28 -0700
committerAllan Wang <me@allanwang.ca>2019-07-02 16:29:28 -0700
commit4c551386b100ea4b694c1e8f44596ba369e6b068 (patch)
treef18e167cf804e70820703e6951060004ef12e774 /app/src/main/kotlin/com/pitchedapps/frost/web/NestedWebView.kt
parent99e70f4489ce210e514c9194cdac288d2de651c4 (diff)
downloadfrost-4c551386b100ea4b694c1e8f44596ba369e6b068.tar.gz
frost-4c551386b100ea4b694c1e8f44596ba369e6b068.tar.bz2
frost-4c551386b100ea4b694c1e8f44596ba369e6b068.zip
Prevent horizontal swipes if html element can scroll horizontally
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/NestedWebView.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/NestedWebView.kt18
1 files changed, 14 insertions, 4 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/NestedWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/NestedWebView.kt
index 7c3c48e7..da0ebf0d 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/NestedWebView.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/NestedWebView.kt
@@ -120,10 +120,20 @@ open class NestedWebView @JvmOverloads constructor(
dxUnconsumed: Int,
dyUnconsumed: Int,
offsetInWindow: IntArray?
- ) = childHelper.dispatchNestedScroll(dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, offsetInWindow)
-
- final override fun dispatchNestedPreScroll(dx: Int, dy: Int, consumed: IntArray?, offsetInWindow: IntArray?) =
- childHelper.dispatchNestedPreScroll(dx, dy, consumed, offsetInWindow)
+ ) = childHelper.dispatchNestedScroll(
+ dxConsumed,
+ dyConsumed,
+ dxUnconsumed,
+ dyUnconsumed,
+ offsetInWindow
+ )
+
+ final override fun dispatchNestedPreScroll(
+ dx: Int,
+ dy: Int,
+ consumed: IntArray?,
+ offsetInWindow: IntArray?
+ ) = childHelper.dispatchNestedPreScroll(dx, dy, consumed, offsetInWindow)
final override fun dispatchNestedFling(velocityX: Float, velocityY: Float, consumed: Boolean) =
childHelper.dispatchNestedFling(velocityX, velocityY, consumed)