From c16fc3a946dfbe9ce3e1a33225830df36a38e734 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Wed, 11 Nov 2020 20:12:57 +0100 Subject: [PATCH] Show disconnected icon in overview for Omnipod when Pod is suspended and hide disconnect buttons in overview for Omnipod --- .../plugins/general/overview/OverviewFragment.kt | 9 ++++++++- .../androidaps/plugins/general/overview/OverviewMenus.kt | 7 ++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt index 1760ea45d0..6e8352e259 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt @@ -56,6 +56,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress +import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.plugins.source.DexcomPlugin import info.nightscout.androidaps.plugins.source.XdripPlugin import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin @@ -616,7 +617,13 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList } pump.isSuspended -> { - overview_apsmode?.setImageResource(R.drawable.ic_loop_paused) + overview_apsmode?.setImageResource(if (pump.pumpDescription.pumpType == PumpType.Insulet_Omnipod) { + // For Omnipod, indicate the pump as disconnected when it's suspended. + // The only way to 'reconnect' it, is through the Omnipod tab + R.drawable.ic_loop_disconnected + } else { + R.drawable.ic_loop_paused + }) overview_apsmode_text?.text = "" } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt index f5e3c656dc..c74466ba9d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt @@ -34,6 +34,7 @@ import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper @@ -198,7 +199,11 @@ class OverviewMenus @Inject constructor( menu.add(resourceHelper.gs(R.string.enableloop)) } if (!loopPlugin.isDisconnected) { - showSuspendPump(menu, pumpDescription) + if(pumpDescription.pumpType != PumpType.Insulet_Omnipod) { + // Don't show the disconnect menu for Omnipod, + // as an Omnipod is attached to your body and cannot be physically disconnected. + showSuspendPump(menu, pumpDescription) + } } else { menu.add(resourceHelper.gs(R.string.reconnect)) }