takahirom / webview-in-coordinatorlayout

248 stars 71 forks source link

Not working correctly #12

Open ivnsch opened 6 years ago

ivnsch commented 6 years ago

I put this web view in a coordinator layout with another view and attached a behavior to this view. In the behavior I override onNestedPreScroll, where I always consume dy (as a test), so the webview shouldn't scroll, but it still does.

My code works as expected if I just replace this webview with NestedScrollView.

Edit:

I downloaded your example and added this to the behaviour:

@Override
public void onNestedPreScroll(final CoordinatorLayout coordinatorLayout, final LinearLayout child, final View target, final int dx, final int dy, final int[] consumed) {
    consumed[1] = dy;
    super.onNestedPreScroll(coordinatorLayout, child, target, dx, dy, consumed);
}

And the webview still scroll normally. Shouldn't return dy as consumed make it stop scrolling entirely?