Workaround for swipe containers not swiping if dragged on a button within
I have a swipe container with multiple pages. On each page there are a few buttons (children of their respective pages). Swiping in empty areas within the container swipes the container left and right, as intended. However, if I swipe left and right on top of the buttons, the button is pressed in and no container swiping occurs.
I understand that click events are passed to the topmost visible element. However, is there a way to detect if a drag has occurred/is occurring and if so, pass that event to the swipe container instead of the button?
Thanks!
N.B.:
- The same issue occurs with scrolling containers.
- This issue occurs with any ClickListener, not just buttons.
- The desired behavior is modeled after most smartphone menus where a drag after a press will cancel the button click and scroll the window instead.