TabLayout.TabLayoutOnPageChangeListener

public class TabLayout.TabLayoutOnPageChangeListener


A ViewPager.OnPageChangeListener class which contains the necessary calls back to the provided TabLayout so that the tab position is kept in sync.

This class stores the provided TabLayout weakly, meaning that you can use addOnPageChangeListener(OnPageChangeListener) without removing the listener and not cause a leak.

Summary

Public constructors

Public methods

void
void
onPageScrolled(
    int position,
    float positionOffset,
    int positionOffsetPixels
)
void
onPageSelected(int position)

Public constructors

TabLayoutOnPageChangeListener

public TabLayoutOnPageChangeListener(TabLayout tabLayout)

Public methods

onPageScrollStateChanged

public void onPageScrollStateChanged(int state)

onPageScrolled

public void onPageScrolled(
    int position,
    float positionOffset,
    int positionOffsetPixels
)

onPageSelected

public void onPageSelected(int position)