I have 2 fragments, sharing the screen.
In both, there is a layout that is listening to TouchEvents.
When I start a TouchEvent on the first fragment, and then moving my finger on top of the second one, the TouchEvent is still received by the first one, and never by the second.
I’ve tried different options without success. Could it be a solution, to handle the TouchEvent from the activity, and then dispatching it to both fragments ?
Any clue is welcome =)
I have 2 fragments, sharing the screen. In both, there is a layout that
Share
ok ! here is (very basically) how I managed that :
MyActivity.java :
Fragment1.java :
Fragment2.java :
It works, but if anyone has a better solution, I’m always listening =)
Edit: be careful using this solution, as the MotionEvent x and y will be the same as rawX and rawY (no longer converted to View’s coordinates)