Created
October 5, 2015 04:43
-
-
Save sakdaped200/f33c42044f7a0137a31e to your computer and use it in GitHub Desktop.
Demo-SwipeViewTap :: Source Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mostsofus.swipeviewtabs; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentManager; | |
import android.support.v4.app.FragmentPagerAdapter; | |
public class TabsPagerAdapter extends FragmentPagerAdapter { | |
String[] titles = {"TOP Rate", "Games", "Movies"}; | |
public TabsPagerAdapter(FragmentManager fm) { | |
super(fm); | |
} | |
@Override | |
public Fragment getItem(int position) { | |
switch (position) { | |
case 0: | |
return new TopRatedFragment(); | |
case 1: | |
return new GamesFragment(); | |
case 2: | |
return new MoviesFragment(); | |
default: | |
return null; | |
} | |
} | |
@Override | |
public int getCount() { | |
return titles.length; | |
} | |
@Override | |
public CharSequence getPageTitle(int position) { | |
return titles[position]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment