Skip to content

Commit

Permalink
Cache all fragment pages
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshixin committed Aug 17, 2016
1 parent 5e06f53 commit 19d0f1e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class BottomNavigation(context: Context?, attrs: AttributeSet?) : CoordinatorLay

fun setFragmentPagerAdapter(fragmentPagerAdapter: FragmentPagerAdapter) {
bottom_navigation_view_pager.adapter = fragmentPagerAdapter
//Cache all pages
bottom_navigation_view_pager.offscreenPageLimit = fragmentPagerAdapter.count - 1
}

fun setTabItems(tabs: List<BottomNavigationItem>) {
Expand Down

0 comments on commit 19d0f1e

Please sign in to comment.