AndroidTouchEvent总结
默认状态
布局文件
<?xml version="1.0" encoding="utf-8"?>
<com.malinkang.touchsample.widget.MyFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ff0000"
android:orientation="vertical"> <com.malinkang.touchsample.widget.MyLinearLayout
android:layout_width="200dp"
android:layout_height="200dp"
android:background="#00ff00"
android:layout_gravity="center"
android:gravity="center"> <com.malinkang.touchsample.widget.MyTextView
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#0000ff" />
</com.malinkang.touchsample.widget.MyLinearLayout> </com.malinkang.touchsample.widget.MyFrameLayout>
/**
* Created by malinkang on 15/8/24.
*/
public class TouchEventActivity extends Activity { @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.touch_event);
} @Override
public boolean dispatchTouchEvent(MotionEvent ev) {
Log.d("TouchEventActivity","dispatchTouchEvent方法执行"+super.dispatchTouchEvent(ev)+":"+Utils.getNameForEvent(ev));
return super.dispatchTouchEvent(ev);
} @Override
public boolean onTouchEvent(MotionEvent event) {
Log.d("TouchEventActivity", "onTouchEvent执行" +super.onTouchEvent(event)+":"+ Utils.getNameForEvent(event));
return super.onTouchEvent(event);
} }
/**
* Created by malinkang on 15/8/25.
*/
public class MyFrameLayout extends FrameLayout {
public MyFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
} public MyFrameLayout(Context context) {
super(context);
} public MyFrameLayout(Context context, AttributeSet attrs) {
super(context, attrs);
} @Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
Log.d("MyFrameLayout", "onInterceptTouchEvent方法执行" + super.onInterceptTouchEvent(ev) + ":" + Utils.getNameForEvent(ev));
return super.onInterceptTouchEvent(ev);
} @Override
public boolean dispatchTouchEvent(MotionEvent ev) {
Log.d("MyFrameLayout", "dispatchTouchEvent方法执行:" + super.dispatchTouchEvent(ev) + ":" + Utils.getNameForEvent(ev));
return super.dispatchTouchEvent(ev);
} @Override
public boolean onTouchEvent(MotionEvent event) {
Log.d("MyFrameLayout", "onTouchEvent执行" + super.onTouchEvent(event) + ":" + Utils.getNameForEvent(event));
return super.onTouchEvent(event);
}
}
/**
* Created by malinkang on 15/8/24.
*/
public class MyLinearLayout extends LinearLayout {
public MyLinearLayout(Context context) {
super(context);
} public MyLinearLayout(Context context, AttributeSet attrs) {
super(context, attrs);
} public MyLinearLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
} @Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
Log.d("MyLinearLayout","onInterceptTouchEvent方法执行"+ super.onInterceptTouchEvent(ev)+":"+Utils.getNameForEvent(ev));
return super.onInterceptTouchEvent(ev);
} @Override
public boolean dispatchTouchEvent(MotionEvent ev) {
Log.d("MyLinearLayout","dispatchTouchEvent方法执行:"+super.dispatchTouchEvent(ev)+":"+Utils.getNameForEvent(ev));
return super.dispatchTouchEvent(ev);
} @Override
public boolean onTouchEvent(MotionEvent event) {
Log.d("MyLinearLayout","onTouchEvent执行" +super.onTouchEvent(event)+":"+Utils.getNameForEvent(event));
return super.onTouchEvent(event);
}
}
/**
* Created by malinkang on 15/8/24.
*/
public class MyTextView extends TextView {
public MyTextView(Context context) {
super(context);
} public MyTextView(Context context, AttributeSet attrs) {
super(context, attrs);
} public MyTextView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
} @Override
public boolean onTouchEvent(MotionEvent event) {
Log.d("MyTextView", "onTouchEvent执行" + super.onTouchEvent(event) + ":" + Utils.getNameForEvent(event));
return super.onTouchEvent(event); } }
log
08-25 10:49:48.699 17390-17390/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:49:48.699 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:49:48.699 17390-17390/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.699 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.699 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:false:ACTION_DOWN
08-25 10:49:48.699 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:49:48.699 17390-17390/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.699 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.699 17390-17390/com.malinkang.touchsample D/MyFrameLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.699 17390-17390/com.malinkang.touchsample D/MyFrameLayout﹕ dispatchTouchEvent方法执行:false:ACTION_DOWN
08-25 10:49:48.709 17390-17390/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:49:48.709 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:49:48.714 17390-17390/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.714 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.714 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:false:ACTION_DOWN
08-25 10:49:48.714 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:49:48.714 17390-17390/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.714 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.714 17390-17390/com.malinkang.touchsample D/MyFrameLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.714 17390-17390/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.714 17390-17390/com.malinkang.touchsample D/TouchEventActivity﹕ dispatchTouchEvent方法执行false:ACTION_DOWN
08-25 10:49:48.714 17390-17390/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:49:48.714 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:49:48.714 17390-17390/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.714 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.719 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:false:ACTION_DOWN
08-25 10:49:48.719 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:49:48.719 17390-17390/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.719 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.719 17390-17390/com.malinkang.touchsample D/MyFrameLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.719 17390-17390/com.malinkang.touchsample D/MyFrameLayout﹕ dispatchTouchEvent方法执行:false:ACTION_DOWN
08-25 10:49:48.719 17390-17390/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:49:48.719 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:49:48.719 17390-17390/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.719 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.719 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:false:ACTION_DOWN
08-25 10:49:48.719 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:49:48.719 17390-17390/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.719 17390-17390/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.719 17390-17390/com.malinkang.touchsample D/MyFrameLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.719 17390-17390/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_DOWN
08-25 10:49:48.744 17390-17390/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_MOVE
08-25 10:49:48.744 17390-17390/com.malinkang.touchsample D/TouchEventActivity﹕ dispatchTouchEvent方法执行false:ACTION_MOVE
08-25 10:49:48.744 17390-17390/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_MOVE
08-25 10:49:48.809 17390-17390/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_MOVE
08-25 10:49:48.809 17390-17390/com.malinkang.touchsample D/TouchEventActivity﹕ dispatchTouchEvent方法执行false:ACTION_MOVE
08-25 10:49:48.809 17390-17390/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_MOVE
08-25 10:49:48.839 17390-17390/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_UP
08-25 10:49:48.839 17390-17390/com.malinkang.touchsample D/TouchEventActivity﹕ dispatchTouchEvent方法执行false:ACTION_UP
08-25 10:49:48.839 17390-17390/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_UP
TextView的onTouchEvent返回true
08-25 10:57:56.874 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:57:56.874 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:57:56.874 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_DOWN
08-25 10:57:56.874 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:true:ACTION_DOWN
08-25 10:57:56.874 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_CANCEL
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_DOWN
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ dispatchTouchEvent方法执行:true:ACTION_DOWN
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_CANCEL
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_CANCEL
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:true:ACTION_CANCEL
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_CANCEL
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_DOWN
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:true:ACTION_DOWN
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_CANCEL
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_DOWN
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/TouchEventActivity﹕ dispatchTouchEvent方法执行true:ACTION_DOWN
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_CANCEL
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_CANCEL
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_CANCEL
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:true:ACTION_CANCEL
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_CANCEL
08-25 10:57:56.879 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ dispatchTouchEvent方法执行:false:ACTION_CANCEL
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ onTouchEvent执行false:ACTION_CANCEL
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_DOWN
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:true:ACTION_DOWN
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_CANCEL
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_DOWN
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ dispatchTouchEvent方法执行:true:ACTION_DOWN
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_CANCEL
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_CANCEL
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:true:ACTION_CANCEL
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_CANCEL
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_DOWN
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:true:ACTION_DOWN
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_CANCEL
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 10:57:56.884 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_DOWN
08-25 10:57:56.929 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_MOVE
08-25 10:57:56.929 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_MOVE
08-25 10:57:56.929 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_MOVE
08-25 10:57:56.929 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:true:ACTION_MOVE
08-25 10:57:56.929 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_MOVE
08-25 10:57:56.929 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_MOVE
08-25 10:57:56.929 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ dispatchTouchEvent方法执行:true:ACTION_MOVE
08-25 10:57:56.929 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_MOVE
08-25 10:57:56.929 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:true:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/TouchEventActivity﹕ dispatchTouchEvent方法执行true:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:true:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ dispatchTouchEvent方法执行:true:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:true:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_MOVE
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_UP
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行false:ACTION_UP
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyTextView﹕ onTouchEvent执行true:ACTION_UP
08-25 10:57:56.934 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:true:ACTION_UP
08-25 10:57:56.939 23744-23744/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_UP
08-25 10:57:56.939 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ dispatchTouchEvent方法执行:false:ACTION_UP
08-25 10:57:56.939 23744-23744/com.malinkang.touchsample D/MyFrameLayout﹕ onTouchEvent执行false:ACTION_UP
08-25 10:57:56.939 23744-23744/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_UP
08-25 10:57:56.939 23744-23744/com.malinkang.touchsample D/TouchEventActivity﹕ dispatchTouchEvent方法执行false:ACTION_UP
08-25 10:57:56.939 23744-23744/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_UP
LinearLayout的onInterceptTouchEvent 修改为true
08-25 11:16:52.144 5739-5739/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 11:16:52.144 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行true:ACTION_DOWN
08-25 11:16:52.144 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:false:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行true:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyFrameLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyFrameLayout﹕ dispatchTouchEvent方法执行:false:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行true:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:false:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行true:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyFrameLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ dispatchTouchEvent方法执行false:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行true:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:false:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行true:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyFrameLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 11:16:52.149 5739-5739/com.malinkang.touchsample D/MyFrameLayout﹕ dispatchTouchEvent方法执行:false:ACTION_DOWN
08-25 11:16:52.154 5739-5739/com.malinkang.touchsample D/MyFrameLayout﹕ onInterceptTouchEvent方法执行false:ACTION_DOWN
08-25 11:16:52.154 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行true:ACTION_DOWN
08-25 11:16:52.154 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 11:16:52.154 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ dispatchTouchEvent方法执行:false:ACTION_DOWN
08-25 11:16:52.154 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ onInterceptTouchEvent方法执行true:ACTION_DOWN
08-25 11:16:52.154 5739-5739/com.malinkang.touchsample D/MyLinearLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 11:16:52.154 5739-5739/com.malinkang.touchsample D/MyFrameLayout﹕ onTouchEvent执行false:ACTION_DOWN
08-25 11:16:52.154 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_DOWN
08-25 11:16:52.169 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_MOVE
08-25 11:16:52.169 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ dispatchTouchEvent方法执行false:ACTION_MOVE
08-25 11:16:52.169 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_MOVE
08-25 11:16:52.204 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_MOVE
08-25 11:16:52.204 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ dispatchTouchEvent方法执行false:ACTION_MOVE
08-25 11:16:52.204 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_MOVE
08-25 11:16:52.219 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_MOVE
08-25 11:16:52.224 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ dispatchTouchEvent方法执行false:ACTION_MOVE
08-25 11:16:52.224 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_MOVE
08-25 11:16:52.234 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_MOVE
08-25 11:16:52.234 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ dispatchTouchEvent方法执行false:ACTION_MOVE
08-25 11:16:52.234 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_MOVE
08-25 11:16:52.234 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_UP
08-25 11:16:52.234 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ dispatchTouchEvent方法执行false:ACTION_UP
08-25 11:16:52.234 5739-5739/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_UP
MyFrameLayout的dispatchTouchEvent返回true
08-25 11:22:56.009 9414-9414/com.malinkang.touchsample D/MyFrameLayout﹕ dispatchTouchEvent方法执行:true:ACTION_DOWN
08-25 11:22:56.009 9414-9414/com.malinkang.touchsample D/TouchEventActivity﹕ dispatchTouchEvent方法执行true:ACTION_DOWN
08-25 11:22:56.009 9414-9414/com.malinkang.touchsample D/MyFrameLayout﹕ dispatchTouchEvent方法执行:true:ACTION_CANCEL
08-25 11:22:56.014 9414-9414/com.malinkang.touchsample D/MyFrameLayout﹕ dispatchTouchEvent方法执行:true:ACTION_DOWN
08-25 11:22:56.034 9414-9414/com.malinkang.touchsample D/MyFrameLayout﹕ dispatchTouchEvent方法执行:true:ACTION_MOVE
08-25 11:22:56.034 9414-9414/com.malinkang.touchsample D/TouchEventActivity﹕ dispatchTouchEvent方法执行true:ACTION_MOVE
08-25 11:22:56.034 9414-9414/com.malinkang.touchsample D/MyFrameLayout﹕ dispatchTouchEvent方法执行:true:ACTION_MOVE
08-25 11:22:56.034 9414-9414/com.malinkang.touchsample D/MyFrameLayout﹕ dispatchTouchEvent方法执行:true:ACTION_UP
08-25 11:22:56.034 9414-9414/com.malinkang.touchsample D/TouchEventActivity﹕ dispatchTouchEvent方法执行true:ACTION_UP
08-25 11:22:56.034 9414-9414/com.malinkang.touchsample D/TouchEventActivity﹕ onTouchEvent执行false:ACTION_UP
http://www.cnblogs.com/sunzn/archive/2013/05/10/3064129.html
AndroidTouchEvent总结的更多相关文章
- View,ViewGroup的Touch事件的分发机制
原帖地址:http://blog.csdn.net/xiaanming/article/details/21696315 ViewGroup的事件分发机制 我们用手指去触摸Android手机屏幕,就会 ...
- ViewGroup的事件分发机制
我们用手指去触摸Android手机屏幕,就会产生一个触摸事件,但是这个触摸事件在底层是怎么分发的呢?这个我还真不知道,这里涉及到操作硬件 (手机屏幕)方面的知识,也就是Linux内核方面的知识,我也没 ...
- Andriod 从源码的角度详解View,ViewGroup的Touch事件的分发机制
转自:xiaanming的博客(http://blog.csdn.net/xiaanming/article/details/21696315) 今天这篇文章主要分析的是Android的事件分发机制, ...
- 一文读懂 Android TouchEvent 事件分发、拦截、处理过程
什么是事件?事件是用户触摸手机屏幕,引起的一系列TouchEvent,包括ACTION_DOWN.ACTION_MOVE.ACTION_UP.ACTION_CANCEL等,这些action组合后变成点 ...
随机推荐
- nginx编译支持HTTP2.0
nginx编译支持HTTP2.0 nginx编译支持HTTP2.0 wget https://www.openssl.org/source/openssl-1.1.0i.tar.gz #openssl ...
- js 函数基础(方便复习使用)
// 函数声明: function bbq(){ // ..... } // 函数表达式: // 1.命名函数表达式 var test = function abc(){ document.write ...
- 洛谷 P1572 计算分数
P1572 计算分数 题目描述 Csh被老妈关在家里做分数计算题,但显然他不愿意坐这么多复杂的计算.况且在家门口还有Xxq在等着他去一起看电影.为了尽快地能去陪Xxq看电影,他把剩下的计算题交给了你, ...
- Struts2学习(三)上传下载
今天记录一下利用struts2实现上传下载,借此案例说明一下struts2的开发流程. 须要注意的是struts2版本号不同非常多地方的写法是不同的.本例使用struts2.3.15 .有差别的地方文 ...
- 《Effective Modern C++》翻译--条款4:了解怎样查看推导出的类型
条款4:了解怎样查看推导出的类型 那些想要了解编译器怎样推导出的类型的人通常分为两个阵营. 第一种阵营是实用主义者.他们的动力通常来自于编敲代码过程中(比如他们还在调试解决中),他们利用编译器进行寻找 ...
- codeforces #313(div 2)
B. Gerald is into Art time limit per test 2 seconds memory limit per test 256 megabytes input standa ...
- 安卓实训第四天--基于HttpClient来完毕数据在server和设备间的交互。
上午:老师首先回想了昨天作业. 首先在安卓project中的TOOLS文件里,解析字节流那里,不用改变.而是把server端的编码方式变为UTF-8,然后将在安卓project的LoginActivi ...
- pycharm第一个Python程序
print ("Hello word!"); 这是Python3.xx的语法!
- tomcat到底是干什么用的?用大白话讲一下
通俗点说他是jsp网站的服务器之一,就像asp网站要用到微软的IIS服务器,php网站用apache服务器一样,因为你的jsp动态网站使用脚本语言等写的,需要有服务器来解释你的语言吧,服务器就是这个功 ...
- 1570. [POJ3461]乌力波
★☆ 输入文件:oulipo.in 输出文件:oulipo.out 简单对比时间限制:1 s 内存限制:256 MB [题目描述] 法国作家乔治·佩雷克(Georges Perec,1 ...