From 7632638fb67c5adad5f65b9e48218d7bf5da1f51 Mon Sep 17 00:00:00 2001 From: dpastor Date: Fri, 26 May 2023 11:58:47 +0200 Subject: [PATCH] ANDROID-13332 Allow NestedScrollWebView internal scrolling blocking programatic configuration (#9) --- .../telefonica/nestedscrollwebview/NestedScrollWebView.java | 4 ++++ .../nestedscrollwebview/helper/InternalScrollDetector.kt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/nestedscrollwebview/src/main/java/com/telefonica/nestedscrollwebview/NestedScrollWebView.java b/nestedscrollwebview/src/main/java/com/telefonica/nestedscrollwebview/NestedScrollWebView.java index 99b6752..ce74999 100644 --- a/nestedscrollwebview/src/main/java/com/telefonica/nestedscrollwebview/NestedScrollWebView.java +++ b/nestedscrollwebview/src/main/java/com/telefonica/nestedscrollwebview/NestedScrollWebView.java @@ -746,6 +746,10 @@ public void setCoordinatorBottomMatchingBehaviourEnabled(boolean enabled) { coordinatorLayoutChildHelper.setBottomMatchingBehaviourEnabled(enabled); } + public void setBlockNestedScrollingOnInternalContentScrollsEnabled(boolean enabled) { + internalScrollDetector.setEnabled(enabled); + } + @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); diff --git a/nestedscrollwebview/src/main/java/com/telefonica/nestedscrollwebview/helper/InternalScrollDetector.kt b/nestedscrollwebview/src/main/java/com/telefonica/nestedscrollwebview/helper/InternalScrollDetector.kt index d2294fb..7739854 100644 --- a/nestedscrollwebview/src/main/java/com/telefonica/nestedscrollwebview/helper/InternalScrollDetector.kt +++ b/nestedscrollwebview/src/main/java/com/telefonica/nestedscrollwebview/helper/InternalScrollDetector.kt @@ -10,7 +10,7 @@ class InternalScrollDetector { private var initialY: Float? = null private var activePointerId: Int = INVALID_POINTER - private var isEnabled = false + private var isEnabled = true fun setEnabled(enabled: Boolean) { if (isEnabled != enabled) {