Skip to content

Conversation

nbradbury
Copy link
Contributor

Resolves #3858 - simplifies and optimizes the ViewPager adapter used by plans. Rather than being passed a list of fragments in the constructor and then holding on to them, we instead pass a list of site plans and let the FragmentPagerAdapter handle fragment creation/destruction/restoration.

I also moved the adapter out of the activity, which wasn't entirely necessary but it prevents some of the coupling seen in other areas of the app where a ViewPager is used.

I think this adapter was originally based off code used elsewhere in the app, where it was necessary to retain the list of fragments. But here it isn't needed.

Needs review: @daniloercoli

@daniloercoli
Copy link
Contributor

:shipit:

daniloercoli added a commit that referenced this pull request Mar 15, 2016
…er-refactor

Issue/3858 plans adapter refactor
@daniloercoli daniloercoli merged commit ac61006 into develop Mar 15, 2016
@daniloercoli daniloercoli deleted the issue/3858-plans-adapter-refactor branch March 15, 2016 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants