Search code examples
androidandroid-scrollviewtalkbackaccessibility

Android NestedScrollView TalkBack - Only navigates to items visible on screen, skips over elements below scroll and goes to bottom tabs


I have a screen with a nested scroll taking up 90% of the screen and a bottom tab tab that sits fixed. I'm working on the accessibility on the screen and running into an issue where TalkBack will navigate to each item correctly as long as they are visible on the screen. As soon as you reach the bottom of the visible items and try to swipe to go to the next item, the scroll view scrolls, but the TalkBack focus jumps to the bottom tab that is fixed on the screen, bypassing all of the new visible items.

Is there a setting or something i'm missing for this? The items inside the scrollview are all important for accessibility and if I set the screen up to have them on the screen, TalkBack's navigation hits them and reads them correctly.

Thank you


Solution

  • Wow this was broken because of a custom scrollview I was using. I put in a custom scroll listener and removed the super call.

    override fun onScrollChanged(l: Int, t: Int, oldl: Int, oldt: Int) {
            super.onScrollChanged(l, t, oldl, oldt)
            listener?.scrollChanged(t, l)
        }
    

    Once I put the super call back in, it worked as expected. Going to leave this answer here incase anyone else runs into something similar.