Back to project page osu-taste-portable.
The source code is released under:
Apache License
If you think the Android project osu-taste-portable 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.dgsrz.osuTaste.adapters; /* ww w . j a v a 2 s . c o m*/ import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentPagerAdapter; import com.dgsrz.osuTaste.R; import com.dgsrz.osuTaste.fragments.AlbumFragment; /** * @author dgsrz (dgsrz@vip.qq.com) */ public class PagerAdapter extends FragmentPagerAdapter { FragmentActivity mFragmentActivity; protected static final int[] CONTENT = new int[] { R.string.page_collections, R.string.page_albums, R.string.page_artists, R.string.page_directories, R.string.page_songs }; private int mCount = CONTENT.length; public PagerAdapter(FragmentActivity fragmentActivity) { super(fragmentActivity.getSupportFragmentManager()); mFragmentActivity = fragmentActivity; } @Override public Fragment getItem(int position) { return AlbumFragment.getInstance(); } @Override public CharSequence getPageTitle(int position) { return mFragmentActivity.getResources().getString(PagerAdapter.CONTENT[position % CONTENT.length]); } @Override public int getCount() { return mCount; } }