pod expiry: use let
This commit is contained in:
parent
99ca414d87
commit
7a72cf2f19
|
@ -29,7 +29,6 @@ import kotlin.math.absoluteValue
|
|||
sealed class ConnectionState
|
||||
|
||||
object Connecting: ConnectionState()
|
||||
object Handshaking: ConnectionState()
|
||||
object Connected : ConnectionState()
|
||||
object NotConnected : ConnectionState()
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui
|
||||
|
||||
import android.content.Intent
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
|
@ -284,19 +285,15 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
|
|||
|
||||
// Update Pod expiry time
|
||||
val expiresAt = podStateManager.expiry
|
||||
if (expiresAt == null) {
|
||||
podInfoBinding.podExpiryDate.text = PLACEHOLDER
|
||||
podInfoBinding.podExpiryDate.setTextColor(Color.WHITE)
|
||||
} else {
|
||||
podInfoBinding.podExpiryDate.text = readableZonedTime(expiresAt)
|
||||
podInfoBinding.podExpiryDate.setTextColor(
|
||||
if (DateTime.now().isAfter(expiresAt)) {
|
||||
Color.RED
|
||||
} else {
|
||||
Color.WHITE
|
||||
}
|
||||
)
|
||||
}
|
||||
podInfoBinding.podExpiryDate.text = expiresAt?.let {
|
||||
readableZonedTime(it) }
|
||||
?: PLACEHOLDER
|
||||
podInfoBinding.podExpiryDate.setTextColor(
|
||||
if (expiresAt != null && DateTime.now().isAfter(expiresAt))
|
||||
Color.RED
|
||||
else
|
||||
Color.WHITE
|
||||
)
|
||||
|
||||
podStateManager.alarmType?.let {
|
||||
errors.add(
|
||||
|
|
Loading…
Reference in a new issue