ktlintFormat

This commit is contained in:
Andrei Vereha 2021-05-31 00:01:54 +02:00
parent c989c6a1c5
commit 8e64ca134f
5 changed files with 19 additions and 18 deletions

View file

@ -408,7 +408,8 @@ class OmnipodDashPumpPlugin @Inject constructor(
} }
else -> else ->
aapsLogger.warn(LTag.PUMP, aapsLogger.warn(
LTag.PUMP,
"Will not sync confirmed command of type: $historyEntry and " + "Will not sync confirmed command of type: $historyEntry and " +
"succes: ${confirmation.success}" "succes: ${confirmation.success}"
) )

View file

@ -700,7 +700,7 @@ class OmnipodDashManagerImpl @Inject constructor(
inner class ErrorInterceptor : Consumer<Throwable> { inner class ErrorInterceptor : Consumer<Throwable> {
override fun accept(throwable: Throwable) { override fun accept(throwable: Throwable) {
logger.debug(LTag.PUMP, "Intercepted error in OmnipodDashManagerImpl: ${throwable}") logger.debug(LTag.PUMP, "Intercepted error in OmnipodDashManagerImpl: $throwable")
} }
} }

View file

@ -84,7 +84,7 @@ class OmnipodDashBleManagerImpl @Inject constructor(
} }
override fun getStatus(): ConnectionState { override fun getStatus(): ConnectionState {
return connection?.let{ getStatus() } return connection?.let { getStatus() }
?: NotConnected ?: NotConnected
} }

View file

@ -106,7 +106,6 @@ class Connection(
} }
podState.bluetoothConnectionState = OmnipodDashPodStateManager.BluetoothConnectionState.CONNECTED podState.bluetoothConnectionState = OmnipodDashPodStateManager.BluetoothConnectionState.CONNECTED
val discoverer = ServiceDiscoverer(aapsLogger, gattConnection, bleCommCallbacks) val discoverer = ServiceDiscoverer(aapsLogger, gattConnection, bleCommCallbacks)
val discovered = discoverer.discoverServices() val discovered = discoverer.discoverServices()
dataBleIO.characteristic = discovered[CharacteristicType.DATA]!! dataBleIO.characteristic = discovered[CharacteristicType.DATA]!!

View file

@ -42,7 +42,6 @@ import info.nightscout.androidaps.utils.ui.UIRunnable
import io.reactivex.disposables.CompositeDisposable import io.reactivex.disposables.CompositeDisposable
import io.reactivex.rxkotlin.plusAssign import io.reactivex.rxkotlin.plusAssign
import org.apache.commons.lang3.StringUtils import org.apache.commons.lang3.StringUtils
import org.joda.time.DateTime
import org.joda.time.Duration import org.joda.time.Duration
import java.util.* import java.util.*
import javax.inject.Inject import javax.inject.Inject
@ -62,7 +61,6 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
@Inject lateinit var aapsSchedulers: AapsSchedulers @Inject lateinit var aapsSchedulers: AapsSchedulers
@Inject lateinit var pumpSync: PumpSync @Inject lateinit var pumpSync: PumpSync
companion object { companion object {
private const val REFRESH_INTERVAL_MILLIS = 15 * 1000L // 15 seconds private const val REFRESH_INTERVAL_MILLIS = 15 * 1000L // 15 seconds
@ -221,7 +219,7 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
updateQueueStatus() updateQueueStatus()
} }
private fun updateBluetoothStatus(){ private fun updateBluetoothStatus() {
bluetoothStatusBinding.omnipodDashBluetoothAddress.text = podStateManager.bluetoothAddress bluetoothStatusBinding.omnipodDashBluetoothAddress.text = podStateManager.bluetoothAddress
?: PLACEHOLDER ?: PLACEHOLDER
bluetoothStatusBinding.omnipodDashBluetoothStatus.text = bluetoothStatusBinding.omnipodDashBluetoothStatus.text =
@ -392,7 +390,7 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
resourceHelper.gs(R.string.omnipod_common_pod_status_suspended) resourceHelper.gs(R.string.omnipod_common_pod_status_suspended)
} else { } else {
resourceHelper.gs(R.string.omnipod_common_pod_status_running) + resourceHelper.gs(R.string.omnipod_common_pod_status_running) +
podStateManager.deliveryStatus?.let{ " " + podStateManager.deliveryStatus.toString() } podStateManager.deliveryStatus?.let { " " + podStateManager.deliveryStatus.toString() }
} }
// TODO // TODO
/* /*
@ -601,8 +599,10 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
seconds < 24 * 60 * 60 -> { // < 1 day seconds < 24 * 60 * 60 -> { // < 1 day
val minutesLeft = minutes % 60 val minutesLeft = minutes % 60
if (minutesLeft > 0) if (minutesLeft > 0)
return resourceHelper.gs(R.string.omnipod_common_time_ago, return resourceHelper.gs(
resourceHelper.gs(R.string.omnipod_common_composite_time, resourceHelper.gq(R.plurals.omnipod_common_hours, hours, hours), resourceHelper.gq(R.plurals.omnipod_common_minutes, minutesLeft, minutesLeft))) R.string.omnipod_common_time_ago,
resourceHelper.gs(R.string.omnipod_common_composite_time, resourceHelper.gq(R.plurals.omnipod_common_hours, hours, hours), resourceHelper.gq(R.plurals.omnipod_common_minutes, minutesLeft, minutesLeft))
)
return resourceHelper.gs(R.string.omnipod_common_time_ago, resourceHelper.gq(R.plurals.omnipod_common_hours, hours, hours)) return resourceHelper.gs(R.string.omnipod_common_time_ago, resourceHelper.gq(R.plurals.omnipod_common_hours, hours, hours))
} }
@ -610,12 +610,13 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
val days = hours / 24 val days = hours / 24
val hoursLeft = hours % 24 val hoursLeft = hours % 24
if (hoursLeft > 0) if (hoursLeft > 0)
return resourceHelper.gs(R.string.omnipod_common_time_ago, return resourceHelper.gs(
resourceHelper.gs(R.string.omnipod_common_composite_time, resourceHelper.gq(R.plurals.omnipod_common_days, days, days), resourceHelper.gq(R.plurals.omnipod_common_hours, hoursLeft, hoursLeft))) R.string.omnipod_common_time_ago,
resourceHelper.gs(R.string.omnipod_common_composite_time, resourceHelper.gq(R.plurals.omnipod_common_days, days, days), resourceHelper.gq(R.plurals.omnipod_common_hours, hoursLeft, hoursLeft))
)
return resourceHelper.gs(R.string.omnipod_common_time_ago, resourceHelper.gq(R.plurals.omnipod_common_days, days, days)) return resourceHelper.gs(R.string.omnipod_common_time_ago, resourceHelper.gq(R.plurals.omnipod_common_days, days, days))
} }
} }
} }
private fun isQueueEmpty(): Boolean { private fun isQueueEmpty(): Boolean {