Android中提供了ViewGroup、View、Activity三个等级的Touch事件处理。也就是说,这三个地方都有事件回调方法。
测试DEMO视图结构:
<com .orgcent.eventtest.EventLinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#032d3d"
android:orientation="vertical" >
<com .orgcent.eventtest.EventTextView
android:id="@+id/tvEvent"
android:layout_width="fill_parent"
android:layout_height="100dp"
android:gravity="center"
android:textColor="@android:color/black"
android:background="@android:color/white"
android:text="Activity - ViewGroup - View Event http://orgcent.com dispatch Test"/>
</com>
至于三者之间的执行顺序,将在下面详细阐述: