TouchEvent事件研究 spa
一、 Activity事件分析 事件
|
dispatchTouchEvent ci |
onTouchEvent it |
執行結果 table |
1 margin |
Super tab |
Super di |
dispatchTouchEvent à view onTouchEvent vi |
2 |
false |
|
dispatchTouchEvent |
3 |
true |
二、 View and Activity事件分析
Activity |
view |
執行結果 |
||
dispatchTouchEvent(1) |
onTouchEvent(2) |
dispatchTouchEvent(3) |
onTouchEvent(4) |
|
super |
super |
super |
super |
(1),(3),(4),(2) |
super |
super |
false |
super |
(1),(3), (2) |
super |
super |
true |
super |
(1),(3) |
super |
super |
super |
false |
(1),(3),(4),(2) |
super |
super |
true |
(1),(3),(4) |
|
false |
super |
super |
super |
(1) |
true |
super |
super |
super |
(1) |
|
|
|
|
|
三、 ViewGroup and Activity事件分析
Activity |
|
ViewGroup |
|
|
執行結果 |
|||
dispatchTouchEvent(1) |
onTouchEvent(2) |
dispatchTouchEvent(3) |
onInterceptTouchEvent (4) |
onTouchEvent(5) |
|
|||
Super |
Super |
Super |
Super |
Super |
(1),(3),(4),(5),(2) |
|||
Super |
Super |
Super |
Super |
true |
(1), (3),(4),(5),(3)and(5)…… |
|||
Super |
Super |
Super |
Super |
false |
(1), (3),(4),(5),(2)…… |
|||
Super |
Super |
Super |
false |
Super |
(1), (3),(4),(5),(2)……
|
|||
Super |
Super |
Super |
true |
|
|
|||
Super |
Super |
true |
Super |
super |
(1), (3) |
|||
Super |
Super |
false |
Super |
super |
(1), (3),(2) |
|||
true |
Super |
false |
Super |
super |
(1) |
|||
false |
Super |
false |
Super |
super |
(1) |
|||
|
|
|
|
|
|
|||
四、 ViewGroup and View事件分析
View |
ViewGroup |
執行結果 |
|||
dispatchTouchEvent(1) |
onTouchEvent(2) |
dispatchTouchEvent(3) |
onInterceptTouchEvent (4) |
onTouchEvent(5) |
|
Super |
Super |
Super |
Super |
Super |
(3),(4),(1),(2),(5) |
true |
Super |
Super |
Super |
Super |
( (3),(4), 1), (2)…… |
false |
Super |
Super |
Super |
Super |
( (3),(4), 1), (2) |
Super |
Super |
Super |
true |
Super |
(3),(4), (5) |
Super |
Super |
Super |
false |
Super |
(3),(4), (1),(2),(5) |