コード例 #1
0
 private void showInvitations() {
   Intent intent = ((BaseGameActivity) getActivity()).getGamesClient().getInvitationInboxIntent();
   startActivityForResult(intent, RC_INVITATION_INBOX);
   GoogleAnalyticsHelper.sendEvent(
       getActivity().getApplicationContext(),
       EventCategory.ui_action,
       EventAction.button_press,
       "show_invitations");
 }
コード例 #2
0
 private void invitePlayersToMyGame() {
   // launch the player selection screen
   Intent intent =
       ((BaseGameActivity) getActivity())
           .getGamesClient()
           .getSelectPlayersIntent(mNbPlayers - 1, mNbPlayers - 1);
   getActivity().startActivityForResult(intent, RC_SELECT_PLAYERS);
   GoogleAnalyticsHelper.sendEvent(
       getActivity().getApplicationContext(),
       EventCategory.ui_action,
       EventAction.button_press,
       "invite_players");
 }
コード例 #3
0
  private void startQuickGame() {
    Bundle am = RoomConfig.createAutoMatchCriteria(1, mNbPlayers - 1, 0);

    // build the room config:
    RoomConfig.Builder roomConfigBuilder =
        ((GameActivity) getActivity()).makeBasicRoomConfigBuilder();
    roomConfigBuilder.setAutoMatchCriteria(am);
    RoomConfig roomConfig = roomConfigBuilder.build();

    // create room:
    ((BaseGameActivity) getActivity()).getGamesClient().createRoom(roomConfig);

    GoogleAnalyticsHelper.sendEvent(
        getActivity().getApplicationContext(),
        EventCategory.ui_action,
        EventAction.button_press,
        "quick_game");
  }