I am adding Accessibility in my Android app and it seems not working properly for the progressBar. Any time, I display the progress bar, I want to have talk back saying something so, I did this in the xml:
android:importantForAccessibility="yes"
android:contentDescription="Loading"
android:visibility="gone"
and, programmatically, I am doing this :
collectState(viewModel.loading) { loading ->
binding.progressBar.isVisible = loading
binding.progressBar.isFocusable = loading
binding.progressBar.isClickable = loading
}
So when the loading state is collected, I am making the viewModel focusable and visible if loading is true.
But it's not working at all, it still not saying anything.
Any idea why? Thanks