Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

TabLayout.TabLayoutOnPageChangeListener

public static class TabLayout.TabLayoutOnPageChangeListener
extends Object

java.lang.Object
   ↳ com.google.android.material.tabs.TabLayout.TabLayoutOnPageChangeListener


A ERROR(/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

TabLayout.TabLayoutOnPageChangeListener(TabLayout tabLayout)

Public methods

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

Inherited methods

From class java.lang.Object

Public constructors

TabLayout.TabLayoutOnPageChangeListener

TabLayout.TabLayoutOnPageChangeListener (TabLayout tabLayout)

Parameters
tabLayout TabLayout

Public methods

onPageScrollStateChanged

void onPageScrollStateChanged (int state)

Parameters
state int

onPageScrolled

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

Parameters
position int

positionOffset float

positionOffsetPixels int

onPageSelected

void onPageSelected (int position)

Parameters
position int