question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migrate to FragmentStatePagerAdapter for performances

See original GitHub issue

AppIntro 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:open
  • Created 6 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
cortinicocommented, Mar 1, 2019

So the FragmentStatePagerAdapter is definitely an improvement.

Anyway I’d probably postpone this work till ViewPager2 gets released and go directly to the new FragmentStateAdapter.

Doesn’t really make sense to migrate now from one pattern to another if we have to migrate again in a couple of months.

0reactions
AnuthaDevcommented, Mar 1, 2019

Yup. Agreed

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found