Skip to content

Commit

Permalink
cache all pages, android
Browse files Browse the repository at this point in the history
  • Loading branch information
weihuoya committed Aug 16, 2018
1 parent b595149 commit 4f90bcc
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 4f90bcc

Please sign in to comment.