diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/AutomationFragment.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/AutomationFragment.kt index c27f843e97..4ca817fae2 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/AutomationFragment.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/AutomationFragment.kt @@ -149,7 +149,7 @@ class AutomationFragment : DaggerFragment(), OnStartDragListener { } else { val icon = t.icon() if (icon.isPresent) { - set.add(icon.get()!!) + set.add(icon.get()) } } } diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/Trigger.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/Trigger.kt index fefdab73a1..7946fccacd 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/Trigger.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/Trigger.kt @@ -53,7 +53,7 @@ abstract class Trigger(val injector: HasAndroidInjector) { abstract fun friendlyName(): Int abstract fun friendlyDescription(): String - abstract fun icon(): Optional + abstract fun icon(): Optional abstract fun duplicate(): Trigger fun scanForActivity(cont: Context?): AppCompatActivity? { diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerAutosensValue.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerAutosensValue.kt index da54eda3c0..dcc896e81b 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerAutosensValue.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerAutosensValue.kt @@ -63,7 +63,7 @@ class TriggerAutosensValue(injector: HasAndroidInjector) : Trigger(injector) { override fun friendlyDescription(): String = rh.gs(R.string.autosenscompared, rh.gs(comparator.value.stringRes), autosens.value) - override fun icon(): Optional = Optional.of(R.drawable.ic_as) + override fun icon(): Optional = Optional.of(R.drawable.ic_as) override fun duplicate(): Trigger = TriggerAutosensValue(injector, this) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBTDevice.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBTDevice.kt index 96f385f077..bb0c3848f1 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBTDevice.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBTDevice.kt @@ -57,7 +57,7 @@ class TriggerBTDevice(injector: HasAndroidInjector) : Trigger(injector) { override fun friendlyDescription(): String = rh.gs(R.string.btdevicecompared, btDevice.value, rh.gs(comparator.value.stringRes)) - override fun icon(): Optional = Optional.of(R.drawable.ic_bluetooth_white_48dp) + override fun icon(): Optional = Optional.of(R.drawable.ic_bluetooth_white_48dp) override fun duplicate(): Trigger = TriggerBTDevice(injector, this) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBg.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBg.kt index 4aa3694875..e386a7fa9e 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBg.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBg.kt @@ -87,7 +87,7 @@ class TriggerBg(injector: HasAndroidInjector) : Trigger(injector) { rh.gs(if (bg.units == GlucoseUnit.MGDL) R.string.glucosecomparedmgdl else R.string.glucosecomparedmmol, rh.gs(comparator.value.stringRes), bg.value, bg.units) } - override fun icon(): Optional = Optional.of(R.drawable.ic_cp_bgcheck) + override fun icon(): Optional = Optional.of(R.drawable.ic_cp_bgcheck) override fun duplicate(): Trigger = TriggerBg(injector, this) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBolusAgo.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBolusAgo.kt index ea976a1563..a7e0b11ec4 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBolusAgo.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBolusAgo.kt @@ -75,7 +75,7 @@ class TriggerBolusAgo(injector: HasAndroidInjector) : Trigger(injector) { override fun friendlyDescription(): String = rh.gs(R.string.lastboluscompared, rh.gs(comparator.value.stringRes), minutesAgo.getMinutes()) - override fun icon(): Optional = Optional.of(R.drawable.ic_bolus) + override fun icon(): Optional = Optional.of(R.drawable.ic_bolus) override fun duplicate(): Trigger = TriggerBolusAgo(injector, this) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerCOB.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerCOB.kt index b4f330ae79..6ab853a73e 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerCOB.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerCOB.kt @@ -73,7 +73,7 @@ class TriggerCOB(injector: HasAndroidInjector) : Trigger(injector) { override fun friendlyDescription(): String = rh.gs(R.string.cobcompared, rh.gs(comparator.value.stringRes), cob.value) - override fun icon(): Optional = Optional.of(R.drawable.ic_cp_bolus_carbs) + override fun icon(): Optional = Optional.of(R.drawable.ic_cp_bolus_carbs) override fun duplicate(): Trigger = TriggerCOB(injector, this) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerConnector.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerConnector.kt index 65f910a658..d9cafef22e 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerConnector.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerConnector.kt @@ -115,7 +115,7 @@ class TriggerConnector(injector: HasAndroidInjector) : Trigger(injector) { return result.toString() } - override fun icon(): Optional = Optional.absent() + override fun icon(): Optional = Optional.absent() override fun duplicate(): Trigger = TriggerConnector(injector, connectorType) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerDelta.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerDelta.kt index 091b0fe4cc..924cd08dad 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerDelta.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerDelta.kt @@ -110,7 +110,7 @@ class TriggerDelta(injector: HasAndroidInjector) : Trigger(injector) { override fun friendlyDescription(): String = rh.gs(R.string.deltacompared, rh.gs(comparator.value.stringRes), delta.value, rh.gs(delta.deltaType.stringRes)) - override fun icon(): Optional = Optional.of(R.drawable.ic_auto_delta) + override fun icon(): Optional = Optional.of(R.drawable.ic_auto_delta) override fun duplicate(): Trigger = TriggerDelta(injector, this) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerDummy.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerDummy.kt index d3b580768a..be914525ef 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerDummy.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerDummy.kt @@ -27,7 +27,7 @@ class TriggerDummy(injector: HasAndroidInjector, val shouldRun: Boolean = false) return "TriggerDummy" } - override fun icon(): Optional { + override fun icon(): Optional { throw NotImplementedError("An operation is not implemented") } diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerIob.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerIob.kt index 9299ef7d22..2717fc333d 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerIob.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerIob.kt @@ -60,7 +60,7 @@ class TriggerIob(injector: HasAndroidInjector) : Trigger(injector) { override fun friendlyDescription(): String = rh.gs(R.string.iobcompared, rh.gs(comparator.value.stringRes), insulin.value) - override fun icon(): Optional = Optional.of(R.drawable.ic_keyboard_capslock) + override fun icon(): Optional = Optional.of(R.drawable.ic_keyboard_capslock) override fun duplicate(): Trigger = TriggerIob(injector, this) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerLocation.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerLocation.kt index 8c322fb43d..66a8213a32 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerLocation.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerLocation.kt @@ -81,7 +81,7 @@ class TriggerLocation(injector: HasAndroidInjector) : Trigger(injector) { override fun friendlyDescription(): String = rh.gs(R.string.locationis, rh.gs(modeSelected.value.stringRes), " " + name.value) - override fun icon(): Optional = Optional.of(R.drawable.ic_location_on) + override fun icon(): Optional = Optional.of(R.drawable.ic_location_on) override fun duplicate(): Trigger = TriggerLocation(injector, this) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerProfilePercent.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerProfilePercent.kt index 0c852a2af2..d57d7d02fd 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerProfilePercent.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerProfilePercent.kt @@ -86,7 +86,7 @@ class TriggerProfilePercent(injector: HasAndroidInjector) : Trigger(injector) { override fun friendlyDescription(): String = rh.gs(R.string.percentagecompared, rh.gs(comparator.value.stringRes), pct.value.toInt()) - override fun icon(): Optional = Optional.of(R.drawable.ic_actions_profileswitch) + override fun icon(): Optional = Optional.of(R.drawable.ic_actions_profileswitch) override fun duplicate(): Trigger = TriggerProfilePercent(injector, this) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerPumpLastConnection.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerPumpLastConnection.kt index 737a225601..8d3be596af 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerPumpLastConnection.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerPumpLastConnection.kt @@ -73,7 +73,7 @@ class TriggerPumpLastConnection(injector: HasAndroidInjector) : Trigger(injector override fun friendlyDescription(): String = rh.gs(R.string.automation_trigger_pump_last_connection_compared, rh.gs(comparator.value.stringRes), minutesAgo.value) - override fun icon(): Optional = Optional.of(R.drawable.ic_remove) + override fun icon(): Optional = Optional.of(R.drawable.ic_remove) override fun duplicate(): Trigger = TriggerPumpLastConnection(injector, this) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerRecurringTime.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerRecurringTime.kt index 5cb9fe4b1e..0ff48b9055 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerRecurringTime.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerRecurringTime.kt @@ -84,7 +84,7 @@ class TriggerRecurringTime(injector: HasAndroidInjector) : Trigger(injector) { return if (counter == 0) rh.gs(R.string.never) else sb.toString() } - override fun icon(): Optional = Optional.of(R.drawable.ic_access_alarm_24dp) + override fun icon(): Optional = Optional.of(R.drawable.ic_access_alarm_24dp) override fun duplicate(): Trigger = TriggerRecurringTime(injector, this) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTempTarget.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTempTarget.kt index 971d3a82e1..f89eb9896c 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTempTarget.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTempTarget.kt @@ -58,7 +58,7 @@ class TriggerTempTarget(injector: HasAndroidInjector) : Trigger(injector) { override fun friendlyDescription(): String = rh.gs(R.string.temptargetcompared, rh.gs(comparator.value.stringRes)) - override fun icon(): Optional = Optional.of(R.drawable.ic_keyboard_tab) + override fun icon(): Optional = Optional.of(R.drawable.ic_keyboard_tab) override fun duplicate(): Trigger = TriggerTempTarget(injector, this) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTempTargetValue.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTempTargetValue.kt index 9e8ee150e2..faf6d3d115 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTempTargetValue.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTempTargetValue.kt @@ -84,7 +84,7 @@ class TriggerTempTargetValue(injector: HasAndroidInjector) : Trigger(injector) { rh.gs(if (ttValue.units == GlucoseUnit.MGDL) R.string.temptargetcomparedmgdl else R.string.temptargetcomparedmmol, rh.gs(comparator.value.stringRes), ttValue.value, ttValue.units) } - override fun icon(): Optional = Optional.of(R.drawable.ic_keyboard_tab) + override fun icon(): Optional = Optional.of(R.drawable.ic_keyboard_tab) override fun duplicate(): Trigger = TriggerTempTargetValue(injector, this) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTime.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTime.kt index 27f9684d77..299b8b895d 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTime.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTime.kt @@ -55,7 +55,7 @@ class TriggerTime(injector: HasAndroidInjector) : Trigger(injector) { override fun friendlyDescription(): String = rh.gs(R.string.atspecifiedtime, dateUtil.dateAndTimeString(time.value)) - override fun icon(): Optional = Optional.of(R.drawable.ic_access_alarm_24dp) + override fun icon(): Optional = Optional.of(R.drawable.ic_access_alarm_24dp) override fun duplicate(): Trigger = TriggerTime(injector, time.value) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTimeRange.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTimeRange.kt index bd32d0add7..ad21537299 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTimeRange.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTimeRange.kt @@ -66,7 +66,7 @@ class TriggerTimeRange(injector: HasAndroidInjector) : Trigger(injector) { override fun friendlyDescription(): String = rh.gs(R.string.timerange_value, dateUtil.timeString(toMills(range.start)), dateUtil.timeString(toMills(range.end))) - override fun icon(): Optional = Optional.of(R.drawable.ic_access_alarm_24dp) + override fun icon(): Optional = Optional.of(R.drawable.ic_access_alarm_24dp) override fun duplicate(): Trigger = TriggerTimeRange(injector, range.start, range.end) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerWifiSsid.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerWifiSsid.kt index f0925983a2..593b14d770 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerWifiSsid.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerWifiSsid.kt @@ -74,7 +74,7 @@ class TriggerWifiSsid(injector: HasAndroidInjector) : Trigger(injector) { override fun friendlyDescription(): String = rh.gs(R.string.wifissidcompared, rh.gs(comparator.value.stringRes), ssid.value) - override fun icon(): Optional = Optional.of(R.drawable.ic_network_wifi) + override fun icon(): Optional = Optional.of(R.drawable.ic_network_wifi) override fun duplicate(): Trigger = TriggerWifiSsid(injector, this) diff --git a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/DummyTrigger.kt b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/DummyTrigger.kt index 7242079411..feccdb7804 100644 --- a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/DummyTrigger.kt +++ b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/DummyTrigger.kt @@ -12,6 +12,6 @@ class DummyTrigger(var result: Boolean) : Trigger(HasAndroidInjector { AndroidIn override fun fromJSON(data: String): Trigger = DummyTrigger(result) override fun friendlyName(): Int = 0 override fun friendlyDescription(): String = " " - override fun icon(): Optional = Optional.absent() + override fun icon(): Optional = Optional.absent() override fun duplicate(): Trigger = DummyTrigger(result) } \ No newline at end of file