12345678910111213141516171819202122232425262728293031323334353637 |
- package com.cooleshow.base.widgets;
- import android.content.Context;
- import android.util.AttributeSet;
- import android.view.MotionEvent;
- import androidx.viewpager.widget.ViewPager;
- /**
- * 创建日期:2022/5/24 17:54
- *
- * @author Ryan
- * 类说明:
- */
- public class MyViewPage extends ViewPager {
- private boolean willIntercept = true;
- public MyViewPage(Context context, AttributeSet attrs) {
- super(context, attrs);
- // TODO Auto-generated constructor stub
- }
- @Override
- public boolean onInterceptTouchEvent(MotionEvent arg0) {
- if (willIntercept) {
- return super.onInterceptTouchEvent(arg0);
- } else {
- return false;
- }
- }
- public void setTouchIntercept(boolean value) {
- willIntercept = value;
- }
- }
|