publicbooleandispatchTouchEvent(MotionEvent ev) { ...... // 利用disallowIntercept 和 onInterceptTouchEvent 进行是否拦截的判断 if (actionMasked == MotionEvent.ACTION_DOWN || mFirstTouchTarget != null) { finalbooleandisallowIntercept= (mGroupFlags & FLAG_DISALLOW_INTERCEPT) != 0; if (!disallowIntercept) { intercepted = onInterceptTouchEvent(ev); ev.setAction(action); // restore action in case it was changed } else { intercepted = false; } } else { // There are no touch targets and this action is not an initial down // so this view group continues to intercept touches. intercepted = true; }