AndroidEvent Distribution Event Distribution 3 steps
dispatchTouchEvent(event)Distribution
onInterceptTouchEvent(event) Intercept
onTouchEvent(event) Processing
requestDisallowInterceptTouchEvent() Sets whether the parent control intercepts events
MotionEventFrom activity acquisition to event, delivery to View , current View , dispatch, interception, and handling.
- Currently
Viwe distributed , onTouchEvent . In handling whether to intercept.
- If
拦截(true) . Then the child control will not pass the event.
onTouchEventThat causes the child control to pass up. If the lowest level is View not processed. is passed to the parent control.
Note: requestDisallowInterceptTouchEvent(true);
To set View whether the parent is blocked from being sent to the current View . flase is to stop. trueis not to stop. The current view can have event handling.
If_2.gif
Introduction to Android Event distribution