CustomViewPager2

public final class CustomViewPager2

A custom ViewPager2 class that can scroll without triggering ViewPager2.OnPageChangeCallBack with the method scrollByCode(). This is to distinguish between when the user changes page a page change happens programmatically. Does not extend ViewPager2 because it's final. Thanks, Google :(

Constructors

Link copied to clipboard

Functions

Link copied to clipboard

Disables the ability to scroll "twice"

Link copied to clipboard
public final ViewPager2 get()

Gets the current viewPager

Link copied to clipboard
public final Unit scrollByCode(Integer item, Boolean smoothScroll)

Gives us the ability to scroll to a set item (position) programmatically

Link copied to clipboard

Sets the pageChange actionListener when the page changes