ReadStepCountStatus() публичный статический Метод

public static ReadStepCountStatus ( GoogleApiClient googleApiClient ) : Task
googleApiClient GoogleApiClient
Результат Task
Пример #1
0
        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();
        }