TouchEvent

时间:2021-7-9 作者:qvyue
TouchEvent
2345截图20210324111918.png

不设置任何事件、

activity: dispatchTouchEvent ACTION_DOWN 0
a: dispatchTouchEvent ACTION_DOWN 0
a: onInterceptTouchEvent ACTION_DOWN 0
b: dispatchTouchEvent ACTION_DOWN 0
b: onInterceptTouchEvent ACTION_DOWN 0
c: dispatchTouchEvent ACTION_DOWN 0
c: onInterceptTouchEvent ACTION_DOWN 0
c: onTouchEvent ACTION_DOWN 0
b: onTouchEvent ACTION_DOWN 0
a: onTouchEvent ACTION_DOWN 0
activity: onTouchEvent ACTION_DOWN 0
activity: dispatchTouchEvent ACTION_MOVE 2
activity: onTouchEvent ACTION_MOVE 2
activity: dispatchTouchEvent ACTION_UP 1
activity: onTouchEvent ACTION_UP 1

c onTouchEvent返回true

手指划出c 亦如此

b: onInterceptTouchEvent ACTION_DOWN 0
c: dispatchTouchEvent ACTION_DOWN 0
c: onInterceptTouchEvent ACTION_DOWN 0
c: onTouchEvent ACTION_DOWN 0
activity: dispatchTouchEvent ACTION_MOVE 2
a: dispatchTouchEvent ACTION_MOVE 2
a: onInterceptTouchEvent ACTION_MOVE 2
b: dispatchTouchEvent ACTION_MOVE 2
b: onInterceptTouchEvent ACTION_MOVE 2
c: dispatchTouchEvent ACTION_MOVE 2
c: onTouchEvent ACTION_MOVE 2
activity: dispatchTouchEvent ACTION_UP 1
a: dispatchTouchEvent ACTION_UP 1
a: onInterceptTouchEvent ACTION_UP 1
b: dispatchTouchEvent ACTION_UP 1
b: onInterceptTouchEvent ACTION_UP 1
c: dispatchTouchEvent ACTION_UP 1
c: onTouchEvent ACTION_UP 1

仅仅b onInterceptTouchEvent 返回 true

并未传递给c

activity: dispatchTouchEvent ACTION_DOWN 0
a: dispatchTouchEvent ACTION_DOWN 0
a: onInterceptTouchEvent ACTION_DOWN 0
b: dispatchTouchEvent ACTION_DOWN 0
b: onInterceptTouchEvent ACTION_DOWN 0
b: onTouchEvent ACTION_DOWN 0
a: onTouchEvent ACTION_DOWN 0
activity: onTouchEvent ACTION_DOWN 0
activity: dispatchTouchEvent ACTION_MOVE 2
activity: onTouchEvent ACTION_MOVE 2
activity: dispatchTouchEvent ACTION_MOVE 2
activity: onTouchEvent ACTION_MOVE 2
activity: dispatchTouchEvent ACTION_MOVE 2
activity: onTouchEvent ACTION_MOVE 2
activity: dispatchTouchEvent ACTION_MOVE 2
activity: onTouchEvent ACTION_MOVE 2
activity: dispatchTouchEvent ACTION_MOVE 2
activity: onTouchEvent ACTION_MOVE 2
activity: dispatchTouchEvent ACTION_UP 1
activity: onTouchEvent ACTION_UP 1

b 在move事件进行拦截

activity: dispatchTouchEvent ACTION_DOWN 0
a: dispatchTouchEvent ACTION_DOWN 0
a: onInterceptTouchEvent ACTION_DOWN 0
b: dispatchTouchEvent ACTION_DOWN 0
b: onInterceptTouchEvent ACTION_DOWN 0
c: dispatchTouchEvent ACTION_DOWN 0
c: onInterceptTouchEvent ACTION_DOWN 0
c: onTouchEvent ACTION_DOWN 0
activity: dispatchTouchEvent ACTION_MOVE 2
a: dispatchTouchEvent ACTION_MOVE 2
a: onInterceptTouchEvent ACTION_MOVE 2
b: dispatchTouchEvent ACTION_MOVE 2
b: onInterceptTouchEvent ACTION_MOVE 2
c: dispatchTouchEvent ACTION_CANCEL 3
c: onTouchEvent ACTION_CANCEL 3  c接收了取消事件
activity: dispatchTouchEvent ACTION_MOVE 2
a: dispatchTouchEvent ACTION_MOVE 2
a: onInterceptTouchEvent ACTION_MOVE 2
b: dispatchTouchEvent ACTION_MOVE 2
b: onTouchEvent ACTION_MOVE 2
activity: onTouchEvent ACTION_MOVE 2

...

activity: onTouchEvent ACTION_MOVE 2
activity: dispatchTouchEvent ACTION_UP 1
a: dispatchTouchEvent ACTION_UP 1
a: onInterceptTouchEvent ACTION_UP 1
b: dispatchTouchEvent ACTION_UP 1
b: onTouchEvent ACTION_UP 1
activity: onTouchEvent ACTION_UP 1
声明:本文内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:qvyue@qq.com 进行举报,并提供相关证据,工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。