Пример #1
0
 @Override
 public void showScores() {
   if (isSignedIn() == true)
     startActivityForResult(
         Games.Leaderboards.getLeaderboardIntent(
             _gameHelper.getApiClient(), getString(R.string.leaderboard_id)),
         REQUEST_CODE_UNUSED);
   else {
     // Maybe sign in here then redirect to showing scores?
   }
 }
Пример #2
0
 @Override
 public void submitScore(long score) {
   if (isSignedIn() == true) {
     Games.Leaderboards.submitScore(
         _gameHelper.getApiClient(), getString(R.string.leaderboard_id), score);
     //
     //	startActivityForResult(Games.Leaderboards.getLeaderboardIntent(_gameHelper.getApiClient(),
     // getString(R.string.leaderboard_id)), REQUEST_CODE_UNUSED);
   } else {
     // Maybe sign in here then redirect to submitting score?
   }
 }
Пример #3
0
 @Override
 public void getAchievementsGPGS() {
   startActivityForResult(
       Games.Achievements.getAchievementsIntent(gameHelper.getApiClient()), ACHIEVEMENTS_REQUEST);
 }
Пример #4
0
 @Override
 public void getLeaderboardGPGS() {
   startActivityForResult(
       Games.Leaderboards.getAllLeaderboardsIntent(gameHelper.getApiClient()),
       LEADERBOARD_REQUEST);
 }
Пример #5
0
 @Override
 public void unlockAchievementGPGS(String achievementId) {
   Games.Achievements.unlock(gameHelper.getApiClient(), achievementId);
 }
Пример #6
0
 @Override
 public void submitScoreGPGS(int score, String leaderboardId) {
   Games.Leaderboards.submitScore(gameHelper.getApiClient(), leaderboardId, score);
 }
Пример #7
0
 @Override
 public void unlockAchievement(String achievementId) {
   if (isSignedIn() == true) Games.Achievements.unlock(_gameHelper.getApiClient(), achievementId);
 }