Back to project page adamsonelearn.
The source code is released under:
MIT License
If you think the Android project adamsonelearn listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.jaselogic.adamsonelearn; /*www. j ava 2s. c o m*/ import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentStatePagerAdapter; import android.support.v4.view.PagerAdapter; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class CurriculumFragment extends Fragment { //non swipe viewpager private static final int NUM_PAGES = 2; private NonSwipeViewPager mViewPager; private PagerAdapter mPagerAdapter; public CurriculumFragment() { } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { //inflate the primary view View rootView = inflater.inflate(R.layout.fragment_curriculum, container, false); //create the pageradapter instance mViewPager = (NonSwipeViewPager) rootView .findViewById(R.id.curriculum_pager); mPagerAdapter = new CurriculumPagerAdapter(getChildFragmentManager()); mViewPager.setAdapter(mPagerAdapter); return rootView; } private class CurriculumPagerAdapter extends FragmentStatePagerAdapter { public CurriculumPagerAdapter(FragmentManager fm) { super(fm); } @Override public int getCount() { return NUM_PAGES; } @Override public CharSequence getPageTitle(int position) { return "Curriculum Page"; } @Override public Fragment getItem(int position) { if(position == 0) { return new CurriculumPageFragment.YearSelectFragment(); } return new CurriculumPageFragment.CurrDisplayFragment(); } } }