Remove a view from disappear list on recycle
There was an edge case in RecyclerView where if a LayoutManager
adds a View then calls removeAndRecycle on the same view
during the same layout pass, we would recycle the view and also
try to animate disappearance. This would break the consitentcy
and trigger an IllegalStateException if View is returned from the
pool before its animation ends. Even without that race condition,
this could still break since View may come back from the pool
twice.
This CL fixes that issue by removing the View from the list
onRecycle (we were already doing it for other sets).
This CL also changes another behavior where we would cache
removedViews if they are removed in pre-layout. This is
probably why very few people were hitting the above exception.
Bug: 19935582
Change-Id: I502d7d3fdb08737e6727fd15856c90dfc41b27a8
2 files changed