Fragment Navigation Support
If you are using multiple Fragments in the same Activity in your application please add this line during any Fragment change:
| Pointzi.INSTANCE.onTabChanged(getActivity())
|
Examples
Java
| tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
Pointzi.INSTANCE.onTabChanged(activity);
viewPager.setCurrentItem(tab.getPosition());
}
});
|
Kotlin
| tabLayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab?) {
Pointzi.INSTANCE.onTabChanged(activity)
if (tab != null)
viewPager.currentItem = tab.position
}
})
|
Last update:
2024-01-14