Migrate to FragmentStatePagerAdapter for performances
See original GitHub issueAppIntro Version: 4.2.2
Device/Android Version: SM-J730F - Android 7.0, and all other smartphones tested
Issue details / Repro steps: When switching pages it is very slow even on high performances devices (I’ve got 6 slides containing images)
AppIntro library code: AppIntroBase.java::113 -> you’re using a PagerAdapter
Suggested modification: Use a FragmentStatePagerAdapter instead :
https://developer.android.com/reference/android/support/v4/view/PagerAdapter.html Base class providing the adapter to populate pages inside of a ViewPager. You will most likely want to use a more specific implementation of this, such as FragmentPagerAdapter or FragmentStatePagerAdapter.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Migrate from ViewPager to ViewPager2 - Android Developers
Fragment-based adapter classes inheriting from FragmentPagerAdapter or FragmentStatePagerAdapter always accept a single FragmentManager object ...
Read more >FragmentPagerAdapter and FragmentStatePagerAdapter
I've read recently on StackOverflow that, method PagerAdapter's getItem() method is called ONLY when it need to create fragment, but - it is ......
Read more >Adventures with FragmentStatePagerAdapter | by Daniel Novak
A lot of Android developers are confused or don't even know about the difference between FragmentPagerAdapter and FragmentStatePagerAdapter.
Read more >A deeper look of ViewPager and FragmentStatePagerAdaper
I have not start yet, but as mFragments in FragmentStatePagerAdapter is private, extending it and override some methods cannot change it at all....
Read more >Migrating to ViewPager2. Hands-on guide - ProAndroidDev
Since the target Activity used FragmentStatePagerAdapter , we need to switch to FragmentStateAdapter , because it is the only option for ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So the
FragmentStatePagerAdapter
is definitely an improvement.Anyway I’d probably postpone this work till
ViewPager2
gets released and go directly to the newFragmentStateAdapter
.Doesn’t really make sense to migrate now from one pattern to another if we have to migrate again in a couple of months.
Yup. Agreed