Merge pull request #4431 from ByteHamster/fix-scroll-position-reset

Fixed pages forgetting scroll position when switching tabs
This commit is contained in:
H. Lehmann 2020-09-19 11:24:29 +02:00 committed by GitHub
commit 689bdb69db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -48,6 +48,7 @@ public class DownloadsFragment extends Fragment {
viewPager = root.findViewById(R.id.viewpager);
viewPager.setAdapter(new DownloadsPagerAdapter(this));
viewPager.setOffscreenPageLimit(2);
// Give the TabLayout the ViewPager
tabLayout = root.findViewById(R.id.sliding_tabs);

View File

@ -51,6 +51,7 @@ public class EpisodesFragment extends Fragment {
((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
viewPager = rootView.findViewById(R.id.viewpager);
viewPager.setAdapter(new EpisodesPagerAdapter(this));
viewPager.setOffscreenPageLimit(2);
// Give the TabLayout the ViewPager
tabLayout = rootView.findViewById(R.id.sliding_tabs);