Browse Source

Fix vertical sliding conflict with ViewPager2.

zhpanvip 5 years ago
parent
commit
4eec8082a9

+ 1 - 1
bannerview/build.gradle

@@ -32,7 +32,7 @@ dependencies {
     implementation 'com.android.support:appcompat-v7:27.1.1'
 }
 
-version = "2.7.1"
+version = "2.7.3"
 def siteUrl = 'https://github.com/zhpanvip/BannerViewPager'      // 项目的主页
 def gitUrl = 'https://github.com/zhpanvip/BannerViewPager.git'   // Git仓库的url
 group = "com.zhpan.library" // Maven Group ID for the artifact,一般填你唯一的包名

+ 2 - 0
bannerview/src/main/java/com/zhpan/bannerview/BannerViewPager.java

@@ -140,6 +140,8 @@ public class BannerViewPager<T, VH extends ViewHolder> extends RelativeLayout im
                     } else {
                         getParent().requestDisallowInterceptTouchEvent(true);
                     }
+                } else if (2 * disX < disY) {
+                    getParent().requestDisallowInterceptTouchEvent(false);
                 }
                 break;
             case MotionEvent.ACTION_UP: