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


Java BaseGameUtils类代码示例

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


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

示例1: onConnectionFailed

import com.google.example.games.basegameutils.BaseGameUtils; //导入依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
  Log.d(TAG, "onConnectionFailed() called, result: " + connectionResult);

  if (mResolvingConnectionFailure) {
    Log.d(TAG, "onConnectionFailed() ignoring connection failure; already resolving.");
    return;
  }

  if (mSignInClicked || mAutoStartSignInFlow) {
    mAutoStartSignInFlow = false;
    mSignInClicked = false;
    mResolvingConnectionFailure = BaseGameUtils.resolveConnectionFailure(this, mGoogleApiClient,
        connectionResult, RC_SIGN_IN, getString(R.string.signin_other_error));
  }

  switchToScreen(R.id.screen_sign_in);
}
 
开发者ID:ezet,项目名称:penguins-in-space,代码行数:19,代码来源:Example.java

示例2: openLeaderboard

import com.google.example.games.basegameutils.BaseGameUtils; //导入依赖的package包/类
@Override
public void openLeaderboard() {
    Log.d(LOG_TAG, "The user opened the leaderboard");

    googleApiClientCallback myActivity = (googleApiClientCallback) getActivity();
    GoogleApiClient myClient = myActivity.getGoogleApiClient();

    if (myClient.isConnected()) {
        startActivityForResult(
                Games.Leaderboards.getAllLeaderboardsIntent(myClient),
                RC_UNUSED);
    } else {
        BaseGameUtils.makeSimpleDialog(
                getActivity(),
                getString(R.string.leaderboards_not_available))
                .show();
    }
}
 
开发者ID:jaysondc,项目名称:TripleTap,代码行数:19,代码来源:MainMenuFragment.java

示例3: openAchievements

import com.google.example.games.basegameutils.BaseGameUtils; //导入依赖的package包/类
@Override
public void openAchievements() {
    Log.d(LOG_TAG, "The user opened achievements");

    googleApiClientCallback myActivity = (googleApiClientCallback) getActivity();
    GoogleApiClient myClient = myActivity.getGoogleApiClient();

    if (myClient.isConnected()) {
        startActivityForResult(Games.Achievements.getAchievementsIntent(myClient),
                RC_UNUSED);
    } else {
        BaseGameUtils.makeSimpleDialog(
                getActivity(),
                getString(R.string.achievements_not_available))
                .show();
    }
}
 
开发者ID:jaysondc,项目名称:TripleTap,代码行数:18,代码来源:MainMenuFragment.java

示例4: openLeaderboard

import com.google.example.games.basegameutils.BaseGameUtils; //导入依赖的package包/类
@Override
public void openLeaderboard() {
    Log.d(LOG_TAG, "The user opened the leaderboard");

    GoogleApiClientCallback myActivity = (GoogleApiClientCallback) getActivity();
    GoogleApiClient myClient = myActivity.getGoogleApiClient();

    if (myClient.isConnected()) {
        startActivityForResult(
                Games.Leaderboards.getAllLeaderboardsIntent(myClient),
                RC_UNUSED);
    } else {
        BaseGameUtils.makeSimpleDialog(
                getActivity(),
                getString(R.string.leaderboards_not_available))
                .show();
    }
}
 
开发者ID:jaysondc,项目名称:TripleTap,代码行数:19,代码来源:GameOverFragment.java

示例5: onConnectionFailed

import com.google.example.games.basegameutils.BaseGameUtils; //导入依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
    if (mResolvingConnectionFailure) {
        return;
    }

    if (mGoogleApiClient != null && (mSignInClicked || mAutoStartSignInflow)) {
        mSignInClicked = false;
        mAutoStartSignInflow = false;

        mResolvingConnectionFailure = BaseGameUtils.resolveConnectionFailure(this, mGoogleApiClient, connectionResult, RC_SIGN_IN, getString(R.string.sign_in_failure));
    } else {
        //add sign in button
        findViewById(R.id.signin).setVisibility(View.VISIBLE);
        findViewById(R.id.progress).setVisibility(View.GONE);
        findViewById(R.id.achv).setVisibility(View.GONE);
        findViewById(R.id.scoreboard).setVisibility(View.GONE);
    }
}
 
开发者ID:TheAndroidMaster,项目名称:Rocket,代码行数:20,代码来源:MainActivity.java

示例6: onConnectionFailed

