Merge pull request #131 from 0pen-dash/avereha/fixes-2

small fixes
This commit is contained in:
Andrei Vereha 2021-09-25 13:28:51 +02:00 committed by GitHub
commit a55eb0623a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 {