I was wondering if it is possible to have Views sitting on top of each other and separate listeners for them. Specifically, I have two views that are exactly sitting on top of each other and are the exact same dimensions, and I'm trying to implement a motion event OnTouchListener for view_one and an OnLongPressListener for view_two. However, the OnTouchListener on view_one seems to block the OnLongClickListener for view_one.
The basic goal of the code is to have multiple touch interactions doing different things:
- Short click does one thing
- Long press does another
- Touch drag and release in vertical direction does another thing
- Touch-drag in horizontal another
Etc, as many different things as possible.
Maybe I should just have one View that is for touching rather than two, and there is a way to separate out the touches and motion events. I know how to separate short and long press events, but the motion event messes things up.
I'm sure there is a much better way to do this. Any hints or suggestions are much appreciated. Is there a way to put limits on the length of slide motion and touch duration that help determine which action to take?