import com.google.example.games.basegameutils.BaseGameUtils; //导入依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
    if (mResolvingConnectionFailure) {
        return;
    }

    if (mSignInClicked || mAutoStartSignInflow) {
        mSignInClicked = false;
        mAutoStartSignInflow = false;

        mResolvingConnectionFailure = BaseGameUtils.resolveConnectionFailure(this, mGoogleApiClient, connectionResult, RC_SIGN_IN, "Sign-in failed");
    } else {
        //remove sign out button - user is not signed in
        findViewById(R.id.signout).setVisibility(View.GONE);
    }
}
 
开发者ID:TheAndroidMaster,项目名称:Rocket,代码行数:17,代码来源:OptionsActivity.java

示例7: onConnectionFailed

import com.google.example.games.basegameutils.BaseGameUtils; //导入依赖的package包/类
/**
 * Attempt to reconnect to play services, or display error if connection fails.
 *
 * @param connectionResult
 */
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
    if (mResolvingConnectionFailure) {
        // already resolving
        return;
    }

    // if the sign-in button was clicked or if auto sign-in is enabled,
    // launch the sign-in flow
    if (mSignInClicked || mAutoStartSignInFlow) {
        mAutoStartSignInFlow = false;
        mSignInClicked = false;
        mResolvingConnectionFailure = true;

        // Attempt to resolve the connection failure using BaseGameUtils.
        // The R.string.signin_other_error value should reference a generic
        // error string in your strings.xml file, such as "There was
        // an issue with sign-in, please try again later."
        if (!BaseGameUtils.resolveConnectionFailure(this,
                mGoogleApiClient, connectionResult,
                RC_SIGN_IN, String.valueOf(R.string.signin_other_error))) {
            mResolvingConnectionFailure = false;
        }
    }
}
 
开发者ID:BloopApp,项目名称:Bloop,代码行数:31,代码来源:PlayLoginActivity.java

示例8: onActivityResult

import com.google.example.games.basegameutils.BaseGameUtils; //导入依赖的package包/类
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
    if (requestCode == RC_SIGN_IN) {
        mSignInClicked = true;
        mResolvingConnectionFailure = false;
        if (resultCode == RESULT_OK) {
            mGoogleApiClient.connect();
        } else {
            // Bring up an error dialog to alert the user that sign-in
            // failed. The R.string.signin_failure should reference an error
            // string in your strings.xml file that tells the user they
            // could not be signed in, such as "Unable to sign in."
            BaseGameUtils.showActivityResultError(this,
                    requestCode, resultCode, R.string.signin_failure);
        }
    }
}
 
开发者ID:BloopApp,项目名称:Bloop,代码行数:17,代码来源:PlayLoginActivity.java

示例9: onConnectionFailed

import com.google.example.games.basegameutils.BaseGameUtils; //导入依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
    Log.d(TAG, "onConnectionFailed(): attempting to resolve");
    if (mResolvingConnectionFailure) {
        Log.d(TAG, "onConnectionFailed(): already resolving");
        return;
    }

    if (mSignInClicked || mAutoStartSignInFlow) {
        mAutoStartSignInFlow = false;
        mSignInClicked = false;
        mResolvingConnectionFailure = true;
        if (!BaseGameUtils.resolveConnectionFailure(this, mGoogleApiClient, connectionResult,
                RC_SIGN_IN, getString(R.string.signin_other_error))) {
            mResolvingConnectionFailure = false;
        }
    }

    // Sign-in failed, so show sign-in button on main menu
    mMainMenuFragment.setGreeting(getString(R.string.signed_out_greeting));
    mMainMenuFragment.setShowSignInButton(true);
    mWinFragment.setShowSignInButton(true);
}
 
开发者ID:NahroTo,项目名称:Fruit-Destroyer,代码行数:24,代码来源:MainActivity.java

示例10: onConnectionFailed

import com.google.example.games.basegameutils.BaseGameUtils; //导入依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
    Log.d(TAG, "onConnectionFailed() called, result: " + connectionResult);

    if (mResolvingConnectionFailure) {
        Log.d(TAG, "onConnectionFailed() ignoring connection failure; already resolving.");
        return;
    }

    if (mSignInClicked || mAutoStartSignInFlow) {
        mAutoStartSignInFlow = false;
        mSignInClicked = false;
        mResolvingConnectionFailure = BaseGameUtils
                .resolveConnectionFailure(this, mGoogleApiClient,
                        connectionResult, RC_SIGN_IN, getString(R.string.signin_other_error));
    }
    showSignInBar();
}
 
开发者ID:NahroTo,项目名称:Fruit-Destroyer,代码行数:19,代码来源:BeGenerousActivity.java

示例11: onConnectionFailed

