Permalink
Browse files

cache all pages, android

  • Loading branch information...
weihuoya committed Aug 16, 2018
1 parent b595149 commit 4f90bcce631a0ae3fb9af5d0a52d4931b6f79625
@@ -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);
}
@@ -174,6 +175,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 4f90bcc

Please sign in to comment.