Avoiding conflicts with multiple MultiPointerDraggables
Two adjustments were necessary to accomplish this:
- Initial event: During the Final phase, if the previous event has been
consumed, the event that enables the drag gesture to begin is captured.
- Dragging phase: Even the events that are not sent to onDrag are
consumed because they are part of the same gesture.
## Initial event
We are searching for an event that can be used as the starting point for
the drag gesture.
Our options are:
- Initial: These events should never be consumed by the
MultiPointerDraggable since our ancestors can consume the gesture, but
we would eliminate this possibility for our descendants.
- Main: These events are consumed during the drag gesture, and they are
a good place to start if the previous event has not been consumed.
- Final: If the previous event has been consumed, we can wait for the
Main pass to finish. If none of our ancestors were interested in the
event, we can wait for an unconsumed event in the Final pass.
## Dragging phase
We are still dragging an object, but this event is not of interest to
the caller.
This event will not trigger the onDrag event, but we will consume the
event to prevent another pointerInput from interrupting the current
gesture just because the event was ignored.
Test: atest MultiPointerDraggableTest
Bug: 345434452
Flag: com.android.systemui.scene_container
Change-Id: I907b231f1fd9af4a9eb744a158a298cd694586c9
2 files changed