import com.google.example.games.basegameutils.BaseGameUtils; //导入依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
    Log.d(TAG, "onConnectionFailed(): attempting to resolve");
    if (mResolvingConnectionFailure) {
        // Already resolving
        Log.d(TAG, "onConnectionFailed(): ignoring connection failure, already resolving.");
        return;
    }

    // Launch the sign-in flow if the button was clicked or if auto sign-in is enabled
    if (mSignInClicked || mAutoStartSignInFlow) {
        mAutoStartSignInFlow = false;
        mSignInClicked = false;

        mResolvingConnectionFailure = BaseGameUtils.resolveConnectionFailure(this,
                mGoogleApiClient, connectionResult, RC_SIGN_IN,
                getString(R.string.signin_other_error));
    }

    setViewVisibility();
}
 
开发者ID:NahroTo,项目名称:Fruit-Destroyer,代码行数:22,代码来源:SkeletonActivity.java

示例12: onClick

import com.google.example.games.basegameutils.BaseGameUtils; //导入依赖的package包/类
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.sign_in_button:
            // Check to see the developer who's running this sample code read the instructions :-)
            // NOTE: this check is here only because this is a sample! Don't include this
            // check in your actual production app.
            if (!BaseGameUtils.verifySampleSetup(this, R.string.app_id)) {
                Log.w(TAG, "*** Warning: setup problems detected. Sign in may not work!");
            }

            mSignInClicked = true;
            mTurnBasedMatch = null;
            findViewById(R.id.sign_in_button).setVisibility(View.GONE);
            mGoogleApiClient.connect();
            break;
        case R.id.sign_out_button:
            mSignInClicked = false;
            Games.signOut(mGoogleApiClient);
            if (mGoogleApiClient.isConnected()) {
                mGoogleApiClient.disconnect();
            }
            setViewVisibility();
            break;
    }
}
 
开发者ID:NahroTo,项目名称:Fruit-Destroyer,代码行数:27,代码来源:SkeletonActivity.java

示例13: onConnectionFailed

import com.google.example.games.basegameutils.BaseGameUtils; //导入依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
    Log.d(TAG, "onConnectionFailed(): attempting to resolve");
    if (mResolvingConnectionFailure) {
        Log.d(TAG, "onConnectionFailed(): already resolving, ignoring");
        return;
    }

    if (mSignInClicked || mAutoStartSignInFlow) {
        mAutoStartSignInFlow = false;
        mSignInClicked = false;
        mResolvingConnectionFailure = true;
        if (!BaseGameUtils.resolveConnectionFailure(this, mGoogleApiClient, connectionResult,
                RC_SIGN_IN, getString(R.string.signin_other_error))) {
            mResolvingConnectionFailure = false;
        }
    }
    showSignInBar();
}
 
开发者ID:NahroTo,项目名称:Fruit-Destroyer,代码行数:20,代码来源:MainActivity.java

示例14: onConnectionFailed

import com.google.example.games.basegameutils.BaseGameUtils; //导入依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
  Log.d(TAG, "onConnectionFailed() called, result: " + connectionResult);

  if (mResolvingConnectionFailure) {
    Log.d(TAG, "onConnectionFailed() ignoring connection failure; already resolving.");
    return;
  }

  if (mSignInClicked || mAutoStartSignInFlow) {
    mAutoStartSignInFlow = false;
    mSignInClicked = false;
    mResolvingConnectionFailure = BaseGameUtils.resolveConnectionFailure(this, mGoogleApiClient,
        connectionResult, RC_SIGN_IN, getString(R.string.signin_other_error));
  }
  showSignInBar();
}
 
开发者ID:NahroTo,项目名称:Fruit-Destroyer,代码行数:18,代码来源:MainActivity.java

示例15: onConnectionFailed

import com.google.example.games.basegameutils.BaseGameUtils; //导入依赖的package包/类
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
    Log.d(TAG, "onConnectionFailed");
    if (mIsResolving) {
        // The application is attempting to resolve this connection failure already.
        Log.d(TAG, "onConnectionFailed: already resolving");
        return;
    }

    if (mSignInClicked || mAutoStartSignIn) {
        mSignInClicked = false;
        mAutoStartSignIn = false;

        // Attempt to resolve the connection failure.
        Log.d(TAG, "onConnectionFailed: begin resolution.");
        mIsResolving = BaseGameUtils.resolveConnectionFailure(this, mGoogleApiClient,
                connectionResult, RC_SIGN_IN, getString(R.string.signin_other_error));
    }

    updateUI();
}
 
开发者ID:NahroTo,项目名称:Fruit-Destroyer,代码行数:22,代码来源:MainActivity.java


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