Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ViewFlipper + Gesture Detector

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?

like image 755
Tim Avatar asked Jul 26 '26 00:07

Tim


1 Answers

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.

like image 151
Tim Avatar answered Jul 27 '26 12:07

Tim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!