当前位置: 首页>>代码示例>>Java>>正文


Java BaseGameActivity类代码示例

本文整理汇总了Java中com.google.example.games.basegameutils.BaseGameActivity的典型用法代码示例。如果您正苦于以下问题:Java BaseGameActivity类的具体用法?Java BaseGameActivity怎么用?Java BaseGameActivity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BaseGameActivity类属于com.google.example.games.basegameutils包,在下文中一共展示了BaseGameActivity类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getApiClient

import com.google.example.games.basegameutils.BaseGameActivity; //导入依赖的package包/类
/**
 * Precondition: The activity that this fragment is in extends from BaseGameActivity
 * @return the api client of the activity that it is in.
 */
public GoogleApiClient getApiClient() {
    if(getActivity().getClass().getSuperclass() == BaseGameActivity.class)
        return ((BaseGameActivity) getActivity()).getApiClient();

    Log.w(LOG_TAG, "GameFragment is not a member of an activity that extends BaseGameActivity");
    return null;
}
 
开发者ID:TylerCarberry,项目名称:2048-Battles,代码行数:12,代码来源:GameFragment.java

示例2: onCreate

import com.google.example.games.basegameutils.BaseGameActivity; //导入依赖的package包/类
@Override
	protected void onCreate(Bundle savedInstanceState) {
		// set requested clients (game and cloud save)
		setRequestedClients(BaseGameActivity.CLIENT_GAMES | BaseGameActivity.CLIENT_APPSTATE);
		
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_round);

		Intent intent = getIntent();
		Bundle bundle = intent.getExtras();
		userId = bundle.getString("com.rockyniu.rockpaperscissors.userid");
		userName = bundle.getString("com.rockyniu.rockpaperscissors.username");
		this.setTitle(userName);

		aImageView = (ImageView) findViewById(R.id.aImageViewId);
		bImageView = (ImageView) findViewById(R.id.bImageViewId);
		aRadioGroup = (RadioGroup) findViewById(R.id.aRadioGroupId);
		bRadioGroup = (RadioGroup) findViewById(R.id.bRadioGroupId);
		a1RadioButton = (Button) findViewById(R.id.a1RadioButtonId);
		a2RadioButton = (Button) findViewById(R.id.a2RadioButtonId);
		a3RadioButton = (Button) findViewById(R.id.a3RadioButtonId);
		b1RadioButton = (Button) findViewById(R.id.b1RadioButtonId);
		b2RadioButton = (Button) findViewById(R.id.b2RadioButtonId);
		b3RadioButton = (Button) findViewById(R.id.b3RadioButtonId);

		playButton = (Button) findViewById(R.id.okButtonId);

		aImageView = (ImageView) findViewById(R.id.aImageViewId);
		bImageView = (ImageView) findViewById(R.id.bImageViewId);
		aResultImageView = (ImageView) findViewById(R.id.aImageViewId_result);
		bResultImageView = (ImageView) findViewById(R.id.bImageViewId_result);
		choiceAImageView = (ImageView) findViewById(R.id.choiceAImageViewId);
		choiceBImageView = (ImageView) findViewById(R.id.choiceBImageViewId);
		resultImageView = (ImageView) findViewById(R.id.resultImageViewId);

//		playButton.setOnClickListener(this);
//		aRadioGroup.setOnClickListener(this);
//		bRadioGroup.setOnClickListener(this);

//		RadioGroupChangeListener radioGroupChangeListener = new RadioGroupChangeListener();
//		aRadioGroup.setOnCheckedChangeListener(radioGroupChangeListener);
//		bRadioGroup.setOnCheckedChangeListener(radioGroupChangeListener);

		// default values
		playType = PLAY_WITH_COMPUTER;
		competitorId = COMPUTER_ID;
		competitorName = COMPUTER_NAME;
		aChoice = Choice.ROCK;
		bChoice = Choice.ROCK;
		
		roundDataSource = new RoundDataSource(RoundActivity.this);
	}
 
开发者ID:RockyNiu,项目名称:RockPaperScissors,代码行数:53,代码来源:RoundActivity.java


注:本文中的com.google.example.games.basegameutils.BaseGameActivity类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。