diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/treatments/TreatmentsPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/treatments/TreatmentsPluginTest.kt index a5a6e81bfb..a8e1af60e9 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/treatments/TreatmentsPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/treatments/TreatmentsPluginTest.kt @@ -8,6 +8,7 @@ import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.db.DatabaseHelper import info.nightscout.androidaps.db.TemporaryBasal import info.nightscout.androidaps.plugins.general.nsclient.NSUpload +import info.nightscout.androidaps.plugins.general.nsclient.UploadQueue import info.nightscout.androidaps.plugins.insulin.InsulinOrefRapidActingPlugin import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy @@ -33,6 +34,7 @@ class TreatmentsPluginTest : TestBaseWithProfile() { @Mock lateinit var databaseHelper: DatabaseHelper @Mock lateinit var treatmentService: TreatmentService @Mock lateinit var nsUpload: NSUpload + @Mock lateinit var uploadQueue: UploadQueue val injector = HasAndroidInjector { AndroidInjector { @@ -58,7 +60,7 @@ class TreatmentsPluginTest : TestBaseWithProfile() { `when`(profileFunction.getProfile(ArgumentMatchers.anyLong())).thenReturn(validProfile) `when`(activePluginProvider.activeInsulin).thenReturn(insulinOrefRapidActingPlugin) - sot = TreatmentsPlugin(profileInjector, aapsLogger, rxBus, resourceHelper, context, sp, profileFunction, activePluginProvider, nsUpload, fabricPrivacy, dateUtil) + sot = TreatmentsPlugin(profileInjector, aapsLogger, rxBus, resourceHelper, context, sp, profileFunction, activePluginProvider, nsUpload, fabricPrivacy, dateUtil, uploadQueue) sot.service = treatmentService } diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java index 8f6cc6ced9..c7b92f7181 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java @@ -87,6 +87,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.event.EventOmnipodUncerta import info.nightscout.androidaps.plugins.pump.omnipod.manager.AapsOmnipodManager; import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.CommandAcknowledgeAlerts; import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.CommandHandleTimeChange; +import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.CommandPlayTestBeep; import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.CommandUpdateAlertConfiguration; import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.OmnipodCustomCommand; import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.OmnipodCustomCommandType; @@ -315,6 +316,7 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface, event.isChanged(getResourceHelper(), R.string.key_omnipod_smb_beeps_enabled) || event.isChanged(getResourceHelper(), R.string.key_omnipod_suspend_delivery_button_enabled) || event.isChanged(getResourceHelper(), R.string.key_omnipod_pulse_log_button_enabled) || + event.isChanged(getResourceHelper(), R.string.key_omnipod_rileylink_stats_button_enabled) || event.isChanged(getResourceHelper(), R.string.key_omnipod_time_change_event_enabled) || event.isChanged(getResourceHelper(), R.string.key_omnipod_notification_uncertain_tbr_sound_enabled) || event.isChanged(getResourceHelper(), R.string.key_omnipod_notification_uncertain_smb_sound_enabled) || @@ -845,6 +847,8 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface, return handleTimeChange(((CommandHandleTimeChange) command).isRequestedByUser()); case UPDATE_ALERT_CONFIGURATION: return updateAlertConfiguration(); + case PLAY_TEST_BEEP: + return executeCommand(OmnipodCommandType.PLAY_TEST_BEEP, () -> aapsOmnipodManager.playTestBeep(((CommandPlayTestBeep) command).getBeepType())); default: aapsLogger.warn(LTag.PUMP, "Unknown custom command: " + commandType); return new PumpEnactResult(getInjector()).success(false).enacted(false).comment(resourceHelper.gs(R.string.omnipod_error_unknown_custom_command, commandType)); diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/definition/OmnipodCommandType.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/definition/OmnipodCommandType.java index 8d9b250ac4..7cbc3c8a11 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/definition/OmnipodCommandType.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/definition/OmnipodCommandType.java @@ -21,7 +21,8 @@ public enum OmnipodCommandType { ACKNOWLEDGE_ALERTS(R.string.omnipod_cmd_acknowledge_alerts), // READ_POD_PULSE_LOG(R.string.omnipod_cmd_read_pulse_log), // SUSPEND_DELIVERY(R.string.omnipod_cmd_suspend_delivery), - RESUME_DELIVERY(R.string.omnipod_cmd_resume_delivery); + RESUME_DELIVERY(R.string.omnipod_cmd_resume_delivery), + PLAY_TEST_BEEP(R.string.omnipod_cmd_play_test_beep); private int resourceId; diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/definition/OmnipodStorageKeys.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/definition/OmnipodStorageKeys.java index 5a373177fe..07601bb9bd 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/definition/OmnipodStorageKeys.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/definition/OmnipodStorageKeys.java @@ -21,6 +21,7 @@ public class OmnipodStorageKeys { public static final int NOTIFICATION_UNCERTAIN_SMB_SOUND_ENABLED = R.string.key_omnipod_notification_uncertain_smb_sound_enabled; public static final int NOTIFICATION_UNCERTAIN_BOLUS_SOUND_ENABLED = R.string.key_omnipod_notification_uncertain_bolus_sound_enabled; public static final int AUTOMATICALLY_ACKNOWLEDGE_ALERTS_ENABLED = R.string.key_omnipod_automatically_acknowledge_alerts_enabled; + public static final int RILEYLINK_STATS_BUTTON_ENABLED = R.string.key_omnipod_rileylink_stats_button_enabled; } public static class Statistics { diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/definition/PodHistoryEntryType.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/definition/PodHistoryEntryType.java index 89560786e0..47b2fd7693 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/definition/PodHistoryEntryType.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/definition/PodHistoryEntryType.java @@ -35,6 +35,7 @@ public enum PodHistoryEntryType { CONFIGURE_ALERTS(50, R.string.omnipod_cmd_configure_alerts, PumpHistoryEntryGroup.Alarm), ACKNOWLEDGE_ALERTS(51, R.string.omnipod_cmd_acknowledge_alerts, PumpHistoryEntryGroup.Alarm), + PLAY_TEST_BEEP(52, R.string.omnipod_cmd_play_test_beep, PumpHistoryEntryGroup.Alarm), SUSPEND_DELIVERY(60, R.string.omnipod_cmd_suspend_delivery, PumpHistoryEntryGroup.Basal), RESUME_DELIVERY(61, R.string.omnipod_cmd_resume_delivery, PumpHistoryEntryGroup.Basal), diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/action/ConfigureBeepAction.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/action/ConfigureBeepAction.java new file mode 100644 index 0000000000..e5c0e0dbb4 --- /dev/null +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/action/ConfigureBeepAction.java @@ -0,0 +1,48 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action; + +import org.joda.time.Duration; + +import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.BeepConfigCommand; +import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse; +import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.BeepConfigType; +import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager; +import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.manager.OmnipodRileyLinkCommunicationManager; + +public class ConfigureBeepAction implements OmnipodAction { + private final PodStateManager podStateManager; + private final BeepConfigType beepType; + private final boolean basalCompletionBeep; + private final Duration basalIntervalBeep; + private final boolean tempBasalCompletionBeep; + private final Duration tempBasalIntervalBeep; + private final boolean bolusCompletionBeep; + private final Duration bolusIntervalBeep; + + public ConfigureBeepAction(PodStateManager podState, BeepConfigType beepType, boolean basalCompletionBeep, Duration basalIntervalBeep, boolean tempBasalCompletionBeep, Duration tempBasalIntervalBeep, boolean bolusCompletionBeep, Duration bolusIntervalBeep) { + if (podState == null || beepType == null) { + throw new IllegalArgumentException("Required parameter(s) missing"); + } + + this.beepType = beepType; + this.basalCompletionBeep = basalCompletionBeep; + this.basalIntervalBeep = basalIntervalBeep; + this.tempBasalCompletionBeep = tempBasalCompletionBeep; + this.tempBasalIntervalBeep = tempBasalIntervalBeep; + this.bolusCompletionBeep = bolusCompletionBeep; + this.bolusIntervalBeep = bolusIntervalBeep; + this.podStateManager = podState; + } + + public ConfigureBeepAction(PodStateManager podState, BeepConfigType beepType) { + this(podState, beepType, false, Duration.ZERO, false, Duration.ZERO, false, Duration.ZERO); + } + + @Override + public StatusResponse execute(OmnipodRileyLinkCommunicationManager communicationService) { + return communicationService.sendCommand( + StatusResponse.class, podStateManager, + new BeepConfigCommand(beepType, basalCompletionBeep, basalIntervalBeep, + tempBasalCompletionBeep, tempBasalIntervalBeep, + bolusCompletionBeep, bolusIntervalBeep)); + } +} diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/action/InsertCannulaAction.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/action/InsertCannulaAction.java index ff47b1b900..a6fdd139d9 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/action/InsertCannulaAction.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/action/InsertCannulaAction.java @@ -58,7 +58,7 @@ public class InsertCannulaAction implements OmnipodAction { if (podStateManager.getActivationProgress().needsCannulaInsertion()) { communicationService.executeAction(new BolusAction(podStateManager, OmnipodConstants.POD_CANNULA_INSERTION_BOLUS_UNITS, - Duration.standardSeconds(1), false, false)); + Duration.standardSeconds(1), false, true)); podStateManager.setActivationProgress(ActivationProgress.INSERTING_CANNULA); } diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/action/service/PrimeService.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/action/service/PrimeService.java index 062731e002..ed75d439be 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/action/service/PrimeService.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/action/service/PrimeService.java @@ -32,6 +32,6 @@ public class PrimeService { public StatusResponse executePrimeBolusCommand(OmnipodRileyLinkCommunicationManager communicationService, PodStateManager podStateManager) { return communicationService.executeAction(new BolusAction(podStateManager, OmnipodConstants.POD_PRIME_BOLUS_UNITS, - Duration.standardSeconds(1), false, false)); + Duration.standardSeconds(1), false, true)); } } diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/message/command/BeepConfigCommand.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/message/command/BeepConfigCommand.java index fc36e68eab..47cf4533ba 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/message/command/BeepConfigCommand.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/communication/message/command/BeepConfigCommand.java @@ -30,10 +30,6 @@ public class BeepConfigCommand extends MessageBlock { encode(); } - public BeepConfigCommand(BeepConfigType beepType) { - this(beepType, false, Duration.ZERO, false, Duration.ZERO, false, Duration.ZERO); - } - private void encode() { encodedData = new byte[]{beepType.getValue()}; encodedData = ByteUtil.concat(encodedData, (byte) ((basalCompletionBeep ? (1 << 6) : 0) + (basalIntervalBeep.getStandardMinutes() & 0x3f))); diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/OmnipodManager.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/OmnipodManager.java index 858186bc7f..d29f479dfa 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/OmnipodManager.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/OmnipodManager.java @@ -18,6 +18,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.acti import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.BolusAction; import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.CancelDeliveryAction; import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.ConfigureAlertsAction; +import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.ConfigureBeepAction; import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.DeactivatePodAction; import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.GetPodInfoAction; import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.GetStatusAction; @@ -33,6 +34,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.mess import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.podinfo.PodInfoResponse; import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.ActivationProgress; import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertConfiguration; +import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.BeepConfigType; import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.BeepType; import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.DeliveryStatus; import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.DeliveryType; @@ -490,6 +492,25 @@ public class OmnipodManager { podStateManager.discardState(); } + public synchronized void configureBeeps(BeepConfigType beepType, boolean basalCompletionBeep, Duration basalIntervalBeep, + boolean tempBasalCompletionBeep, Duration tempBasalIntervalBeep, + boolean bolusCompletionBeep, Duration bolusIntervalBeep) { + if (!podStateManager.isPodInitialized()) { + throw new IllegalPodProgressException(PodProgressStatus.REMINDER_INITIALIZED, null); + } + communicationService.executeAction(new ConfigureBeepAction( + podStateManager, beepType, basalCompletionBeep, + basalIntervalBeep, tempBasalCompletionBeep, tempBasalIntervalBeep, + bolusCompletionBeep, bolusIntervalBeep)); + } + + public synchronized void playTestBeep(BeepConfigType beepType) { + if (!podStateManager.isPodInitialized()) { + throw new IllegalPodProgressException(PodProgressStatus.REMINDER_INITIALIZED, null); + } + communicationService.executeAction(new ConfigureBeepAction(podStateManager, beepType)); + } + public OmnipodRileyLinkCommunicationManager getCommunicationService() { return communicationService; } diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java index f430dcca4e..b0ff0ef435 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java @@ -50,6 +50,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.mess import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.podinfo.PodInfoRecentPulseLog; import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.podinfo.PodInfoResponse; import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertConfiguration; +import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.BeepConfigType; import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.FaultEventCode; import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants; import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType; @@ -119,6 +120,8 @@ public class AapsOmnipodManager { private boolean notificationUncertainSmbSoundEnabled; private boolean notificationUncertainBolusSoundEnabled; private boolean automaticallyAcknowledgeAlertsEnabled; + private boolean testBeepButtonEnabled; + private boolean rileylinkStatsButtonEnabled; @Inject public AapsOmnipodManager(OmnipodRileyLinkCommunicationManager communicationService, @@ -159,9 +162,10 @@ public class AapsOmnipodManager { basalBeepsEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.BASAL_BEEPS_ENABLED, true); bolusBeepsEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.BOLUS_BEEPS_ENABLED, true); smbBeepsEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.SMB_BEEPS_ENABLED, true); - tbrBeepsEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.TBR_BEEPS_ENABLED, true); + tbrBeepsEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.TBR_BEEPS_ENABLED, false); suspendDeliveryButtonEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.SUSPEND_DELIVERY_BUTTON_ENABLED, false); pulseLogButtonEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.PULSE_LOG_BUTTON_ENABLED, false); + rileylinkStatsButtonEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.RILEYLINK_STATS_BUTTON_ENABLED, false); timeChangeEventEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.TIME_CHANGE_EVENT_ENABLED, true); notificationUncertainTbrSoundEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_TBR_SOUND_ENABLED, true); notificationUncertainSmbSoundEnabled = sp.getBoolean(OmnipodStorageKeys.Preferences.NOTIFICATION_UNCERTAIN_SMB_SOUND_ENABLED, true); @@ -239,6 +243,20 @@ public class AapsOmnipodManager { return new PumpEnactResult(injector).success(true).enacted(false); } + public PumpEnactResult playTestBeep(BeepConfigType beepType) { + try { + executeCommand(() -> delegate.playTestBeep(beepType)); + } catch (Exception ex) { + String errorMessage = translateException(ex); + addFailureToHistory(PodHistoryEntryType.PLAY_TEST_BEEP, errorMessage); + return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage); + } + + addSuccessToHistory(PodHistoryEntryType.PLAY_TEST_BEEP, beepType); + return new PumpEnactResult(injector).success(true).enacted(false); + } + + public PumpEnactResult getPodStatus() { StatusResponse statusResponse; @@ -620,6 +638,14 @@ public class AapsOmnipodManager { return pulseLogButtonEnabled; } + public boolean isTestBeepButtonEnabled() { + return testBeepButtonEnabled; + } + + public boolean isRileylinkStatsButtonEnabled() { + return rileylinkStatsButtonEnabled; + } + public boolean isTimeChangeEventEnabled() { return timeChangeEventEnabled; } diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/queue/command/CommandPlayTestBeep.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/queue/command/CommandPlayTestBeep.java new file mode 100644 index 0000000000..94ff4996c0 --- /dev/null +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/queue/command/CommandPlayTestBeep.java @@ -0,0 +1,16 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.queue.command; + +import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.BeepConfigType; + +public class CommandPlayTestBeep extends OmnipodCustomCommand { + private BeepConfigType beepType; + + public CommandPlayTestBeep(BeepConfigType beepType) { + super(OmnipodCustomCommandType.PLAY_TEST_BEEP); + this.beepType = beepType; + } + + public BeepConfigType getBeepType() { + return beepType; + } +} diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/queue/command/OmnipodCustomCommandType.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/queue/command/OmnipodCustomCommandType.java index e6df62c47b..f5c787be26 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/queue/command/OmnipodCustomCommandType.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/queue/command/OmnipodCustomCommandType.java @@ -8,7 +8,9 @@ public enum OmnipodCustomCommandType { RESUME_DELIVERY("RESUME DELIVERY"), DEACTIVATE_POD("DEACTIVATE POD"), HANDLE_TIME_CHANGE("HANDLE TIME CHANGE"), - UPDATE_ALERT_CONFIGURATION("UPDATE ALERT CONFIGURATION"); + UPDATE_ALERT_CONFIGURATION("UPDATE ALERT CONFIGURATION"), + PLAY_TEST_BEEP("PLAY TEST BEEP") + ; private final String description; diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/OmnipodOverviewFragment.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/OmnipodOverviewFragment.kt index 707a133a6f..32260d1fc9 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/OmnipodOverviewFragment.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/OmnipodOverviewFragment.kt @@ -19,7 +19,6 @@ import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin import info.nightscout.androidaps.plugins.pump.omnipod.R @@ -30,7 +29,11 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateMa import info.nightscout.androidaps.plugins.pump.omnipod.driver.util.TimeUtil import info.nightscout.androidaps.plugins.pump.omnipod.event.EventOmnipodPumpValuesChanged import info.nightscout.androidaps.plugins.pump.omnipod.manager.AapsOmnipodManager -import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.* +import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.CommandAcknowledgeAlerts +import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.CommandGetPodStatus +import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.CommandHandleTimeChange +import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.CommandResumeDelivery +import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.CommandSuspendDelivery import info.nightscout.androidaps.plugins.pump.omnipod.util.AapsOmnipodUtil import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodAlertUtil import info.nightscout.androidaps.queue.Callback @@ -119,14 +122,6 @@ class OmnipodOverviewFragment : DaggerFragment() { DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_refresh_status), false)) } - omnipod_overview_button_rileylink_stats.setOnClickListener { - if (omnipodPumpPlugin.rileyLinkService?.verifyConfiguration() == true) { - startActivity(Intent(context, RileyLinkStatusActivity::class.java)) - } else { - displayNotConfiguredDialog() - } - } - omnipod_overview_button_acknowledge_active_alerts.setOnClickListener { disablePodActionButtons() commandQueue.customCommand(CommandAcknowledgeAlerts(), @@ -147,12 +142,6 @@ class OmnipodOverviewFragment : DaggerFragment() { DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_set_time), true) .messageOnSuccess(resourceHelper.gs(R.string.omnipod_confirmation_time_on_pod_updated))) } - - omnipod_overview_button_pulse_log.setOnClickListener { - disablePodActionButtons() - commandQueue.customCommand(CommandReadPulseLog(), - DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_read_pulse_log), false)) - } } override fun onResume() { @@ -468,7 +457,6 @@ class OmnipodOverviewFragment : DaggerFragment() { updateAcknowledgeAlertsButton() updateSuspendDeliveryButton() updateSetTimeButton() - updatePulseLogButton() } private fun disablePodActionButtons() { @@ -477,7 +465,6 @@ class OmnipodOverviewFragment : DaggerFragment() { omnipod_overview_button_suspend_delivery.isEnabled = false omnipod_overview_button_set_time.isEnabled = false omnipod_overview_button_refresh_status.isEnabled = false - omnipod_overview_button_pulse_log.isEnabled = false } private fun updateRefreshStatusButton() { @@ -522,15 +509,6 @@ class OmnipodOverviewFragment : DaggerFragment() { } } - private fun updatePulseLogButton() { - if (omnipodManager.isPulseLogButtonEnabled) { - omnipod_overview_button_pulse_log.visibility = View.VISIBLE - omnipod_overview_button_pulse_log.isEnabled = podStateManager.isPodActivationCompleted && rileyLinkServiceData.rileyLinkServiceState.isReady && isQueueEmpty() - } else { - omnipod_overview_button_pulse_log.visibility = View.GONE - } - } - private fun displayNotConfiguredDialog() { context?.let { UIRunnable(Runnable { diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/PodHistoryActivity.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/PodHistoryActivity.java index ff8319a557..74aded32fb 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/PodHistoryActivity.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/PodHistoryActivity.java @@ -35,6 +35,7 @@ import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; import info.nightscout.androidaps.plugins.pump.common.utils.ProfileUtil; import info.nightscout.androidaps.plugins.pump.omnipod.R; import info.nightscout.androidaps.plugins.pump.omnipod.definition.PodHistoryEntryType; +import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.BeepConfigType; import info.nightscout.androidaps.plugins.pump.omnipod.util.AapsOmnipodUtil; import info.nightscout.androidaps.utils.resources.ResourceHelper; @@ -272,6 +273,12 @@ public class PodHistoryActivity extends NoSplashAppCompatActivity { } break; + case PLAY_TEST_BEEP: { + if (historyEntry.getData() != null) { + valueView.setText(historyEntry.getData()); + } + } + break; case GET_POD_STATUS: case GET_POD_INFO: case SET_TIME: diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/PodManagementActivity.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/PodManagementActivity.kt index fa1de1ef5c..058a033d85 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/PodManagementActivity.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/PodManagementActivity.kt @@ -1,25 +1,35 @@ package info.nightscout.androidaps.plugins.pump.omnipod.ui +import android.content.Context import android.content.Intent import android.os.Bundle import dagger.android.HasAndroidInjector +import info.nightscout.androidaps.activities.ErrorHelperActivity import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.interfaces.CommandQueueProvider import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange +import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData +import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin import info.nightscout.androidaps.plugins.pump.omnipod.R import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.ActivationProgress +import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.BeepConfigType import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager import info.nightscout.androidaps.plugins.pump.omnipod.event.EventOmnipodPumpValuesChanged import info.nightscout.androidaps.plugins.pump.omnipod.manager.AapsOmnipodManager +import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.CommandPlayTestBeep +import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.CommandReadPulseLog import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.activation.PodActivationWizardActivity import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.deactivation.PodDeactivationWizardActivity +import info.nightscout.androidaps.queue.Callback +import info.nightscout.androidaps.queue.events.EventQueueChanged import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.extensions.plusAssign import info.nightscout.androidaps.utils.extensions.toVisibility import info.nightscout.androidaps.utils.resources.ResourceHelper +import info.nightscout.androidaps.utils.ui.UIRunnable import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.disposables.CompositeDisposable import kotlinx.android.synthetic.main.omnipod_pod_management.* @@ -38,6 +48,8 @@ class PodManagementActivity : NoSplashAppCompatActivity() { @Inject lateinit var injector: HasAndroidInjector @Inject lateinit var rileyLinkServiceData: RileyLinkServiceData @Inject lateinit var aapsOmnipodManager: AapsOmnipodManager + @Inject lateinit var context: Context + @Inject lateinit var omnipodPumpPlugin: OmnipodPumpPlugin private var disposables: CompositeDisposable = CompositeDisposable() @@ -55,11 +67,45 @@ class PodManagementActivity : NoSplashAppCompatActivity() { omnipod_pod_management_button_discard_pod.setOnClickListener { OKDialog.showConfirmation(this, - resourceHelper.gs(R.string.omnipod_pod_management_discard_pod_state_confirmation), Thread { + resourceHelper.gs(R.string.omnipod_pod_management_discard_pod_confirmation), Thread { aapsOmnipodManager.discardPodState() }) } + omnipod_pod_management_button_rileylink_stats.setOnClickListener { + if (omnipodPumpPlugin.rileyLinkService?.verifyConfiguration() == true) { + startActivity(Intent(context, RileyLinkStatusActivity::class.java)) + } else { + displayNotConfiguredDialog() + } + } + + omnipod_pod_management_button_play_test_beep.setOnClickListener { + omnipod_pod_management_button_play_test_beep.isEnabled = false + omnipod_pod_management_button_play_test_beep.setText(R.string.omnipod_pod_management_button_playing_test_beep) + + commandQueue.customCommand(CommandPlayTestBeep(BeepConfigType.BEEEP), object : Callback() { + override fun run() { + if (!result.success) { + displayErrorDialog(resourceHelper.gs(R.string.omnipod_warning), resourceHelper.gs(R.string.omnipod_two_strings_concatenated_by_colon, resourceHelper.gs(R.string.omnipod_error_failed_to_play_test_beep), result.comment), false) + } + } + }) + } + + omnipod_pod_management_button_pulse_log.setOnClickListener { + omnipod_pod_management_button_pulse_log.isEnabled = false + omnipod_pod_management_button_pulse_log.setText(R.string.omnipod_pod_management_button_reading_pulse_log) + + commandQueue.customCommand(CommandReadPulseLog(), object : Callback() { + override fun run() { + if (!result.success) { + displayErrorDialog(resourceHelper.gs(R.string.omnipod_warning), resourceHelper.gs(R.string.omnipod_two_strings_concatenated_by_colon, resourceHelper.gs(R.string.omnipod_error_failed_to_read_pulse_log), result.comment), false) + } + } + }) + } + omnipod_pod_management_button_pod_history.setOnClickListener { startActivity(Intent(this, PodHistoryActivity::class.java)) } @@ -75,6 +121,10 @@ class PodManagementActivity : NoSplashAppCompatActivity() { .toObservable(EventOmnipodPumpValuesChanged::class.java) .observeOn(AndroidSchedulers.mainThread()) .subscribe({ refreshButtons() }, { fabricPrivacy.logException(it) }) + disposables += rxBus + .toObservable(EventQueueChanged::class.java) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe({ refreshButtons() }, { fabricPrivacy.logException(it) }) refreshButtons() } @@ -88,24 +138,82 @@ class PodManagementActivity : NoSplashAppCompatActivity() { // Only show the discard button to reset a cached Pod address before the Pod has actually been initialized // Otherwise, users should use the Deactivate Pod Wizard. In case proper deactivation fails, // they will get an option to discard the Pod state there - // TODO maybe rename this button and the confirmation dialog text (see onCreate) val discardButtonEnabled = podStateManager.hasPodState() && !podStateManager.isPodInitialized omnipod_pod_management_button_discard_pod.visibility = discardButtonEnabled.toVisibility() + + val pulseLogButtonEnabled = aapsOmnipodManager.isPulseLogButtonEnabled + omnipod_pod_management_button_pulse_log.visibility = pulseLogButtonEnabled.toVisibility() + + omnipod_pod_management_button_rileylink_stats.visibility = aapsOmnipodManager.isRileylinkStatsButtonEnabled.toVisibility() omnipod_pod_management_waiting_for_rl_layout.visibility = (!rileyLinkServiceData.rileyLinkServiceState.isReady).toVisibility() if (rileyLinkServiceData.rileyLinkServiceState.isReady) { omnipod_pod_management_button_activate_pod.isEnabled = !podStateManager.isPodActivationCompleted omnipod_pod_management_button_deactivate_pod.isEnabled = podStateManager.activationProgress.isAtLeast(ActivationProgress.PAIRING_COMPLETED) + + if (podStateManager.isPodInitialized && podStateManager.activationProgress.isAtLeast(ActivationProgress.PAIRING_COMPLETED)) { + if (commandQueue.isCustomCommandInQueue(CommandPlayTestBeep::class.java)) { + omnipod_pod_management_button_play_test_beep.isEnabled = false + omnipod_pod_management_button_play_test_beep.setText(R.string.omnipod_pod_management_button_playing_test_beep) + } else { + omnipod_pod_management_button_play_test_beep.isEnabled = true + omnipod_pod_management_button_play_test_beep.setText(R.string.omnipod_pod_management_button_play_test_beep) + } + } else { + omnipod_pod_management_button_play_test_beep.isEnabled = false + omnipod_pod_management_button_play_test_beep.setText(R.string.omnipod_pod_management_button_play_test_beep) + } + if (discardButtonEnabled) { omnipod_pod_management_button_discard_pod.isEnabled = true } + if (pulseLogButtonEnabled) { + if (podStateManager.isPodActivationCompleted) { + if (commandQueue.isCustomCommandInQueue(CommandReadPulseLog::class.java)) { + omnipod_pod_management_button_pulse_log.isEnabled = false + omnipod_pod_management_button_pulse_log.setText(R.string.omnipod_pod_management_button_reading_pulse_log) + } else { + omnipod_pod_management_button_pulse_log.isEnabled = true + omnipod_pod_management_button_pulse_log.setText(R.string.omnipod_pod_management_button_read_pulse_log) + } + } else { + omnipod_pod_management_button_pulse_log.isEnabled = false + omnipod_pod_management_button_pulse_log.setText(R.string.omnipod_pod_management_button_read_pulse_log) + } + } } else { + omnipod_pod_management_button_play_test_beep.setText(R.string.omnipod_pod_management_button_play_test_beep) omnipod_pod_management_button_activate_pod.isEnabled = false omnipod_pod_management_button_deactivate_pod.isEnabled = false + omnipod_pod_management_button_play_test_beep.isEnabled = false + if (discardButtonEnabled) { omnipod_pod_management_button_discard_pod.isEnabled = false } + if (pulseLogButtonEnabled) { + omnipod_pod_management_button_pulse_log.isEnabled = false + omnipod_pod_management_button_pulse_log.setText(R.string.omnipod_pod_management_button_read_pulse_log) + } } } + private fun displayErrorDialog(title: String, message: String, withSound: Boolean) { + context.let { + val i = Intent(it, ErrorHelperActivity::class.java) + i.putExtra("soundid", if (withSound) R.raw.boluserror else 0) + i.putExtra("status", message) + i.putExtra("title", title) + i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + it.startActivity(i) + } + } + + private fun displayNotConfiguredDialog() { + context?.let { + UIRunnable(Runnable { + OKDialog.show(it, resourceHelper.gs(R.string.omnipod_warning), + resourceHelper.gs(R.string.omnipod_error_operation_not_possible_no_configuration), null) + }).run() + } + } } diff --git a/omnipod/src/main/res/drawable/ic_acknowledge_alerts.xml b/omnipod/src/main/res/drawable/ic_acknowledge_alerts.xml new file mode 100644 index 0000000000..9aa0dc8d80 --- /dev/null +++ b/omnipod/src/main/res/drawable/ic_acknowledge_alerts.xml @@ -0,0 +1,9 @@ + + + + diff --git a/omnipod/src/main/res/drawable/ic_actions_temptarget.xml b/omnipod/src/main/res/drawable/ic_actions_temptarget.xml deleted file mode 100644 index 28aed597c8..0000000000 --- a/omnipod/src/main/res/drawable/ic_actions_temptarget.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/omnipod/src/main/res/drawable/ic_activate_pod.xml b/omnipod/src/main/res/drawable/ic_activate_pod.xml new file mode 100644 index 0000000000..3a9f39141b --- /dev/null +++ b/omnipod/src/main/res/drawable/ic_activate_pod.xml @@ -0,0 +1,5 @@ + + + + diff --git a/omnipod/src/main/res/drawable/ic_cp_aaps_offline.xml b/omnipod/src/main/res/drawable/ic_cp_aaps_offline.xml deleted file mode 100644 index ab562c35a6..0000000000 --- a/omnipod/src/main/res/drawable/ic_cp_aaps_offline.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/omnipod/src/main/res/drawable/ic_cp_pump_canula.xml b/omnipod/src/main/res/drawable/ic_cp_pump_canula.xml deleted file mode 100644 index f302f9770c..0000000000 --- a/omnipod/src/main/res/drawable/ic_cp_pump_canula.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/omnipod/src/main/res/drawable/ic_deactivate_pod.xml b/omnipod/src/main/res/drawable/ic_deactivate_pod.xml new file mode 100644 index 0000000000..7eef8975c0 --- /dev/null +++ b/omnipod/src/main/res/drawable/ic_deactivate_pod.xml @@ -0,0 +1,5 @@ + + + + diff --git a/omnipod/src/main/res/drawable/ic_toast_delete_confirm.xml b/omnipod/src/main/res/drawable/ic_discard_pod.xml similarity index 86% rename from omnipod/src/main/res/drawable/ic_toast_delete_confirm.xml rename to omnipod/src/main/res/drawable/ic_discard_pod.xml index e5be03e8ec..9bff377c93 100644 --- a/omnipod/src/main/res/drawable/ic_toast_delete_confirm.xml +++ b/omnipod/src/main/res/drawable/ic_discard_pod.xml @@ -1,10 +1,9 @@ \ No newline at end of file diff --git a/omnipod/src/main/res/drawable/ic_local_activate.xml b/omnipod/src/main/res/drawable/ic_local_activate.xml deleted file mode 100644 index c171fe367e..0000000000 --- a/omnipod/src/main/res/drawable/ic_local_activate.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/omnipod/src/main/res/drawable/ic_loop_disabled.xml b/omnipod/src/main/res/drawable/ic_loop_disabled.xml deleted file mode 100644 index 81dabea9d6..0000000000 --- a/omnipod/src/main/res/drawable/ic_loop_disabled.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/omnipod/src/main/res/drawable/ic_play_test_beep.xml b/omnipod/src/main/res/drawable/ic_play_test_beep.xml new file mode 100644 index 0000000000..bca912f844 --- /dev/null +++ b/omnipod/src/main/res/drawable/ic_play_test_beep.xml @@ -0,0 +1,14 @@ + + + + diff --git a/omnipod/src/main/res/drawable/ic_pod_history.xml b/omnipod/src/main/res/drawable/ic_pod_history.xml new file mode 100644 index 0000000000..07846055da --- /dev/null +++ b/omnipod/src/main/res/drawable/ic_pod_history.xml @@ -0,0 +1,7 @@ + + + + + + diff --git a/omnipod/src/main/res/drawable/ic_pod_management.xml b/omnipod/src/main/res/drawable/ic_pod_management.xml new file mode 100644 index 0000000000..55ed07f4fc --- /dev/null +++ b/omnipod/src/main/res/drawable/ic_pod_management.xml @@ -0,0 +1,5 @@ + + + + diff --git a/omnipod/src/main/res/drawable/ic_cp_bolus_correction.xml b/omnipod/src/main/res/drawable/ic_pulse_log.xml similarity index 95% rename from omnipod/src/main/res/drawable/ic_cp_bolus_correction.xml rename to omnipod/src/main/res/drawable/ic_pulse_log.xml index 49d6332c8e..3114b7f4fc 100644 --- a/omnipod/src/main/res/drawable/ic_cp_bolus_correction.xml +++ b/omnipod/src/main/res/drawable/ic_pulse_log.xml @@ -5,8 +5,8 @@ android:viewportHeight="24"> + android:fillColor="#A14FFF" /> + android:fillColor="#FFBC4F" /> diff --git a/omnipod/src/main/res/drawable/ic_refresh_pod_status.xml b/omnipod/src/main/res/drawable/ic_refresh_pod_status.xml new file mode 100644 index 0000000000..ea35939c1a --- /dev/null +++ b/omnipod/src/main/res/drawable/ic_refresh_pod_status.xml @@ -0,0 +1,5 @@ + + + + diff --git a/omnipod/src/main/res/drawable/ic_resume_delivery.xml b/omnipod/src/main/res/drawable/ic_resume_delivery.xml new file mode 100644 index 0000000000..effffa5470 --- /dev/null +++ b/omnipod/src/main/res/drawable/ic_resume_delivery.xml @@ -0,0 +1,5 @@ + + + + diff --git a/omnipod/src/main/res/drawable/ic_rl_stats.xml b/omnipod/src/main/res/drawable/ic_rl_stats.xml new file mode 100644 index 0000000000..81b3952eb4 --- /dev/null +++ b/omnipod/src/main/res/drawable/ic_rl_stats.xml @@ -0,0 +1,30 @@ + + + + + + diff --git a/omnipod/src/main/res/drawable/ic_access_alarm.xml b/omnipod/src/main/res/drawable/ic_set_time.xml similarity index 93% rename from omnipod/src/main/res/drawable/ic_access_alarm.xml rename to omnipod/src/main/res/drawable/ic_set_time.xml index 48a463f81b..3548756add 100644 --- a/omnipod/src/main/res/drawable/ic_access_alarm.xml +++ b/omnipod/src/main/res/drawable/ic_set_time.xml @@ -4,6 +4,6 @@ android:viewportWidth="24" android:viewportHeight="24"> diff --git a/omnipod/src/main/res/drawable/ic_toast_check.xml b/omnipod/src/main/res/drawable/ic_success.xml similarity index 100% rename from omnipod/src/main/res/drawable/ic_toast_check.xml rename to omnipod/src/main/res/drawable/ic_success.xml diff --git a/omnipod/src/main/res/drawable/ic_suspend_delivery.xml b/omnipod/src/main/res/drawable/ic_suspend_delivery.xml new file mode 100644 index 0000000000..fb0a216bd6 --- /dev/null +++ b/omnipod/src/main/res/drawable/ic_suspend_delivery.xml @@ -0,0 +1,5 @@ + + + + diff --git a/omnipod/src/main/res/layout/omnipod_overview.xml b/omnipod/src/main/res/layout/omnipod_overview.xml index ff36031400..b14c3304c9 100644 --- a/omnipod/src/main/res/layout/omnipod_overview.xml +++ b/omnipod/src/main/res/layout/omnipod_overview.xml @@ -37,7 +37,6 @@ android:textAppearance="?android:attr/textAppearanceSmall" /> - - - - - @@ -752,7 +747,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" - android:drawableTop="@drawable/ic_actions_refill" + android:drawableTop="@drawable/ic_refresh_pod_status" android:paddingLeft="0dp" android:paddingRight="0dp" android:text="@string/omnipod_overview_button_refresh" /> @@ -763,7 +758,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" - android:drawableTop="@drawable/ic_danarhistory" + android:drawableTop="@drawable/ic_pod_management" android:paddingLeft="0dp" android:paddingRight="0dp" android:text="@string/omnipod_overview_button_pod_management" /> @@ -774,41 +769,18 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" - android:drawableTop="@drawable/ic_cp_aaps_offline" + android:drawableTop="@drawable/ic_acknowledge_alerts" android:paddingLeft="0dp" android:paddingRight="0dp" android:text="@string/omnipod_overview_button_acknowledge_active_alerts" /> -