convertPreLayoutPositionToPostLayout
RecyclerView provides artificial position range (item count) in pre-layout state and automatically maps these positions to Adapter positions when getViewForPosition or bindViewToPosition is called.
Usually, LayoutManager does not need to worry about this. However, in some cases, your LayoutManager may need to call some custom component with item positions in which case you need the actual adapter position instead of the pre layout position. You can use this method to convert a pre-layout position to adapter (post layout) position.
Note that if the provided position belongs to a deleted ViewHolder, this method will return -1.
Calling this method in post-layout state returns the same value back.
Parameters
The pre-layout position to convert. Must be greater or equal to 0 and less than getItemCount.