Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Component used: androidx.recyclerview:recyclerview
Version used: 1.2.1
Devices/Android versions reproduced on: Android Emulator OS 13
When
RecyclerView
prefetches futureViewHolder
viaGapWorker
, sometimes it does not invokebind
method on them (because prefetch result is omitted). When suchViewHolder
is recycled,ViewCompat.setAccessibilityDelegate
is invoked passingnull
as a parameter, leading to losing the original accessibility delegate, that was set on ViewHolder view during costruction.When
bind
method is invoked,RecyclerView
retrieves the original accessibility delegate, wraps it with its own and set the new delegate toViewHolder
. When suchViewHolder
is recycled,RecyclerView
retrieves stored original delegate and set it back toViewHolder
view. This logic is broken in some cases ofGapWorker
.Sample project:https://github.com/bumble-tech/RecyclerViewAccessibilityBug/