I do not like my decision, but I found a way to do it. Hopefully someone else will post a better answer in the future, or at least my workaround is useful to someone else.
As I described in the question, the problem is how the gesture listener works. To view the onSingleTapUp() child, you return true on onDown() . But once you do this, the next series of events will not go to the parent view even after your child view onTouch() announces that it is no longer interested in the event. If you strongly call the parent onTouch() in the child onTouch() when its gesture pointer returns false, yes, the parent onFling () will be output, but the first argument to MouseEvent will be NULL since it was consumed by the onTouch() child view.
Something must be missing for me, because it seems like a very simple gesture detection script. In any case, I could not find a way to do this in a reasonable way.
So, my workaround is to create a TouchListenerService as a singleton.
Both the child view and the parent view have this line :
view.setOnTouchListener(TouchListenerService.Instance());
and TouchListenerService starts as follows:
public class TouchListenerService extends GestureDetector.SimpleOnGestureListener implements View.OnTouchListener {
Since it is the same event handler, the parent view captures the onFling() event successfully, and the child view can set SingleTapUpHandler to handle the click event.
source share