Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Listening to swipe event without consuming any touch event

I have an activity, with a view on top of it. I want to add a touch listener onto that view, which listens to a swipe event. However, I dont want to consume any of the events. If I do this, I can only get the ACTION_DOWN event. That is because if I don't consume the event, I can't listen to the following ACTION_UP, or ACTION_MOVE event. Is there any ability, to detect a swipe, but don't consume the event?

like image 553
Daniel Zolnai Avatar asked Sep 11 '25 00:09

Daniel Zolnai


1 Answers

As no one answered, I will share my findings. Sadly, what I wanted is not possible. At an action down event, the program should choose, if it wants to consume the event. If not, the event will be passed, and no upcoming ACTION_MOVE, ACTION_UP events can be catched. This is how views work.

like image 103
Daniel Zolnai Avatar answered Sep 12 '25 14:09

Daniel Zolnai