Closed kazixma closed 8 years ago
Me too. I build a navigation drawer with 4 items for example but when I returned to first item smart tab layout didn't reset. Why?
Hi, @kazixma @Phoenix000
Do you use the Fragment#getChildFragmentManager ? This problem will occur if you are using the Fragment#getFragmentManager.
If using fragment inside a ViewPager, Must be use getChildFragmentManager
.
// BAD
FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter(
getFragmentManager(), FragmentPagerItems.with(getContext())
.add(...)
.create());
// GOOD
FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter(
getChildFragmentManager(), FragmentPagerItems.with(getContext())
.add(...)
.create());
It is not a bug in the SmartTabLayout : (
Thank you very much
For design can you add ripple drawable for lower api in tabs when this are pressed?
Hi, @Phoenix000
It is possible if customize the tab. https://github.com/ogaclejapan/SmartTabLayout#how-to-customize-the-tab
thanks for this solution!
Hi, @kazixma @Phoenix000
Do you use the Fragment#getChildFragmentManager ? This problem will occur if you are using the Fragment#getFragmentManager.
If using fragment inside a ViewPager, Must be use
getChildFragmentManager
.// BAD FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter( getFragmentManager(), FragmentPagerItems.with(getContext()) .add(...) .create()); // GOOD FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter( getChildFragmentManager(), FragmentPagerItems.with(getContext()) .add(...) .create());
It is not a bug in the SmartTabLayout : (
Thx <3
When I pop backstack of fragments and smarttablayout in this fragment then I try to open this fragment again smart tab layout is not reset to first and not clear cache . I want to clear cache of smart tab layout, How I do ?
Thank you so much and sorry for bad english.