How to pass an on click event through a view?

So, I have 3 species, one large on top of the other two. The one on top is transparent. I want to be able to register the onTouch event in the views behind the big one on top, and the big one does nothing.

How can I do that?

+6
source share
1 answer

Take a look at onInterceptTouchEvent(TouchEvent) from ViewGroup . The documentation is pretty clear on how you can achieve what you are doing here. You will probably want to extend your transparent parent (unless it is already the extension you wrote) and override this method to fulfill your bets.

+1
source

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


All Articles