Android 事情处理全部分析-Android-优质IT资源分享社区

admin
管理员
管理员
  • UID1
  • 粉丝30
  • 关注4
  • 发帖数581
  • 社区居民
  • 忠实会员
  • 原创写手
阅读:257回复:0

  Android 事情处理全部分析

楼主#
更多 发布于:2016-05-19 16:06

Android 事情处理机制说难也不难,说简略也不简略,为何这么说呢?由于我信任大多数有了一定 Android 根底的同学,想要分析 Android 事情处理机制,都是能够分析出来了;但要灵活运用它却又觉得很费劲,而且通常需求查阅各种材料文档,才干真实把它运用起来。今日我带领咱们对 Android 事情处理机制做一次全方位的分析,然后到达咱们对 Android 事情处理有一个更深、更形象的知道!

一、初体验:

信任大多数的人对 Android 事情处理机制的分析,都是经过打印 log 的办法,这儿也是经过这种办法来分析;首要预备三个类 MainActivity 、EventLayout 、EventTextView ,这几个类别离是啥都做了些啥呢?咱们看看代码就知道。

1、MainActivity

public class MainActivity extends ActionBarActivity {

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

}

public boolean dispatchTouchEvent(MotionEvent ev) {

boolean handle = false ;

String str  = "ACTION_DOWN";

switch (ev.getAction()){

case MotionEvent.ACTION_DOWN:

str = "ACTION_DOWN";

break ;

case MotionEvent.ACTION_MOVE:

str = "ACTION_MOVE";

handle = true ;

break;

case MotionEvent.ACTION_UP:

str = "ACTION_UP";

break;

}

Log.v("zgy","=====Activity=====dispatchTouchEvent========"+str) ;

return super.dispatchTouchEvent(ev);

}

public boolean onTouchEvent(MotionEvent event) {

String str  = "ACTION_DOWN";

boolean handle = false ;

switch (event.getAction()){

case MotionEvent.ACTION_DOWN:

str = "ACTION_DOWN";

break ;

case MotionEvent.ACTION_MOVE:

str = "ACTION_MOVE";

handle = true ;

break;

case MotionEvent.ACTION_UP:

str = "ACTION_UP";

break;

}

Log.v("zgy","=====Activity=====onTouchEvent========"+str) ;

return super.onTouchEvent(event);

}

}

2、EventLayout

/**

* Created by gyzhong on 15/2/18.

*/

public class EventLayout extends LinearLayout {

public EventLayout(Context context) {

super(context);

}

public EventLayout(Context context, AttributeSet attrs) {

super(context, attrs);

}

public EventLayout(Context context, AttributeSet attrs, int defStyleAttr) {

super(context, attrs, defStyleAttr);

}

public boolean onInterceptTouchEvent(MotionEvent ev) {

String str  = "ACTION_DOWN";

switch (ev.getAction()){

case MotionEvent.ACTION_DOWN:

str = "ACTION_DOWN";

break ;

case MotionEvent.ACTION_MOVE:

str = "ACTION_MOVE";

break;

case MotionEvent.ACTION_UP:

str = "ACTION_UP";

break;

}

Log.v("zgy", "=====ViewGroup=====onInterceptTouchEvent========"+str) ;

if(handle){

return handle ;

}

return super.onInterceptTouchEvent(ev);

}

public boolean dispatchTouchEvent(MotionEvent ev) {

boolean handle = false ;

switch (ev.getAction()){

case MotionEvent.ACTION_DOWN:

str = "ACTION_DOWN";

break ;

case MotionEvent.ACTION_MOVE:

str = "ACTION_MOVE";

break;

case MotionEvent.ACTION_UP:

str = "ACTION_UP";

break;

}

Log.v("zgy", "=====ViewGroup=====dispatchTouchEvent========"+str) ;

if(handle){

return handle ;

}

return super.dispatchTouchEvent(ev);

}

public boolean onTouchEvent(MotionEvent event) {

String str  = "ACTION_DOWN";

switch (event.getAction()){

case MotionEvent.ACTION_DOWN:

str = "ACTION_DOWN";

break ;

case MotionEvent.ACTION_MOVE:

str = "ACTION_MOVE";

break;

case MotionEvent.ACTION_UP:

str = "ACTION_UP";

break;

}

Log.v("zgy","=====ViewGroup=====onTouchEvent========"+str) ;

return super.onTouchEvent(event);

}

}

3、EventTextView

/**

* Created by gyzhong on 15/2/18.

*/

