Search in sources :

Example 6 with SingleMessageTaskRunner

use of sugar.free.sightparser.handling.SingleMessageTaskRunner in project SightRemote by TebbeUbben.

the class ExtendedBolusActivity method onClick.

@Override
public void onClick(View view) {
    ExtendedBolusMessage message = new ExtendedBolusMessage();
    message.setAmount(bolusAmountPicker.getPickerValue());
    message.setDuration(durationPicker.getPickerValue());
    SingleMessageTaskRunner taskRunner = new SingleMessageTaskRunner(getServiceConnector(), message);
    (confirmationDialog = new ConfirmationDialog(this, HTMLUtil.getHTML(R.string.extended_bolus_confirmation, UnitFormatter.formatUnits(bolusAmountPicker.getPickerValue()), UnitFormatter.formatDuration(durationPicker.getPickerValue())), () -> {
        showLoadingIndicator();
        taskRunner.fetch(ExtendedBolusActivity.this);
    })).show();
}
Also used : ExtendedBolusMessage(sugar.free.sightparser.applayer.messages.remote_control.ExtendedBolusMessage) SingleMessageTaskRunner(sugar.free.sightparser.handling.SingleMessageTaskRunner) ConfirmationDialog(sugar.free.sightremote.dialogs.ConfirmationDialog)

Example 7 with SingleMessageTaskRunner

use of sugar.free.sightparser.handling.SingleMessageTaskRunner in project SightRemote by TebbeUbben.

the class MultiwaveBolusActivity method onClick.

@Override
public void onClick(View view) {
    MultiwaveBolusMessage message = new MultiwaveBolusMessage();
    message.setAmount(immediateBolusAmountPicker.getPickerValue());
    message.setDelayedAmount(delayedBolusAmountPicker.getPickerValue());
    message.setDuration(durationPicker.getPickerValue());
    SingleMessageTaskRunner taskRunner = new SingleMessageTaskRunner(getServiceConnector(), message);
    (confirmationDialog = new ConfirmationDialog(this, HTMLUtil.getHTML(R.string.multiwave_bolus_confirmation, UnitFormatter.formatUnits(immediateBolusAmountPicker.getPickerValue()), UnitFormatter.formatUnits(delayedBolusAmountPicker.getPickerValue()), UnitFormatter.formatDuration(durationPicker.getPickerValue())), () -> {
        showLoadingIndicator();
        taskRunner.fetch(MultiwaveBolusActivity.this);
    })).show();
}
Also used : SingleMessageTaskRunner(sugar.free.sightparser.handling.SingleMessageTaskRunner) MultiwaveBolusMessage(sugar.free.sightparser.applayer.messages.remote_control.MultiwaveBolusMessage) ConfirmationDialog(sugar.free.sightremote.dialogs.ConfirmationDialog)

Example 8 with SingleMessageTaskRunner

use of sugar.free.sightparser.handling.SingleMessageTaskRunner in project SightRemote by TebbeUbben.

the class TimeSynchronizationService method onStatusChange.

@Override
public void onStatusChange(Status status) {
    if (status == Status.CONNECTED) {
        serviceConnector.connect();
        new SingleMessageTaskRunner(serviceConnector, new ReadDateTimeMessage()).fetch(this);
    } else
        serviceConnector.disconnect();
}
Also used : ReadDateTimeMessage(sugar.free.sightparser.applayer.messages.status.ReadDateTimeMessage) SingleMessageTaskRunner(sugar.free.sightparser.handling.SingleMessageTaskRunner)

Example 9 with SingleMessageTaskRunner

use of sugar.free.sightparser.handling.SingleMessageTaskRunner in project SightRemote by TebbeUbben.

the class AlertService method muteAlert.

public void muteAlert() {
    MuteAlertMessage muteAlertMessage = new MuteAlertMessage();
    muteAlertMessage.setAlertID(latestId);
    new SingleMessageTaskRunner(serviceConnector, muteAlertMessage).fetch(errorToastCallback);
    Answers.getInstance().logCustom(new CustomEvent("Mute Alert"));
}
Also used : CustomEvent(com.crashlytics.android.answers.CustomEvent) MuteAlertMessage(sugar.free.sightparser.applayer.messages.remote_control.MuteAlertMessage) SingleMessageTaskRunner(sugar.free.sightparser.handling.SingleMessageTaskRunner)

Example 10 with SingleMessageTaskRunner

use of sugar.free.sightparser.handling.SingleMessageTaskRunner in project SightRemote by TebbeUbben.

the class AlertService method dismissAlert.

public void dismissAlert() {
    DismissAlertMessage dismissAlertMessage = new DismissAlertMessage();
    dismissAlertMessage.setAlertID(latestId);
    new SingleMessageTaskRunner(serviceConnector, dismissAlertMessage).fetch(errorToastCallback);
    Answers.getInstance().logCustom(new CustomEvent("Dismiss Alert"));
}
Also used : CustomEvent(com.crashlytics.android.answers.CustomEvent) DismissAlertMessage(sugar.free.sightparser.applayer.messages.remote_control.DismissAlertMessage) SingleMessageTaskRunner(sugar.free.sightparser.handling.SingleMessageTaskRunner)

Aggregations

SingleMessageTaskRunner (sugar.free.sightparser.handling.SingleMessageTaskRunner)12 ConfirmationDialog (sugar.free.sightremote.dialogs.ConfirmationDialog)4 CustomEvent (com.crashlytics.android.answers.CustomEvent)3 PendingIntent (android.app.PendingIntent)2 Intent (android.content.Intent)2 ReadDateTimeMessage (sugar.free.sightparser.applayer.messages.status.ReadDateTimeMessage)2 ReadStatusParamBlockMessage (sugar.free.sightparser.applayer.messages.status_param.ReadStatusParamBlockMessage)2 HistorySendIntent (sugar.free.sightremote.utils.HistorySendIntent)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 List (java.util.List)1 Timer (java.util.Timer)1 TimerTask (java.util.TimerTask)1 AppLayerMessage (sugar.free.sightparser.applayer.messages.AppLayerMessage)1 CancelBolusMessage (sugar.free.sightparser.applayer.messages.remote_control.CancelBolusMessage)1 CancelTBRMessage (sugar.free.sightparser.applayer.messages.remote_control.CancelTBRMessage)1 DismissAlertMessage (sugar.free.sightparser.applayer.messages.remote_control.DismissAlertMessage)1 ExtendedBolusMessage (sugar.free.sightparser.applayer.messages.remote_control.ExtendedBolusMessage)1 MultiwaveBolusMessage (sugar.free.sightparser.applayer.messages.remote_control.MultiwaveBolusMessage)1 MuteAlertMessage (sugar.free.sightparser.applayer.messages.remote_control.MuteAlertMessage)1