-
public class SlidingTabLayoutMediatorSlidingTabLayoutMediator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classSlidingTabLayoutMediator.SlidingTabPageAdapter
-
Constructor Summary
Constructors Constructor Description SlidingTabLayoutMediator(SlidingTabLayout tabLayout, ViewPager2 viewPager)SlidingTabLayoutMediator(SlidingTabLayout tabLayout, ViewPager2 viewPager, boolean smoothScroll)
-
Method Summary
Modifier and Type Method Description voidattach()Link the TabLayout and the ViewPager2 together. voiddetach()Unlink the TabLayout and the ViewPager. booleanisAttached()Returns whether the SlidingTabLayout and the ViewPager2 are linked together. -
-
Constructor Detail
-
SlidingTabLayoutMediator
SlidingTabLayoutMediator(SlidingTabLayout tabLayout, ViewPager2 viewPager)
-
SlidingTabLayoutMediator
SlidingTabLayoutMediator(SlidingTabLayout tabLayout, ViewPager2 viewPager, boolean smoothScroll)
-
-
Method Detail
-
attach
void attach()
Link the TabLayout and the ViewPager2 together. Must be called after ViewPager2 has an adapterset. To be called on a new instance of TabLayoutMediator or if the ViewPager2's adapterchanges.
-
detach
void detach()
Unlink the TabLayout and the ViewPager. To be called on a stale TabLayoutMediator if a new oneis instantiated, to prevent holding on to a view that should be garbage collected. Also to becalled before attach when a ViewPager2's adapter is changed.
-
isAttached
boolean isAttached()
Returns whether the SlidingTabLayout and the ViewPager2 are linked together.
-
-
-
-