public class EventTextView extends TextView {

public EventTextView(Context context) {

super(context);

}

public EventTextView(Context context, AttributeSet attrs) {

super(context, attrs);

}

public EventTextView(Context context, AttributeSet attrs, int defStyleAttr) {

super(context, attrs, defStyleAttr);

}

public boolean dispatchTouchEvent(MotionEvent ev) {

String str  = "ACTION_DOWN";

switch (ev.getAction()){

case MotionEvent.ACTION_DOWN:

str = "ACTION_DOWN";

break ;

case MotionEvent.ACTION_MOVE:

str = "ACTION_MOVE";

break;

case MotionEvent.ACTION_UP:

str = "ACTION_UP";

break;

}

Log.v("zgy", "=====View=====dispatchTouchEvent========"+str+ ",getX() ="+ev.getX()) ;

return super.dispatchTouchEvent(ev);

}

public boolean onTouchEvent(MotionEvent event) {

String str  = "ACTION_DOWN";

boolean handle = false ;

switch (event.getAction()){

case MotionEvent.ACTION_DOWN:

str = "ACTION_DOWN";

break ;

case MotionEvent.ACTION_MOVE:

str = "ACTION_MOVE";

break;

case MotionEvent.ACTION_UP:

str = "ACTION_UP";

break;

}

Log.v("zgy","=====View=====onTouchEvent========"+str) ;

return super.onTouchEvent(event);

}

}

经过代码能够看到,3个类基本上啥都没做,仅仅重写了父类的dispatchTouchEvent、onTouchEvent、onInterceptTouchEvent办法,也仅仅在其中加入了调试信息,那再来看看 xml

<com.gyzhong.eventdemo.eventlayout xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:orientation="vertical"

android:layout_gravity="center_horizontal"

>

<com.gyzhong.eventdemo.eventtextview</com.gyzhong.eventdemo.eventtextview<>

android:layout_width="120dp"

android:layout_height="60dp"

android:gravity="center"

android:text="eventText"/>

这儿把咱们重写的 自定义的 View 放入规划中。运转代码,开端调试,然后点击EventTextView能够看到 log 信息:

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====View=====dispatchTouchEvent========ACTION_DOWN

=====View=====onTouchEvent========ACTION_DOWN

=====ViewGroup=====onTouchEvent========ACTION_DOWN

=====Activity=====onTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

经过信息和联系咱们所学的知识点,仍是很简单得出定论来:

Activity 的 dispatchTouchEvent的事情分发给ViewGroup,ViewGroup先经过事情阻拦onInterceptTouchEvent(只需 ViewGroup 才有此办法)来判别,是不是阻拦,假如没有阻拦则将事情分发给 View 的分发机制dispatchTouchEvent;View 获取到事情后,就开端调用 onTouchEvent 办法,假如 View 的 onTouchEvent 未把事情花费掉,则把事情有传递给 ViewGroup 的 onTouchEvent,同理,ViewGroup 未把事情花费掉,持续往下级传到了 Activity 的 onTouchEvent 事情处理中。文字解说终究是有点难了解,需求联系图文来解说,那么咱们来看下下面这张图,应当很明晰明晰。

经过上图,咱们能够得出以下几点定论:

1、Android 事情传递是层级传递的;

2、dispatchTouchEvent从底层向上层传递,而onTouchEvent刚好相反;

3、onInterceptTouchEvent回来为 true 时,将履行同层级的onTouchEvent,而dispatchTouchEvent和onTouchEvent回来 true 时,将停止事情的传递。

上面咱们提到了两个关键字,阻拦和花费,本来都是图像中表明的 return 回来值,在 dispatchTouchEvent 咱们习气用阻拦,而在 onTouchEvent 中则习气用花费来阐明(自个习气罢了)。return false 表明事情未被dispatchTouchEvent阻拦,也未被onTouchEvent花费。好了,到此咱们的Android 事情处理机制分析完了,谢谢咱们的阅览。汗、汗、汗、、、 真的分析完了吗,假如仅仅这么就结束了,我也不会在大过年的,在这儿苦逼苦逼的写 blog。那么接下来咱们进入第二阶段。

二、深度分析

还记住前面第一阶段的标题”初体验”为何叫初体验呢?大致能够认为是咱们的第一印象,咱们开始感受出来的东西。无论是依据自个的逻辑来推理,仍是依据刚刚咱们看到的调试信息来看,事情处理机的制整体流程都是依照上面图1-1的流程来走的。可是,仔细的同学必定看到了最终两行调试信息

