RecyclerTabLayout
RecyclerTabLayout copied to clipboard
How does it work with FragmentPagerAdapter?
Plz help me
@isanwenyu Hi, What problem do you have?
Generally, create your own FragmentPagerAdapter
and set it to ViewPager
like below:
MyFragmentPagerAdapter adapter = new MyFragmentPagerAdapter();
// initialize apdater
ViewPager viewPager = findViewById(R.id.view_pager);
viewPager.setAdapter(adapter);
RecyclerTabLayout recyclerTabLayout = findViewById(R.id.recycler_tab_layout);
recyclerTabLayout.setUpWithViewPager(viewPager);
@nshmura thanks for your reply. I want to implement a looping ViewPager using Fragments. But I found it to be ineffective. Would you like to add it to the demo.
@isanwenyu Sadly, I have no time to implement demo app. So could you show me your code?
@nshmura the recent version doesnt work well with the fragmentsstateadapter.. it was working fine in 1.1.0 . Some thing changed and no matter how you set the currentItem after initializing the first tab appears on the first position and wont display any fragment content. i checked the demo code and it is same as mine except the demo is presented with pageAdapter. Is there any way you can help for infinite loop with pagestateAdapter ? we were using 1.1.0 before but now it started slowing our app