deviant
08/31/2021, 3:42 PMcontentDescription
generation for every composable in the project?
modifier = Modifier.semantics {
contentDescription = "back button"
}
maybe with reflection or some AOP tool?
ideally i would name each contentDescription with a current composable function nameBryan Herbst
08/31/2021, 3:57 PMcontentDescription
is what accessibility services such as TalkBack will read to your users who need assistance reading what is on the screen. I think you will find that trying to automatically generate a contentDescription
is unlikely to result in a meaningful experience for those users.deviant
08/31/2021, 3:59 PMBryan Herbst
08/31/2021, 4:09 PMcontentDescription
for automated testing is an unfortunately common pattern.
I’m not particularly familiar with Appium, but if it doesn’t support tests via Modifier.testTag()
that is a huge miss. Test tags are the best replacement for using contentDescription
as a automation tag and for finding a view by its ID when a description is unavailable.
Regardless, I’d encourage you to prioritize the experience of users with accessibility services over automated testing.deviant
08/31/2021, 4:15 PMModifier.testTag()
(or whatever modifier) for every single composable.
it's hard to switch from OOP world to fully functional, so i'm kinda stuck now