ktlintFormat

This commit is contained in:
Andrei Vereha 2021-07-31 15:02:08 +02:00
parent 9e739bc1a3
commit 97b2287282

View file

@ -232,11 +232,11 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
?: PLACEHOLDER ?: PLACEHOLDER
bluetoothStatusBinding.omnipodDashBluetoothStatus.text = bluetoothStatusBinding.omnipodDashBluetoothStatus.text =
when (podStateManager.bluetoothConnectionState) { when (podStateManager.bluetoothConnectionState) {
OmnipodDashPodStateManager.BluetoothConnectionState.CONNECTED -> OmnipodDashPodStateManager.BluetoothConnectionState.CONNECTED ->
"{fa-bluetooth}" "{fa-bluetooth}"
OmnipodDashPodStateManager.BluetoothConnectionState.DISCONNECTED -> OmnipodDashPodStateManager.BluetoothConnectionState.DISCONNECTED ->
"{fa-bluetooth-b}" "{fa-bluetooth-b}"
OmnipodDashPodStateManager.BluetoothConnectionState.CONNECTING -> OmnipodDashPodStateManager.BluetoothConnectionState.CONNECTING ->
"{fa-bluetooth-b spin}" "{fa-bluetooth-b spin}"
} }
@ -250,7 +250,7 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
Color.WHITE Color.WHITE
connectionSuccessPercentage > 60 -> connectionSuccessPercentage > 60 ->
Color.YELLOW Color.YELLOW
else -> else ->
Color.RED Color.RED
} }
bluetoothStatusBinding.omnipodDashBluetoothConnectionQuality.setTextColor(connectionStatsColor) bluetoothStatusBinding.omnipodDashBluetoothConnectionQuality.setTextColor(connectionStatsColor)
@ -308,9 +308,9 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
when { when {
!podStateManager.sameTimeZone -> !podStateManager.sameTimeZone ->
Color.MAGENTA Color.MAGENTA
timeDeviationTooBig -> timeDeviationTooBig ->
Color.YELLOW Color.YELLOW
else -> else ->
Color.WHITE Color.WHITE
} }
) )
@ -406,7 +406,7 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
System.currentTimeMillis() - System.currentTimeMillis() -
podStateManager.lastUpdatedSystem, podStateManager.lastUpdatedSystem,
) )
) )
val lastConnectionColor = val lastConnectionColor =
if (omnipodDashPumpPlugin.isUnreachableAlertTimeoutExceeded(getPumpUnreachableTimeout().toMillis())) { if (omnipodDashPumpPlugin.isUnreachableAlertTimeoutExceeded(getPumpUnreachableTimeout().toMillis())) {
@ -455,9 +455,9 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
val podStatusColor = when { val podStatusColor = when {
!podStateManager.isActivationCompleted || podStateManager.isPodKaput || podStateManager.isSuspended -> !podStateManager.isActivationCompleted || podStateManager.isPodKaput || podStateManager.isSuspended ->
Color.RED Color.RED
podStateManager.activeCommand != null -> podStateManager.activeCommand != null ->
Color.YELLOW Color.YELLOW
else -> else ->
Color.WHITE Color.WHITE
} }
podInfoBinding.podStatus.setTextColor(podStatusColor) podInfoBinding.podStatus.setTextColor(podStatusColor)
@ -552,7 +552,7 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
private fun updateRefreshStatusButton() { private fun updateRefreshStatusButton() {
buttonBinding.buttonRefreshStatus.isEnabled = buttonBinding.buttonRefreshStatus.isEnabled =
podStateManager.isUniqueIdSet && podStateManager.isUniqueIdSet &&
isQueueEmpty() isQueueEmpty()
} }
private fun updateResumeDeliveryButton() { private fun updateResumeDeliveryButton() {
@ -634,15 +634,15 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
val minutes = duration.toMinutes().toInt() val minutes = duration.toMinutes().toInt()
val seconds = duration.seconds val seconds = duration.seconds
when { when {
seconds < 10 -> { seconds < 10 -> {
return resourceHelper.gs(R.string.omnipod_common_moments_ago) return resourceHelper.gs(R.string.omnipod_common_moments_ago)
} }
seconds < 60 -> { seconds < 60 -> {
return resourceHelper.gs(R.string.omnipod_common_less_than_a_minute_ago) return resourceHelper.gs(R.string.omnipod_common_less_than_a_minute_ago)
} }
seconds < 60 * 60 -> { // < 1 hour seconds < 60 * 60 -> { // < 1 hour
return resourceHelper.gs( return resourceHelper.gs(
R.string.omnipod_common_time_ago, R.string.omnipod_common_time_ago,
resourceHelper.gq(R.plurals.omnipod_common_minutes, minutes, minutes) resourceHelper.gq(R.plurals.omnipod_common_minutes, minutes, minutes)
@ -666,7 +666,7 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
) )
} }
else -> { else -> {
val days = hours / 24 val days = hours / 24
val hoursLeft = hours % 24 val hoursLeft = hours % 24
if (hoursLeft > 0) if (hoursLeft > 0)