From 274a94d1f3dd5aa60aafdea822fc8f596c6de599 Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Fri, 24 Sep 2021 23:41:47 +0200 Subject: [PATCH] expiry: color yellow 4h before expiration do not display lot number and unique id --- .../layout/omnipod_common_overview_pod_info.xml | 2 ++ .../omnipod/dash/ui/OmnipodDashOverviewFragment.kt | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/omnipod-common/src/main/res/layout/omnipod_common_overview_pod_info.xml b/omnipod-common/src/main/res/layout/omnipod_common_overview_pod_info.xml index 350b59a645..06e800f044 100644 --- a/omnipod-common/src/main/res/layout/omnipod_common_overview_pod_info.xml +++ b/omnipod-common/src/main/res/layout/omnipod_common_overview_pod_info.xml @@ -6,6 +6,7 @@ @@ -45,6 +46,7 @@ diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt index 34915dce52..d0267f0589 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt @@ -173,6 +173,8 @@ class OmnipodDashOverviewFragment : DaggerFragment() { bluetoothStatusBinding.deliveryStatus.visibility = View.VISIBLE bluetoothStatusBinding.connectionQuality.visibility = View.VISIBLE } + podInfoBinding.omnipodCommonOverviewLotNumberLayout.visibility = View.GONE + podInfoBinding.omnipodCommonOverviewPodUniqueIdLayout.visibility = View.GONE } override fun onResume() { @@ -333,10 +335,14 @@ class OmnipodDashOverviewFragment : DaggerFragment() { } ?: PLACEHOLDER podInfoBinding.podExpiryDate.setTextColor( - if (expiresAt != null && ZonedDateTime.now().isAfter(expiresAt)) - Color.RED - else - Color.WHITE + when { + expiresAt != null && ZonedDateTime.now().isAfter(expiresAt) -> + Color.RED + expiresAt != null && ZonedDateTime.now().isAfter(expiresAt.minusHours(4)) -> + Color.YELLOW + else -> + Color.WHITE + } ) podStateManager.alarmType?.let {