做個記錄:
http://www.reibang.com/p/238d1b753e64
//如果子控件處理了事件嚷掠,那么mFirstTouchTarget不為null
if (actionMasked == MotionEvent.ACTION_DOWN
|| mFirstTouchTarget != null) {
//disallowIntercept 一個不攔截的標(biāo)記位
//如果有這個標(biāo)記位,則不攔截
//如果沒有,就去調(diào)用onInterceptTouchEvent來判斷是否攔截
//如果是ACTION_DOWN事件吝岭,那么disallowIntercept為false,因?yàn)橹坝幸粋€清空操作
final boolean disallowIntercept = (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.
//代碼進(jìn)入這里,說明就兩種情況胁赢。1.不是ACTION_DOWN事件 2.mFirstTouchTarget==null,
// 這說明ACTION_DOWN事件已經(jīng)攔截里初,那么接下來的事件都自己處理
intercepted = true;
}