Overlaying a view does not disable actions in the base view

I have 2 views: View A and view B. View A is visualized and contains actions for entering a text value. Im displays an overlay view - View B on top of this. I expect the actions on View A to be disabled, but they cannot and they can still enter an input field in View A. How can I disable this?

+6
source share
1 answer

The reason is that your overlay does not absorb touch events, so by design, if the view does not consume touch events, the events are passed to the main view in the view model. So the long answer is to make your overlay tangible, customizable, and touch listener and return true. The short answer adds android:clickable="true" to your overlay view.

+11
source

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


All Articles