From the course: Android App Development: Accessibility
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Handle RecyclerView updates - Android Tutorial
From the course: Android App Development: Accessibility
Handle RecyclerView updates
- [Instructor] At the time of this recording there is a recycler view bug where we lose the accessibility focus whenever we tell recycler view that the data set has changed. Let's take a look. Open the Cards example and focus on the Like button. - [TalkBack Voice] Like Jane does post button in list three items. Double tap to activate. - [Instructor] Now double tap to toggle the button. - [TalkBack Voice] Showing i- one. - [Instructor] As you can see, we lost the accessibility focus. The same happens to the favorite button. - [TalkBack Voice] Unfavor I Jane does post button. - [Instructor] There's a workaround to fix this problem. Let's go back to Android Studio and let's open our adapter. Go to main, java, adapters, CardListAdapter. Let's go to the constructor and let's tell that our adapter has stable IDs. We use the method setHasStableIds and set to true. So let's add another method here after the constructor. Hit Command + N on Mac and Alt + Insert on Windows and Linux and override…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
The POUR principle1m 6s
-
(Locked)
Focus navigation3m 25s
-
(Locked)
Update default focus navigation3m 9s
-
(Locked)
Labels, roles, values, and states2m 43s
-
Apply visual attributes to tab layout4m 14s
-
(Locked)
Provide unique and meaningful labels6m 37s
-
(Locked)
Labels for input controls4m 42s
-
(Locked)
Create unique labels7m 45s
-
(Locked)
Handle RecyclerView updates3m 41s
-
(Locked)
Handle Single Activity layouts6m 39s
-
(Locked)
Accessibility events5m 10s
-
(Locked)
Accessibility live region2m 12s
-
(Locked)
Accessibility node info2m 14s
-
(Locked)
Custom views1m 48s
-
(Locked)
-
-
-