Fixed pages forgetting scroll position when switching tabs
This commit is contained in:
parent
06315821d5
commit
f3e3f9c4d1
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue