public static ReadStepCountStatus ( GoogleApiClient googleApiClient ) : Task |
||
googleApiClient | GoogleApiClient | |
Résultat | Task |
void ConnectGoogleApiClient() { googleApiClient = new GoogleApiClient.Builder(this) .AddApi(WearableClass.API) .AddConnectionCallbacks( async connectionHint => { if (Log.IsLoggable(Tag, LogPriority.Info)) { Log.Info(Tag, "Connected to the Google API client"); } var stepCountOn = await XFitWatchfaceConfigHelper.ReadStepCountStatus(googleApiClient); var stepCountState = stepCountOn ? "ON" : "OFF"; var stepCountSetting = new Setting($"Step count\n{stepCountState}", "stepcount", stepCountOn); settings = new Setting[] { stepCountSetting }; listView.SetAdapter(new ListAdapter(this, settings)); }, cause => { if (Log.IsLoggable(Tag, LogPriority.Info)) { Log.Info(Tag, "Connection suspended"); } } ) .Build(); googleApiClient.Connect(); }
void ConnectGoogleApiClient() { googleApiClient = new GoogleApiClient.Builder(this) .AddApi(WearableClass.API) .AddConnectionCallbacks( async connectionHint => { if (Log.IsLoggable(Tag, LogPriority.Info)) { Log.Info(Tag, "Connected to the Google API client"); } stepCountOn = await XFitWatchfaceConfigHelper.ReadStepCountStatus(googleApiClient); UpdateUI(); }, cause => { if (Log.IsLoggable(Tag, LogPriority.Info)) { Log.Info(Tag, "Connection suspended"); } } ) .Build(); googleApiClient.Connect(); }