Permalink
Browse files

Merge pull request #7339 from weihuoya/cache-all-page

Android: cache all page, avoid image flicking when swipe from last page to first page
  • Loading branch information...
delroth committed Aug 27, 2018
2 parents 246b1f4 + 4f90bcc commit eef47990d94fed0a2703534359e8f6523f9e77bd
@@ -66,6 +66,7 @@ protected void onCreate(Bundle savedInstanceState)
PlatformPagerAdapter platformPagerAdapter = new PlatformPagerAdapter(
getSupportFragmentManager(), this);
mViewPager.setAdapter(platformPagerAdapter);
mViewPager.setOffscreenPageLimit(platformPagerAdapter.getCount());
showGames();
GameFileCacheService.startLoad(this);
}
@@ -188,6 +189,7 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in
PlatformPagerAdapter platformPagerAdapter = new PlatformPagerAdapter(
getSupportFragmentManager(), this);
mViewPager.setAdapter(platformPagerAdapter);
mViewPager.setOffscreenPageLimit(platformPagerAdapter.getCount());
mTabLayout.setupWithViewPager(mViewPager);
mViewPager.setVisibility(View.VISIBLE);
GameFileCacheService.startLoad(this);

0 comments on commit eef4799

Please sign in to comment.