ViewGroup: Send events to the child at the event's dispatch location
A mouse event should always be dispatched to the cursor position, regardless of the location of the pointers in the MotionEvent. When there are touchpad gestures like a two finger swipe or a pinch, we promote compatibility with apps by adding fake pointers that emulate the same behavior on a touchscreen. For example, two finger swipes turn into a one finger drag, and two finger pinch emulates a pinch on the screen using two pointers. The proper way for views to handle touchpad gestures is to look for the new motion classifications added for touchpad gestures, and dispatch events at the cursor position for these gestures. However, our API is incomplete at the moment, becuase apps cannot query the cursor position. We can at least fix this in the UiToolkit by dispatching mouse events to the cursor location. Bug: 279444161 Test: manual Test: atest FrameworksCoreTests:ViewGroupTest Change-Id: I58a9c06b7651ebe97cd03447b083cc9887f863b1
Loading
Please register or sign in to comment