Android Jetpack Compose. How to Re-announce Accessibility Content Descirption


As of today the view#announceForAccessibility function is deprecated.

What is the recommended best practice to repeatedly announce the accessibility content description after a certain timeout, such as a full screen loading?
For example: make talkback repeat "Loading" every 3 seconds.

Here's what I have tried.

  1. Create a dummy Box with empty content description, every 3 seconds request focus to the dummy Box and then request focus back to original Loading component.
    Result: Sometimes the accessibility voice would start hallucinating and say something like "detected headphone icon" even tho there is no headphone icon on the screen and all semantics of the screen are cleared except the loading component and the dummy box

  2. Create a dummy Text with liveRegion Assertive, update a counter to trigger recomposition to trigger accessibility announcement.
    Result: The accessibility voice refuses to announce the text unless the text and content description match, meaning the content description would have to include the counter which is not acceptable. Additionally the voice would skip a lot of iterations of the counter and only announce few of them.

0
Jul 31 at 9:56 AM
User AvatarVahé Khachaturian
#android#android-jetpack-compose#accessibility

No answer found for this question yet.