Touch事件分发机制
Touch事件的整体传递轨迹
参与Touch事件传递的角色及对应方法
Activity
public boolean dispatchTouchEvent(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
onUserInteraction();
}
if (getWindow().superDispatchTouchEvent(ev)) {
return true;
}
return onTouchEvent(ev);
}Window(PhoneWindow)
View
ViewGroup
Last updated