use of sugar.free.sightparser.handling.SingleMessageTaskRunner in project SightRemote by TebbeUbben.
the class HistorySyncService method onStatusChange.
@Override
public void onStatusChange(Status status) {
if (status == Status.CONNECTED) {
connector.connect();
ReadStatusParamBlockMessage readMessage = new ReadStatusParamBlockMessage();
readMessage.setStatusBlockId(SystemIdentificationBlock.ID);
new SingleMessageTaskRunner(connector, readMessage).fetch(this);
} else if (status == Status.DISCONNECTED) {
connector.disconnect();
connector.disconnectFromService();
syncing = false;
sendBroadcast(new Intent(HistoryBroadcast.ACTION_SYNC_FINISHED));
if (wakeLock.isHeld())
wakeLock.release();
}
}
use of sugar.free.sightparser.handling.SingleMessageTaskRunner in project SightRemote by TebbeUbben.
the class StandardBolusActivity method onClick.
@Override
public void onClick(View view) {
StandardBolusMessage message = new StandardBolusMessage();
message.setAmount(bolusAmountPicker.getPickerValue());
final SingleMessageTaskRunner taskRunner = new SingleMessageTaskRunner(getServiceConnector(), message);
(confirmationDialog = new ConfirmationDialog(this, HTMLUtil.getHTML(R.string.standard_bolus_confirmation, UnitFormatter.formatUnits(bolusAmountPicker.getPickerValue())), () -> {
showLoadingIndicator();
taskRunner.fetch(StandardBolusActivity.this);
})).show();
}
Aggregations