Back to project page GameTimer.
The source code is released under:
Apache License
If you think the Android project GameTimer 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.solidnw.gametimer.adapter; /*from www. j a v a 2 s. c o m*/ import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import com.solidnw.gametimer.fragments.GameModeFragment; import com.solidnw.gametimer.model.GameModeConstants; public class GameModePagerAdapter extends FragmentPagerAdapter { public GameModePagerAdapter(FragmentManager fragmentManager) { super(fragmentManager); } public Fragment getItem(int position) { GameModeFragment gameMode = new GameModeFragment(); Bundle arguments = new Bundle(); if (position == 0) { arguments.putString(GameModeConstants.KEY, GameModeConstants.FIXED_TURN_TIME); gameMode.setArguments(arguments); return gameMode; } else if (position == 1) { arguments.putString(GameModeConstants.KEY, GameModeConstants.FIXED_PLAYER_TIME); gameMode.setArguments(arguments); return gameMode; } else { return null; } } public int getCount() { return GameModeConstants.NUM_GAME_MODES; } public CharSequence getPageTitle(int position) { // TODO: localize it switch (position) { case 0: return "Fixed time for turn"; case 1: return "Fixed time for player"; } return null; } }