expiry: color yellow 4h before expiration

do not display lot number and unique id
This commit is contained in:
Andrei Vereha 2021-09-24 23:41:47 +02:00
parent 69a5d46be6
commit 274a94d1f3
2 changed files with 12 additions and 4 deletions

View file

@ -6,6 +6,7 @@
<!-- Unique ID -->
<LinearLayout
android:id="@+id/omnipod_common_overview_pod_unique_id_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
@ -45,6 +46,7 @@
<!-- Pod Lot -->
<LinearLayout
android:id="@+id/omnipod_common_overview_lot_number_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

View file

@ -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 {