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(); }
public ListAdapter(Context context, Setting[] items) { this.context = context; this.items = items; inflater = LayoutInflater.From(context); }