Android Open Source - TheGamesDB-Android-app View Pager Adapter






From Project

Back to project page TheGamesDB-Android-app.

License

The source code is released under:

GNU General Public License

If you think the Android project TheGamesDB-Android-app listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package dragni.tgb.thegamesdb.views;
/*  www.j a  va2s  .co  m*/
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import dragni.tgb.thegamesdb.entity.Game;
 
public class ViewPagerAdapter extends FragmentPagerAdapter {
 
    // Declare the number of ViewPager pages
    final int PAGE_COUNT = 3;
    private Game game;
 
    public ViewPagerAdapter(FragmentManager fm) {
        super(fm);
    }
 
    @Override
    public Fragment getItem(int arg0) {
      
        switch (arg0) {
        case 0:
            FragmentGameInformation informationFragment = new FragmentGameInformation();
            return informationFragment;
        case 1:
            FragmentGameImages imagesFragment = new FragmentGameImages();
            return imagesFragment;
        case 2:
            FragmentGameVideos videosFragment = new FragmentGameVideos();
            return videosFragment;
        }
        return null;
    }
 
    @Override
    public int getCount() {
        return PAGE_COUNT;
    }
 
}




Java Source Code List

dragni.tgb.thegamesdb.entity.GameList.java
dragni.tgb.thegamesdb.entity.Game.java
dragni.tgb.thegamesdb.entity.ImageList.java
dragni.tgb.thegamesdb.entity.Image.java
dragni.tgb.thegamesdb.logic.GameSearcher.java
dragni.tgb.thegamesdb.util.GameListSorter.java
dragni.tgb.thegamesdb.util.SearchType.java
dragni.tgb.thegamesdb.util.UrlMaker.java
dragni.tgb.thegamesdb.views.FragmentGameImages.java
dragni.tgb.thegamesdb.views.FragmentGameInformation.java
dragni.tgb.thegamesdb.views.FragmentGameVideos.java
dragni.tgb.thegamesdb.views.GameListActivity.java
dragni.tgb.thegamesdb.views.GameOverviewActivity.java
dragni.tgb.thegamesdb.views.ImageAdapter.java
dragni.tgb.thegamesdb.views.ImageZoomActivity.java
dragni.tgb.thegamesdb.views.ListAdapter.java
dragni.tgb.thegamesdb.views.SearchActivity.java
dragni.tgb.thegamesdb.views.ViewPagerAdapter.java