Widen the scope of ViewHolder#getAdapterPosition
getAdapterPosition in ViewHolder needs to access RecyclerView to get
the up to date position. This does not work if developer wants to
access adapter position in onViewDetached/Recycled callbacks.
This CL adds a reference from ViewHolder to the RecyclerView for the
duration it is controlled by the RecyclerView (right before binding
from the adapter till it is passed to the RecycledViewPool).
Bug: 18960075
Change-Id: I4e310aff14f827f6289caaf2b94e61288ed3fb1a
4 files changed