=====Activity=====dispatchTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

对,你没有看错,我也没有调错,ACTION_UP的时分它确实只打印了两行,并都是在 Activity 中打印的。并不像 ACTION_DOWN 的时分履行了

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====View=====dispatchTouchEvent========ACTION_DOWN

=====View=====onTouchEvent========ACTION_DOWN

=====ViewGroup=====onTouchEvent========ACTION_DOWN

=====Activity=====onTouchEvent========ACTION_DOWN

也许这么看还不显着,再来看看一下调试信息

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====View=====dispatchTouchEvent========ACTION_DOWN

=====View=====onTouchEvent========ACTION_DOWN

=====ViewGroup=====onTouchEvent========ACTION_DOWN

=====Activity=====onTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

这儿能够看到只需在 ACTION_DOWN 的时分是依照咱们分析的流程图来履行,而 ACTION_MOVE、ACTION_UP 都仅仅履行了 Activity 的dispatchTouchEvent和onTouchEvent,这是为何?莫非咱们不是依照上面那张流程图的流程来履行?这儿我能够必定的通知咱们,上面那张图的流程是肯定没有疑问的,仅仅有些事情被阻拦或花费掉。而且这儿通知咱们一个定论:

ViewGroup 和 View的dispatchTouchEvent分发事情在 action 为ACTION_DOWN时没有被阻拦且onTouchEvent的处理事情在 action 为ACTION_DOWN时未被花费,当 action 为ACTION_MOVE或ACTION_UP时,dispatchTouchEvent和onTouchEvent只需在 activity 被调用。想搞清楚和验证这个定论的同学,能够自个依据源码深化探究!

经过以上定论,可知,在手指滑动或许抬起的时分,ViewGroup 和 View 的dispatchTouchEvent和onTouchEvent未被履行,由于事情未被阻拦或许花费。

我在网上看过一些 Android 事情处理机制的帖子和 bolg,我记住有这么一个疑问,为何我在分析 Android 事情处理的时分,用 TextView 和 Button ,分析出来的成果不相同呢?这儿咱们用的是 TextView 分析的,咱们也来看看 Button 的作用,究竟哪里不相同。新建一个 EventButton类和 EventTextView 相同,除了承继的目标不一样之外。

EventButton

/**

* Created by gyzhong on 15/2/18.

*/

public class EventButton extends Button {

public EventButton(Context context) {

super(context);

}

public EventButton(Context context, AttributeSet attrs) {

super(context, attrs);

}

public EventButton(Context context, AttributeSet attrs, int defStyleAttr) {

super(context, attrs, defStyleAttr);

}

public boolean dispatchTouchEvent(MotionEvent ev) {

String str  = "ACTION_DOWN";

switch (ev.getAction()){

case MotionEvent.ACTION_DOWN:

str = "ACTION_DOWN";

break ;

case MotionEvent.ACTION_MOVE:

str = "ACTION_MOVE";

break;

case MotionEvent.ACTION_UP:

str = "ACTION_UP";

break;

}

Log.v("zgy", "=====View=====dispatchTouchEvent========"+str+ ",getX() ="+ev.getX()) ;

return super.dispatchTouchEvent(ev);

}

public boolean onTouchEvent(MotionEvent event) {

String str  = "ACTION_DOWN";

boolean handle = false ;

switch (event.getAction()){

case MotionEvent.ACTION_DOWN:

str = "ACTION_DOWN";

break ;

case MotionEvent.ACTION_MOVE:

str = "ACTION_MOVE";

break;

case MotionEvent.ACTION_UP:

str = "ACTION_UP";

break;

}

Log.v("zgy","=====View=====onTouchEvent========"+str) ;

return super.onTouchEvent(event);

}

}

记住别忘记修正 xml 中的内容

<com.gyzhong.eventdemo.eventlayout xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:orientation="vertical"

android:layout_gravity="center_horizontal"

>

<com.gyzhong.eventdemo.eventbutton</com.gyzhong.eventdemo.eventbutton<>

android:layout_width="120dp"

android:layout_height="60dp"

android:gravity="center"

android:text="eventButton"/>

再次运转代码,果然,成果不相同

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====View=====dispatchTouchEvent========ACTION_DOWN

=====View=====onTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====ViewGroup=====dispatchTouchEvent========ACTION_MOVE

=====ViewGroup=====onInterceptTouchEvent========ACTION_MOVE

=====View=====dispatchTouchEvent========ACTION_MOVE

=====View=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====ViewGroup=====dispatchTouchEvent========ACTION_MOVE

