Origin of jerseys: Turkey
3. Relationship between the three approachesLet's analyze it first. Judging from the above default situation, it is not enough to study only a single event for the event mechanism. It depends on how each event in the whole event sequence is handled. Therefore, the following situations need to be considered when studying event consumption:
Brilliant light mode. Adjust the contrast to deepen or lighten the color, depending on the color distribution of the upper image. If the brightness of the upper color (light source) is higher than 50% gray, the image will be reduced in contrast and brightened. If the brightness of the upper color (light source) is less than 50% gray, the contrast of the image will be increased and darkened. First: standard (default) The onTouchEvent of View in the figure returns false, and the process of passing the event to ViewGroup is not directly passed. It is the dispatchTouchEvent () method of the superior ViewGroup that receives the false returned by the onTouchEvent () of the child View and distributes the event to the onTouchEvent of the ViewGroup. Test Scenario 2: Loop to the target page (SecondActivity sets singleInstance) 亚洲综合憿情五月丁香五月网 Then there is why you always call to ViewGroup2's onTouchEvent () method, because ViewGroup2 has no child View to handle the event, so you will call ViewGroup2's super.dispatchTouchEvent (), that is, the parent class View.dispatchTouchEvent () method, so if you don't set onTouchListener, you will inevitably call onTouchEvent (). Point out the aligned grid and do not align the grid. (2) Problem Orientation:4. Sequence of event delivery For dispatchTouchEvent, onTouchEvent, return true is the end event pass. Return false is the onTouchEvent method that goes back to the parent View.
Although the event system is very complicated, there are rules to follow. The purpose of our practice is to find this rule. According to my understanding, I drew a picture as a summary of Android event mechanism: