RecyclerTabLayout icon indicating copy to clipboard operation
RecyclerTabLayout copied to clipboard

How does it work with FragmentPagerAdapter?

Open isanwenyu opened this issue 6 years ago • 4 comments

Plz help me

isanwenyu avatar Mar 21 '18 03:03 isanwenyu

@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 avatar Mar 22 '18 01:03 nshmura

@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 avatar Mar 22 '18 09:03 isanwenyu

@isanwenyu Sadly, I have no time to implement demo app. So could you show me your code?

nshmura avatar Mar 23 '18 00:03 nshmura

@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

kraghu avatar Mar 27 '18 19:03 kraghu