Created
April 5, 2020 08:53
-
-
Save XjojoX1989/9a99ae371599d9af105b8939661964ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean dispatchTouchEvent(MotionEvent ev) { | |
boolean consume = false; | |
if (onInterceptTouchEvent(ev)) {//表示此根iewGroup攔截這次的點擊事件 | |
consume = onTouchEvent(ev);//流程交給ViewGroup的onTouchEvent處理 | |
} else {//ViewGroup不攔截此次點擊,分發給子元素去處理 | |
consume = child.dispatchTouchEvent(ev);//子元素繼續分發此次點擊事件,如此反覆到事件最後被處理完畢 | |
} | |
return consume; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment