Join us on the livestream at Android Dev Summit on 7-8 November 2018, starting at 10AM PDT!

TabLayout.TabLayoutOnPageChangeListener

public static class TabLayout.TabLayoutOnPageChangeListener
extends Object implements ViewPager.OnPageChangeListener

java.lang.Object
   ↳ com.google.android.material.tabs.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

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
From interface android.support.v4.view.ViewPager.OnPageChangeListener

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