本文整理汇总了Java中com.google.android.gms.games.leaderboard.Leaderboards.SubmitScoreResult方法的典型用法代码示例。如果您正苦于以下问题:Java Leaderboards.SubmitScoreResult方法的具体用法?Java Leaderboards.SubmitScoreResult怎么用?Java Leaderboards.SubmitScoreResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.games.leaderboard.Leaderboards
的用法示例。
在下文中一共展示了Leaderboards.SubmitScoreResult方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: A
import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
public Leaderboards.SubmitScoreResult A(final Status paramStatus)
{
return new Leaderboards.SubmitScoreResult()
{
public ScoreSubmissionData getScoreData()
{
return new ScoreSubmissionData(DataHolder.empty(14));
}
public Status getStatus()
{
return paramStatus;
}
public void release()
{
}
};
}
示例2: submitScoreWithResult
import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
@Override
public void submitScoreWithResult(int highScore, IScoreCallback scoreCallback) {
if (isSignedIn()) {
PendingResult<Leaderboards.SubmitScoreResult> result = Games.Leaderboards.submitScoreImmediate(
gameHelper.getApiClient(),
activity.getString(R.string.leaderboard_highscore),
highScore);
result.setResultCallback(new ScoreCallback(scoreCallback), 3000, TimeUnit.SECONDS);
}
}
示例3: onResult
import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
@Override
public void onResult(@NonNull Leaderboards.SubmitScoreResult submitScoreResult) {
final boolean alltimeBest = submitScoreResult.getScoreData().getScoreResult(TIME_SPAN_ALL_TIME).newBest;
final boolean weeklyBest = submitScoreResult.getScoreData().getScoreResult(TIME_SPAN_WEEKLY).newBest;
final boolean dailyBest = submitScoreResult.getScoreData().getScoreResult(TIME_SPAN_DAILY).newBest;
callback.onScoreResult(alltimeBest, weeklyBest, dailyBest);
}
示例4: call
import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
@Override
public FREObject call(FREContext context, FREObject[] args) {
super.call(context, args);
AIR.log( "GameServices::reportScore" );
String leaderboardId = FREObjectUtils.getString( args[0] );
double scoreValue = FREObjectUtils.getDouble( args[1] );
boolean immediate = FREObjectUtils.getBoolean( args[2] );
GameServicesHelper helper = GameServicesHelper.getInstance();
if( helper.isAuthenticated() ) {
if( immediate ) {
PendingResult<Leaderboards.SubmitScoreResult> result = Games.Leaderboards.submitScoreImmediate( helper.getClient(), leaderboardId, (long) scoreValue );
result.setResultCallback( this, 10, TimeUnit.SECONDS );
return null;
}
Games.Leaderboards.submitScore( GameServicesHelper.getInstance().getClient(), leaderboardId, (long) scoreValue );
AIR.log( "Successfully submitted score to leaderboard: " + leaderboardId );
AIR.dispatchEvent( GameServicesEvent.REPORT_SCORE_SUCCESS );
} else {
AIR.log( "Cannot report score, user is not signed in." );
AIR.dispatchEvent( GameServicesEvent.REPORT_SCORE_ERROR, "Cannot report score, user is not signed in." );
}
return null;
}
示例5: onResult
import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
@Override
public void onResult( @NonNull Leaderboards.SubmitScoreResult result ) {
com.google.android.gms.common.api.Status status = result.getStatus();
if( !status.isSuccess() ) {
AIR.log( "Failed to submit score: " + status.getStatusMessage() );
AIR.dispatchEvent( GameServicesEvent.REPORT_SCORE_ERROR, status.getStatusMessage() );
return;
}
result.release();
AIR.log( "Successfully submitted score" );
AIR.dispatchEvent( GameServicesEvent.REPORT_SCORE_SUCCESS );
}
示例6: onResult
import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
/**
Scored pushed online.
Update of the value NEED_TO_SYNC on SharedPreferences: there's no need to sync.
*/
@Override
public void onResult(@NonNull Leaderboards.SubmitScoreResult res) {
if (res.getStatus().getStatusCode() == 0) {
// data sent successfully to server.
// display toast.
Log.d("##ClassicLeaderboardCal","SCORE SENT");
final SharedPreferences pref = getApplicationContext().getSharedPreferences(Constants.PREF_KEY, Context.MODE_PRIVATE);
pref.edit().putInt(Constants.NEED_TO_SYNC_CLASSIC, 0).apply();
}
}
示例7: onResult
import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
/**
Scored pushed online.
Update of the value NEED_TO_SYNC on SharedPreferences: there's no need to sync.
*/
@Override
public void onResult(@NonNull Leaderboards.SubmitScoreResult res) {
if (res.getStatus().getStatusCode() == 0) {
// data sent successfully to server.
// display toast.
Log.d("##HardLeaderboardCall","SCORE SENT");
final SharedPreferences pref = getApplicationContext().getSharedPreferences(Constants.PREF_KEY, Context.MODE_PRIVATE);
pref.edit().putInt(Constants.NEED_TO_SYNC_HARD, 0).apply();
}
}
示例8: onResult
import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
@Override
public void onResult(Leaderboards.SubmitScoreResult res) {
if (res.getStatus().getStatusCode() == 0) {
// data sent successfully to server.
// display toast.
Log.d("##LeaderboardCallback","SCORE SENT");
}
}
示例9: submitScoreImmediate
import com.google.android.gms.games.leaderboard.Leaderboards; //导入方法依赖的package包/类
public final PendingResult<Leaderboards.SubmitScoreResult> submitScoreImmediate(GoogleApiClient paramGoogleApiClient, final String paramString1, final long paramLong, String paramString2)
{
return paramGoogleApiClient.b(new d()
{
protected void a(fl paramAnonymousfl)
{
paramAnonymousfl.a(this, paramString1, paramLong, this.vg);
}
});
}