Will the touch be detected while the view is in an invisible state?

I use CustomSlider in my application and I set it invisible.

When a user drags it or touches it (from top to bottom), my application should make the slider visible. Is it possible? How can i achieve this?

+6
source share
2 answers

A touch event will be detected in the visible View your activity. Although the View instance has a value of hidden / invisible , you cannot interact with it.

You need a motion handler in the parent / visible view to determine whether to show the slider (in case the movement is vertical) or not.

+5
source

I needed to do this using ImageView and still receive touch events. The solution was to set Alpha (0.0f) to hide the image and still receive events.

+4
source

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


All Articles