Home > Mobile >  Android touch events transfer process
Android touch events transfer process

Time:10-29

Touch events in the order is the Activity to Viewgroup, again by Viewgroup passed to it the View,

CodePudding user response:

Said too incomplete,

Should be the activity first to see if they handle events, if does not handle to the current activity's top ViewGroup, if still have below this ViewGroup ViewGroup, and their treatment, not just pass down, to the View, if the child View or not processing, is returned to the activity onTouchEvent processing,

One if any link to deal with, OnTouchEvent return true, if the ViewGroup OnTouchEvent will carry out his parent View OnTouchEvent method, and because of the View OnTouchEvent returns the value of the OnTouchListener return values, whether an OnClickListener implementation effect

Distributed to the lower View and ViewGroup whether (or ViewGroup), is the current ViewGroup onInterceptEvent and subordinate View (ViewGroup) disallowIntercept decided together, determine the code for the if (! OnInterceptEvent | | view. DisallowIntercept)
  • Related