sAleksovski / react-native-android-widget

Build Android Widgets with React Native
https://sAleksovski.github.io/react-native-android-widget/
MIT License
591 stars 22 forks source link

Accessibility / a11y TalkBack descriptions #79

Open benvium opened 7 months ago

benvium commented 7 months ago

First up, thanks for this really interesting library! It's a challenging problem and your solution is neat.

Do you have any thoughts on how widgets using this could be made accessible with TalkBack? The ideal case would be that individual components could have contentDescription etc props. Failing that a reasonable fallback would be the ability to set a contentDescription on the widget root itself - that way a TalkBack user who taps anywhere on the widget could hear something like 'Music Widget. Currently playing all along the watchtower' etc.

For reference, at present when I tap my 'hello world' widget in TalkBack it reads out:

Unlabelled, double-tap to activate labels available use tap with three fingers to view

Thanks!

sAleksovski commented 7 months ago

The problem is that this library renders the widget to an image, so there are no Android views to add contentDescription to.

I assume we can implement it in a similar way like the buttons, add an empty FrameLayout with contentDescription on the place of the components that have accessibility settings.

I'll take a look when I have some free time.

benvium commented 6 months ago

Thanks for the response. Aha - yeah that sounds like a great plan, FrameLayouts would very likely do the trick.