I'm trying to use new google's ViewPager2 (https://developer.android.com/jetpack/androidx/releases/viewpager2) class that is implemented using RecyclerView.
One of the main ideas of ViewPager is that it create "neighbor" views for the selected one so the user can instantly see created views when scrolling. But as I see now onBindViewHolder is only called in adapter (I'm using RecyclerView.Adapter) when scrolling is started.
Does anybody know how to fix that to have onBind method called on neighbors before they are actually visible to the user? Thanks.
You can use setOffscreenPageLimit(...)
on ViewPager2
to create neighbouring ViewHolders before the user scrolls to them.