I have a transparent view in my app on top of a few fragments. So my fragments are below the transparent overlay, but they are not reachable by the user while the overlay is opened, as touching the overlay will dismiss it. All work fine up to the point when I enable TalkBack
My problem is that when I have TalkBack enabled and I swipe to select the next element, once TalkBack has finished with everything in the overlay, it will start setting focus on items below overlay. Is there any way to stop it from doing so? Something similar to the android:clickable="true"
or using an onClick listener for making the transparent overlay intercept all clicks?
On API 19+, you can set the accessibility importance of root view of the hierarchy that you want to hide from TalkBack to be NO_HIDE_DESCENDANTS. This will prevent TalkBack from focusing anything in that hierarchy, and this is how we handle the navigation drawer scrim.
On previous versions, there's no good way to accomplish this. There are some bad ways involving manually hiding nodes from the AccessibilityNodeInfo for the root view, though, and you can check those in the DrawerLayout source code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With