While most people report not working smooth scrolling, I'm here to report the opposite.
I want to scroll to the middle of my viewpager without any scrolling animations. It should be as immediately as possible. This is required for my initial activity population.
According the docs, I can use the smoothScroll
parameter with setting to false
.
/**
* Set the currently selected page. If {@code smoothScroll = true}, will perform a smooth
* animation from the current item to the new item. Silently ignored if the adapter is not set
* or empty. Clamps item to the bounds of the adapter.
*
* @param item Item index to select
* @param smoothScroll True to smoothly scroll to the new item, false to transition immediately
*/
public void setCurrentItem(int item, boolean smoothScroll)
But this actually doesn't make any change, and the scrolling animation is visibile.
Does anyone have the same issue and know how to fix it ? I'm using Kotlin + ViewPager2