Android ViewFlipper + Gesture Detector

Tim picture Tim · Mar 25, 2010 · Viewed 20.5k times · Source

I am using gesture detector to catch "flings" and using a view flipper to change the screen when this happens. Some of my child views contain list views. The the gesture detector wont recognize a swipe if you swipe on the list view. But it will recognize it if it is onTop of TextView's or ImageView's. Is there a way to implement it so that it will recognize the swipes even if they are on top of another view that has a ClickListener?

Answer

Tim picture Tim · Mar 25, 2010

Thank you for your answer. In order to get it working how I wanted it to all I had to add was this:

myList.setOnTouchListener(gestureListener);

for each of my lists. Now they correctly recognize horizontal swipes to change views, and vertical movement for scrolling the list.