=====ViewGroup=====onInterceptTouchEvent========ACTION_MOVE

=====View=====dispatchTouchEvent========ACTION_MOVE

=====View=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

=====ViewGroup=====dispatchTouchEvent========ACTION_UP

=====ViewGroup=====onInterceptTouchEvent========ACTION_UP

=====View=====dispatchTouchEvent========ACTION_UP

=====View=====onTouchEvent========ACTION_UP

咱们依据调试成果再加上流程图不难推测出,在 View 的 onTouchEvent 的事情处理机制中把事情花费掉了,而且在 action 为 ACTION_DOWN、ACTION_MOVE、ACTION_UP 的时分全部花费掉了,所以不会再往下履行,那咱们就来看看源码是不是如此。

进入到 View 的onTouchEvent办法中

public boolean onTouchEvent(MotionEvent event) {

//省掉有些代码

if (((viewFlags & CLICKABLE) == CLICKABLE ||

(viewFlags & LONG_CLICKABLE) == LONG_CLICKABLE)) {

}

//省掉许多代码

return true;

}

return false;

}

以上代码,我把有用的几行获取出来了,能够看到,有一个判别条件,假如 View 是能够点击的状况,return true 事情将会被花费掉,不然 return false 不会被花费掉。而咱们都知道 TextView 默许状况是不行点击的, Button 是能够点击的,所以这也即是为何 TextView 和 Button 的调试作用不相同,假如把 Button 设为不行点击,作用就和 TextView 的完全相同,有爱好的同学能够自个尝试一下。

四、总结

讲了那么多,本来中心即是那张图像,只需把握了那张图像中事情的流程基本上就没啥疑问了;

这张图反响出来的信息有:

1、Android 事情传递是层级传递的;

2、dispatchTouchEvent从初级向上级传递,而onTouchEvent刚好相反;

3、onInterceptTouchEvent回来为 true 时,将履行同级的onTouchEvent,而dispatchTouchEvent和onTouchEvent回来 true 时,将停止事情的传递。

还有一点特别主要,也是比较难了解的一点,即是我前面说的那个定论。

ViewGroup 和 View的dispatchTouchEvent分发事情在 action 为ACTION_DOWN时没有被阻拦且onTouchEvent的处理事情在 action 为ACTION_DOWN时未被花费,当 action 为ACTION_MOVE或ACTION_UP时,dispatchTouchEvent和onTouchEvent只需在 activity 被调用。

最终我将在下篇 blog 中,经过自定义通用型的下拉刷新来实战事情处理机制,假如有爱好的同学,能够重视。

这儿附上一张 时序图和log 信息

Activity dispatchTouchEvent——->Action == ACTION_DOWN return true

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

Activity dispatchTouchEvent——->Action == ACTION_MOVE return true

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====View=====dispatchTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

Activity dispatchTouchEvent——->Action == ACTION_UP return true

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====View=====dispatchTouchEvent========ACTION_DOWN

=====View=====onTouchEvent========ACTION_DOWN

=====ViewGroup=====onTouchEvent========ACTION_DOWN

=====Activity=====onTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

ViewGroup dispatchTouchEvent——->Action == ACTION_DOWN return true

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====ViewGroup=====dispatchTouchEvent========ACTION_MOVE

=====ViewGroup=====onTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====ViewGroup=====dispatchTouchEvent========ACTION_MOVE

=====ViewGroup=====onTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====ViewGroup=====dispatchTouchEvent========ACTION_MOVE

=====ViewGroup=====onTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

=====ViewGroup=====dispatchTouchEvent========ACTION_UP

=====ViewGroup=====onTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

ViewGroup dispatchTouchEvent——->Action == ACTION_MOVE return true

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====View=====dispatchTouchEvent========ACTION_DOWN

=====View=====onTouchEvent========ACTION_DOWN

=====ViewGroup=====onTouchEvent========ACTION_DOWN

=====Activity=====onTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

ViewGroup dispatchTouchEvent——->Action == ACTION_UP return true

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====View=====dispatchTouchEvent========ACTION_DOWN

=====View=====onTouchEvent========ACTION_DOWN

=====ViewGroup=====onTouchEvent========ACTION_DOWN

=====Activity=====onTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

ViewGroup onInterceptTouchEvent——->Action == ACTION_DOWN return true

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====ViewGroup=====onTouchEvent========ACTION_DOWN

=====Activity=====onTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

