Distinguish swipe and click in android (transfer the event to another view, if you swipe it)

hi I have an overlay (linearlayout) that sits on top of another view (scrollview) now I want the user to still be able to scroll up and down the scrollview screen, but whenever he clicks, the overlay should catch the click event and do what something else. if it is a napkin or in fact is anything other than a click, the overlay should ignore and pass the event in the form behind it.

I tried to snap onClick to the overlay, but it cannot say click / click and swipe, i.e. swipe launches onClick overlay, pressing / click als fires the same onClick event in other words, the user cannot scroll down ... can anyone help?

  • Is there a way to pass the event to others, i.e. in this case scrollview so that it can scroll down?
+4
source share

Source: https://habr.com/ru/post/1411822/


All Articles