Android对touch事件的拦截,在View Tree上的传递顺序

      当发生touch事件时,系统会产生一个MotionEvent并且沿着View Tree开始传递。首先获取MotionEventView Tree的根节点,根节点通常是一个ViewGroupViewGroup将在onInterceptTouchEvent()中获取MotionEvent并决定是否继续向下传递。当在ViewGroup.onInterceptEvent()中返回true时,将截获MotionEventView Tree下面的View将无法获得MotionEvent转而交给当前ViewGrouponTouchEvent()方法。如果onTouchEvent中返回false,那么MotionEvent将沿着View Tree向上传给上一层。拦截的过程草图如下:

参考地址:http://blog.csdn.net/chenshaoyang0011/article/details/7845434

原文地址:https://www.cnblogs.com/albert1017/p/3601999.html