View dispatchTouchEvent——->Action == ACTION_DOWN return true

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====View=====dispatchTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====ViewGroup=====dispatchTouchEvent========ACTION_MOVE

=====ViewGroup=====onInterceptTouchEvent========ACTION_MOVE

=====View=====dispatchTouchEvent========ACTION_MOVE

=====View=====onTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

=====ViewGroup=====dispatchTouchEvent========ACTION_UP

=====ViewGroup=====onInterceptTouchEvent========ACTION_UP

=====View=====dispatchTouchEvent========ACTION_UP

=====View=====onTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

View dispatchTouchEvent——->Action == ACTION_MOVE return true

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====View=====dispatchTouchEvent========ACTION_DOWN

=====View=====onTouchEvent========ACTION_DOWN

=====ViewGroup=====onTouchEvent========ACTION_DOWN

=====Activity=====onTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

View dispatchTouchEvent——->Action == ACTION_UP return true

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====View=====dispatchTouchEvent========ACTION_DOWN

=====View=====onTouchEvent========ACTION_DOWN

=====ViewGroup=====onTouchEvent========ACTION_DOWN

=====Activity=====onTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

View onTouchEvent ——->Action == ACTION_DOWN return true

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====View=====dispatchTouchEvent========ACTION_DOWN

=====View=====onTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====ViewGroup=====dispatchTouchEvent========ACTION_MOVE

=====ViewGroup=====onInterceptTouchEvent========ACTION_MOVE

=====View=====dispatchTouchEvent========ACTION_MOVE

=====View=====onTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

=====ViewGroup=====dispatchTouchEvent========ACTION_UP

=====ViewGroup=====onInterceptTouchEvent========ACTION_UP

=====View=====dispatchTouchEvent========ACTION_UP

=====View=====onTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

View onTouchEvent ——->Action == ACTION_MOVE return true

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====View=====dispatchTouchEvent========ACTION_DOWN

=====View=====onTouchEvent========ACTION_DOWN

=====ViewGroup=====onTouchEvent========ACTION_DOWN

=====Activity=====onTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

View onTouchEvent ——->Action == ACTION_UP return true

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====View=====dispatchTouchEvent========ACTION_DOWN

=====View=====onTouchEvent========ACTION_DOWN

=====ViewGroup=====onTouchEvent========ACTION_DOWN

=====Activity=====onTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

ViewGroup onTouchEvent ——->Action == ACTION_DOWN return true

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====View=====dispatchTouchEvent========ACTION_DOWN

=====View=====onTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====ViewGroup=====dispatchTouchEvent========ACTION_MOVE

=====ViewGroup=====onTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

=====ViewGroup=====dispatchTouchEvent========ACTION_UP

=====ViewGroup=====onTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

ViewGroup onTouchEvent ——->Action == ACTION_MOVE return true

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====View=====dispatchTouchEvent========ACTION_DOWN

=====View=====onTouchEvent========ACTION_DOWN

=====ViewGroup=====onTouchEvent========ACTION_DOWN

=====Activity=====onTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

ViewGroup onTouchEvent ——->Action == ACTION_UP return true

=====Activity=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====dispatchTouchEvent========ACTION_DOWN

=====ViewGroup=====onInterceptTouchEvent========ACTION_DOWN

=====View=====dispatchTouchEvent========ACTION_DOWN

=====View=====onTouchEvent========ACTION_DOWN

=====ViewGroup=====onTouchEvent========ACTION_DOWN

=====Activity=====onTouchEvent========ACTION_DOWN

=====Activity=====dispatchTouchEvent========ACTION_MOVE

=====Activity=====onTouchEvent========ACTION_MOVE

=====Activity=====dispatchTouchEvent========ACTION_UP

=====Activity=====onTouchEvent========ACTION_UP

优质IT资源分享社区为你提供此文。

本站有大量优质android教程视频,资料等资源,包含android基础教程,高级进阶教程等等,教程视频资源涵盖传智播客,极客学院,达内,北大青鸟,猎豹网校等等IT职业培训机构的培训教学视频,价值巨大。欢迎点击下方链接查看。

android教程视频

优质IT资源分享社区(www.itziyuan.top)
一个免费,自由,开放,共享,平等,互助的优质IT资源分享网站。
专注免费分享各大IT培训机构最新培训教学视频,为你的IT学习助力!

!!!回帖受限制请看点击这里!!!
!!!资源失效请在此版块发帖说明!!!

[PS:按 CTRL+D收藏本站网址~]

——“优质IT资源分享社区”管理员专用签名~

本版相似帖子

游客