[android-developers] Prevent a click from being consumed, to pass to containers onTouchEvent

2012-03-31 Thread momo
I've got a container that allows 2-d scrolling, fling, pinch etc. This has several layers within it - a viewgroup for image tiles, another for path drawing, another for markers, etc. This all works fine. However, in one particular implementation I have several invisible buttons to indicate

Re: [android-developers] Prevent a click from being consumed, to pass to containers onTouchEvent

2012-03-31 Thread Kostya Vasilyev
Take a look at ScrollView or AbsListView: https://github.com/android/platform_frameworks_base/blob/master/core/java/android/widget/ScrollView.java#L438 The basic idea is to override onInterceptTouchEvent, consume the initial ACTION_DOWN and then figure out if the user is trying to

Re: [android-developers] Prevent a click from being consumed, to pass to containers onTouchEvent

2012-03-31 Thread momo
Thanks for the reply. Imagine that over 75% of the scrollable area was covered by these hotspots - I need the ACTION_DOWN to return true so that the click event does fire when the finger goes up (on that same child view), but *also* pass the event to the scrolling container's onTouchEvent -