zhpanvip / BannerViewPager

🚀 An awesome banner view for Android,Based on ViewPager2. 这可能是全网最好用的ViewPager轮播图。简单、高效,一行代码实现循环轮播,一屏三页任意变,指示器样式任你挑。
Apache License 2.0
3.62k stars 438 forks source link

垂直得 ViewPage2 得fragment中嵌套WebView 滑动冲突 #197

Closed open9527 closed 3 years ago

open9527 commented 3 years ago

垂直得 ViewPage2 得fragment中嵌套WebView WebView 无法滑动

zhpanvip commented 3 years ago

有用到BVP吗?你这是VP2的滑动冲突吧?

open9527 commented 3 years ago

不是 BVP得 ,用 private boolean mClampedY;

@Override
public boolean onTouchEvent(MotionEvent event) {
    if (event.getAction() == MotionEvent.ACTION_DOWN) {
        super.requestDisallowInterceptTouchEvent(!mClampedY);
    }
    return super.onTouchEvent(event);
}

@Override
protected void onOverScrolled(int scrollX, int scrollY, boolean clampedX, boolean clampedY) {
    LogUtils.i(TAG, "onOverScrolled: " + clampedY);
    mClampedY = clampedY;
    if (!clampedY) {
        super.requestDisallowInterceptTouchEvent(true);
    }
    super.onOverScrolled(scrollX, scrollY, clampedX, clampedY);
}

可以处理了,谢谢