setCurrentItem

open fun setCurrentItem(item: Int)(source)

Set the currently selected page. If the ViewPager has already been through its first layout with its current adapter there will be a smooth animated transition between the current item and the specified item.

Parameters

item

Item index to select


open fun setCurrentItem(item: Int, smoothScroll: Boolean)(source)

Set the currently selected page.

Parameters

item

Item index to select

smoothScroll

True to smoothly scroll to the new item, false to transition immediately