I wish to understand why I can't seem to use the scrollToPositionWithOffset method on a LinearLayoutManager? Please see the image for what I mean :
A little background:
The first line in the image (with scrollToPosition
) is scrolling the RecyclerView to make the position (in this case 50) visible - this often means that the selected position shows up at the bottom of the visible RecyclerView (where position 50 first becomes visible after 'scrolling'). Whereas I want to always show it at the top. From my research, a some-what solution seems to be to use this scrollToPositionWithOffset
method (Scroll RecyclerView to show selected item on top)
Interestingly, I was able to achieve what I wanted by customizing SmoothScroller of LinearLayoutManager, but my dataset is huge so speed of 'smooth scrolling' is an issue, and I can't seem increase the speed enough without causing other issues.
In short, I'm hoping that scrollToPositionWithOffset will do the trick for me. However, I don't know how to access the method.