Bring back AudioPlayerFragment pager's setOffscreenPageLimit

The reason needs cast: https://issuetracker.google.com/issues/144669596
This commit is contained in:
Ebrahim Byagowi 2020-04-10 16:34:47 +04:30
parent 75e9ee9e0d
commit 260d7ee944
1 changed files with 1 additions and 1 deletions

View File

@ -131,7 +131,7 @@ public class AudioPlayerFragment extends Fragment implements
pager = root.findViewById(R.id.pager);
pager.setAdapter(new AudioPlayerPagerAdapter(this));
// Required for getChildAt(int) in ViewPagerBottomSheetBehavior to return the correct page
// pager.setOffscreenPageLimit(NUM_CONTENT_FRAGMENTS);
pager.setOffscreenPageLimit((int) NUM_CONTENT_FRAGMENTS);
pager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
@Override
public void onPageSelected(int position) {