diff --git a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt index 93dc11b464..b47eab04d2 100644 --- a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt @@ -38,6 +38,7 @@ import app.aaps.plugins.aps.loop.LoopPlugin import app.aaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin import app.aaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin import app.aaps.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin +import app.aaps.plugins.automation.AutomationPlugin import dagger.android.support.AndroidSupportInjection import info.nightscout.androidaps.R import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin @@ -46,7 +47,6 @@ import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.plugins.pump.eopatch.EopatchPumpPlugin import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin -import info.nightscout.automation.AutomationPlugin import info.nightscout.insulin.InsulinOrefFreePeakPlugin import info.nightscout.plugins.constraints.safety.SafetyPlugin import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin diff --git a/app/src/main/kotlin/app/aaps/di/AppComponent.kt b/app/src/main/kotlin/app/aaps/di/AppComponent.kt index 05b705a28d..ae16146a17 100644 --- a/app/src/main/kotlin/app/aaps/di/AppComponent.kt +++ b/app/src/main/kotlin/app/aaps/di/AppComponent.kt @@ -6,6 +6,7 @@ import app.aaps.core.main.di.CoreModule import app.aaps.core.validators.di.ValidatorsModule import app.aaps.implementation.di.ImplementationModule import app.aaps.plugins.aps.di.ApsModule +import app.aaps.plugins.automation.di.AutomationModule import app.aaps.shared.impl.di.SharedImplModule import dagger.BindsInstance import dagger.Component @@ -19,7 +20,6 @@ import info.nightscout.androidaps.plugins.pump.eopatch.dagger.EopatchModule import info.nightscout.androidaps.plugins.pump.medtronic.di.MedtronicModule import info.nightscout.androidaps.plugins.pump.omnipod.dash.di.OmnipodDashModule import info.nightscout.androidaps.plugins.pump.omnipod.eros.di.OmnipodErosModule -import info.nightscout.automation.di.AutomationModule import info.nightscout.database.impl.DatabaseModule import info.nightscout.insulin.di.InsulinModule import info.nightscout.plugins.constraints.di.PluginsConstraintsModule diff --git a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt index 07b3840230..c518705f4f 100644 --- a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt +++ b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt @@ -8,6 +8,7 @@ import app.aaps.plugins.aps.loop.LoopPlugin import app.aaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin import app.aaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin import app.aaps.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin +import app.aaps.plugins.automation.AutomationPlugin import dagger.Binds import dagger.Module import dagger.multibindings.IntKey @@ -20,7 +21,6 @@ import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin import info.nightscout.androidaps.plugins.pump.omnipod.dash.OmnipodDashPumpPlugin import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin -import info.nightscout.automation.AutomationPlugin import info.nightscout.insulin.InsulinLyumjevPlugin import info.nightscout.insulin.InsulinOrefFreePeakPlugin import info.nightscout.insulin.InsulinOrefRapidActingPlugin diff --git a/plugins/automation/build.gradle b/plugins/automation/build.gradle index 4ea949b7d6..06d03961cc 100644 --- a/plugins/automation/build.gradle +++ b/plugins/automation/build.gradle @@ -12,7 +12,7 @@ apply from: "${project.rootDir}/core/main/test_dependencies.gradle" apply from: "${project.rootDir}/core/main/jacoco_global.gradle" android { - namespace 'info.nightscout.automation' + namespace 'app.aaps.plugins.automation' } dependencies { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/AutomationEvent.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/AutomationEvent.kt similarity index 91% rename from plugins/automation/src/main/java/info/nightscout/automation/AutomationEvent.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/AutomationEvent.kt index 5c9a348102..7296dfa454 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/AutomationEvent.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/AutomationEvent.kt @@ -1,15 +1,15 @@ -package info.nightscout.automation +package app.aaps.plugins.automation import app.aaps.core.interfaces.automation.AutomationEvent import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T +import app.aaps.plugins.automation.actions.Action +import app.aaps.plugins.automation.actions.ActionDummy +import app.aaps.plugins.automation.actions.ActionStopProcessing +import app.aaps.plugins.automation.triggers.TriggerConnector +import app.aaps.plugins.automation.triggers.TriggerDummy import dagger.android.HasAndroidInjector -import info.nightscout.automation.actions.Action -import info.nightscout.automation.actions.ActionDummy -import info.nightscout.automation.actions.ActionStopProcessing -import info.nightscout.automation.triggers.TriggerConnector -import info.nightscout.automation.triggers.TriggerDummy import org.json.JSONArray import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/AutomationFragment.kt similarity index 96% rename from plugins/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/AutomationFragment.kt index ed55e8c554..88f9a254e5 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/AutomationFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation +package app.aaps.plugins.automation import android.annotation.SuppressLint import android.content.Context @@ -36,14 +36,14 @@ import app.aaps.core.ui.dragHelpers.SimpleItemTouchHelperCallback import app.aaps.core.utils.HtmlHelper import app.aaps.database.entities.UserEntry.Action import app.aaps.database.entities.UserEntry.Sources +import app.aaps.plugins.automation.databinding.AutomationEventItemBinding +import app.aaps.plugins.automation.databinding.AutomationFragmentBinding +import app.aaps.plugins.automation.dialogs.EditEventDialog +import app.aaps.plugins.automation.events.EventAutomationDataChanged +import app.aaps.plugins.automation.events.EventAutomationUpdateGui +import app.aaps.plugins.automation.triggers.TriggerConnector import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment -import info.nightscout.automation.databinding.AutomationEventItemBinding -import info.nightscout.automation.databinding.AutomationFragmentBinding -import info.nightscout.automation.dialogs.EditEventDialog -import info.nightscout.automation.events.EventAutomationDataChanged -import info.nightscout.automation.events.EventAutomationUpdateGui -import info.nightscout.automation.triggers.TriggerConnector import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/AutomationPlugin.kt similarity index 89% rename from plugins/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/AutomationPlugin.kt index bbc636b699..fb7a77d21c 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/AutomationPlugin.kt @@ -1,11 +1,10 @@ -package info.nightscout.automation +package app.aaps.plugins.automation import android.content.Context import android.os.Handler import android.os.HandlerThread import android.os.SystemClock import app.aaps.annotations.OpenForTesting -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.aps.Loop import app.aaps.core.interfaces.automation.Automation import app.aaps.core.interfaces.automation.AutomationEvent @@ -29,44 +28,45 @@ import app.aaps.core.interfaces.rx.events.EventPreferenceChange import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.plugins.automation.actions.Action +import app.aaps.plugins.automation.actions.ActionAlarm +import app.aaps.plugins.automation.actions.ActionCarePortalEvent +import app.aaps.plugins.automation.actions.ActionNotification +import app.aaps.plugins.automation.actions.ActionProfileSwitch +import app.aaps.plugins.automation.actions.ActionProfileSwitchPercent +import app.aaps.plugins.automation.actions.ActionRunAutotune +import app.aaps.plugins.automation.actions.ActionSendSMS +import app.aaps.plugins.automation.actions.ActionStartTempTarget +import app.aaps.plugins.automation.actions.ActionStopProcessing +import app.aaps.plugins.automation.actions.ActionStopTempTarget +import app.aaps.plugins.automation.elements.Comparator +import app.aaps.plugins.automation.elements.InputDelta +import app.aaps.plugins.automation.events.EventAutomationDataChanged +import app.aaps.plugins.automation.events.EventAutomationUpdateGui +import app.aaps.plugins.automation.events.EventLocationChange +import app.aaps.plugins.automation.services.LocationServiceHelper +import app.aaps.plugins.automation.triggers.Trigger +import app.aaps.plugins.automation.triggers.TriggerAutosensValue +import app.aaps.plugins.automation.triggers.TriggerBTDevice +import app.aaps.plugins.automation.triggers.TriggerBg +import app.aaps.plugins.automation.triggers.TriggerBolusAgo +import app.aaps.plugins.automation.triggers.TriggerCOB +import app.aaps.plugins.automation.triggers.TriggerConnector +import app.aaps.plugins.automation.triggers.TriggerDelta +import app.aaps.plugins.automation.triggers.TriggerHeartRate +import app.aaps.plugins.automation.triggers.TriggerIob +import app.aaps.plugins.automation.triggers.TriggerLocation +import app.aaps.plugins.automation.triggers.TriggerProfilePercent +import app.aaps.plugins.automation.triggers.TriggerPumpLastConnection +import app.aaps.plugins.automation.triggers.TriggerRecurringTime +import app.aaps.plugins.automation.triggers.TriggerTempTarget +import app.aaps.plugins.automation.triggers.TriggerTempTargetValue +import app.aaps.plugins.automation.triggers.TriggerTime +import app.aaps.plugins.automation.triggers.TriggerTimeRange +import app.aaps.plugins.automation.triggers.TriggerWifiSsid +import app.aaps.plugins.automation.ui.TimerUtil import dagger.android.HasAndroidInjector -import info.nightscout.automation.actions.Action -import info.nightscout.automation.actions.ActionAlarm -import info.nightscout.automation.actions.ActionCarePortalEvent -import info.nightscout.automation.actions.ActionNotification -import info.nightscout.automation.actions.ActionProfileSwitch -import info.nightscout.automation.actions.ActionProfileSwitchPercent -import info.nightscout.automation.actions.ActionRunAutotune -import info.nightscout.automation.actions.ActionSendSMS -import info.nightscout.automation.actions.ActionStartTempTarget -import info.nightscout.automation.actions.ActionStopProcessing -import info.nightscout.automation.actions.ActionStopTempTarget -import info.nightscout.automation.elements.Comparator -import info.nightscout.automation.elements.InputDelta -import info.nightscout.automation.events.EventAutomationDataChanged -import info.nightscout.automation.events.EventAutomationUpdateGui -import info.nightscout.automation.events.EventLocationChange -import info.nightscout.automation.services.LocationServiceHelper -import info.nightscout.automation.triggers.Trigger -import info.nightscout.automation.triggers.TriggerAutosensValue -import info.nightscout.automation.triggers.TriggerBTDevice -import info.nightscout.automation.triggers.TriggerBg -import info.nightscout.automation.triggers.TriggerBolusAgo -import info.nightscout.automation.triggers.TriggerCOB -import info.nightscout.automation.triggers.TriggerConnector -import info.nightscout.automation.triggers.TriggerDelta -import info.nightscout.automation.triggers.TriggerHeartRate -import info.nightscout.automation.triggers.TriggerIob -import info.nightscout.automation.triggers.TriggerLocation -import info.nightscout.automation.triggers.TriggerProfilePercent -import info.nightscout.automation.triggers.TriggerPumpLastConnection -import info.nightscout.automation.triggers.TriggerRecurringTime -import info.nightscout.automation.triggers.TriggerTempTarget -import info.nightscout.automation.triggers.TriggerTempTargetValue -import info.nightscout.automation.triggers.TriggerTime -import info.nightscout.automation.triggers.TriggerTimeRange -import info.nightscout.automation.triggers.TriggerWifiSsid -import info.nightscout.automation.ui.TimerUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONArray @@ -413,7 +413,7 @@ class AutomationPlugin @Inject constructor( } /** - * Generate reminder via [info.nightscout.automation.ui.TimerUtil] + * Generate reminder via [app.aaps.plugins.automation.ui.TimerUtil] * * @param seconds seconds to the future */ diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/Action.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/Action.kt similarity index 97% rename from plugins/automation/src/main/java/info/nightscout/automation/actions/Action.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/Action.kt index 7ed52e35a6..4a4e518121 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/Action.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/Action.kt @@ -1,12 +1,12 @@ -package info.nightscout.automation.actions +package app.aaps.plugins.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.queue.Callback import app.aaps.core.interfaces.resources.ResourceHelper +import app.aaps.plugins.automation.triggers.Trigger import dagger.android.HasAndroidInjector -import info.nightscout.automation.triggers.Trigger import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionAlarm.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionAlarm.kt similarity index 87% rename from plugins/automation/src/main/java/info/nightscout/automation/actions/ActionAlarm.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionAlarm.kt index 0149e24193..bef0f0dc83 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionAlarm.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionAlarm.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.actions +package app.aaps.plugins.automation.actions import android.content.Context import android.widget.LinearLayout @@ -9,12 +9,12 @@ import app.aaps.core.interfaces.queue.Callback import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.JsonHelper +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.InputString +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.ui.TimerUtil import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.InputString -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.ui.TimerUtil import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionCarePortalEvent.kt similarity index 93% rename from plugins/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionCarePortalEvent.kt index b96a8894d2..2646698039 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionCarePortalEvent.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.actions +package app.aaps.plugins.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes @@ -15,12 +15,12 @@ import app.aaps.core.utils.JsonHelper import app.aaps.database.entities.TherapyEvent import app.aaps.database.entities.UserEntry import app.aaps.database.entities.ValueWithUnit +import app.aaps.plugins.automation.elements.InputCarePortalMenu +import app.aaps.plugins.automation.elements.InputDuration +import app.aaps.plugins.automation.elements.InputString +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder import dagger.android.HasAndroidInjector -import info.nightscout.automation.elements.InputCarePortalMenu -import info.nightscout.automation.elements.InputDuration -import info.nightscout.automation.elements.InputString -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import io.reactivex.rxjava3.disposables.CompositeDisposable @@ -74,7 +74,7 @@ class ActionCarePortalEvent(injector: HasAndroidInjector) : Action(injector) { } } else { therapyEvent.duration = T.mins(duration.value.toLong()).msecs() - valuesWithUnit.add(ValueWithUnit.Minute(duration.value).takeIf { !duration.value.equals(0) }) + valuesWithUnit.add(ValueWithUnit.Minute(duration.value).takeIf { duration.value != 0 }) } therapyEvent.note = note.value valuesWithUnit.add(ValueWithUnit.SimpleString(note.value).takeIf { note.value.isNotBlank() }) diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionDummy.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionDummy.kt similarity index 94% rename from plugins/automation/src/main/java/info/nightscout/automation/actions/ActionDummy.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionDummy.kt index 8a497d5d22..a728185bd7 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionDummy.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionDummy.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.actions +package app.aaps.plugins.automation.actions import app.aaps.core.interfaces.queue.Callback import dagger.android.HasAndroidInjector diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionLoopDisable.kt similarity index 96% rename from plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionLoopDisable.kt index 4469cf7c4a..b1e7b3663e 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionLoopDisable.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.actions +package app.aaps.plugins.automation.actions import androidx.annotation.DrawableRes import app.aaps.core.interfaces.aps.Loop @@ -13,8 +13,8 @@ import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventRefreshOverview import app.aaps.database.entities.UserEntry import app.aaps.database.entities.UserEntry.Sources +import app.aaps.plugins.automation.R import dagger.android.HasAndroidInjector -import info.nightscout.automation.R import javax.inject.Inject class ActionLoopDisable(injector: HasAndroidInjector) : Action(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionLoopEnable.kt similarity index 95% rename from plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionLoopEnable.kt index e7e21128b9..833bcb7992 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionLoopEnable.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.actions +package app.aaps.plugins.automation.actions import androidx.annotation.DrawableRes import app.aaps.core.interfaces.aps.Loop @@ -12,8 +12,8 @@ import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventRefreshOverview import app.aaps.database.entities.UserEntry import app.aaps.database.entities.UserEntry.Sources +import app.aaps.plugins.automation.R import dagger.android.HasAndroidInjector -import info.nightscout.automation.R import javax.inject.Inject class ActionLoopEnable(injector: HasAndroidInjector) : Action(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionLoopResume.kt similarity index 96% rename from plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionLoopResume.kt index a040b86f87..2b29ee420d 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionLoopResume.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.actions +package app.aaps.plugins.automation.actions import androidx.annotation.DrawableRes import app.aaps.core.interfaces.aps.Loop @@ -12,8 +12,8 @@ import app.aaps.core.interfaces.rx.events.EventRefreshOverview import app.aaps.core.interfaces.utils.DateUtil import app.aaps.database.entities.UserEntry import app.aaps.database.entities.UserEntry.Sources +import app.aaps.plugins.automation.R import dagger.android.HasAndroidInjector -import info.nightscout.automation.R import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionLoopSuspend.kt similarity index 91% rename from plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionLoopSuspend.kt index fd1b437c82..477ef844fc 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionLoopSuspend.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.actions +package app.aaps.plugins.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes @@ -12,11 +12,11 @@ import app.aaps.core.utils.JsonHelper import app.aaps.database.entities.UserEntry import app.aaps.database.entities.UserEntry.Sources import app.aaps.database.entities.ValueWithUnit +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.InputDuration +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.InputDuration -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionNotification.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionNotification.kt similarity index 90% rename from plugins/automation/src/main/java/info/nightscout/automation/actions/ActionNotification.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionNotification.kt index c75bea5bf0..2490889b61 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionNotification.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionNotification.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.actions +package app.aaps.plugins.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes @@ -9,11 +9,11 @@ import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventRefreshOverview import app.aaps.core.main.events.EventNewNotification import app.aaps.core.utils.JsonHelper +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.InputString +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.InputString -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionProfileSwitch.kt similarity index 93% rename from plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionProfileSwitch.kt index 882e583c63..edcecab128 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionProfileSwitch.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.actions +package app.aaps.plugins.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes @@ -13,11 +13,11 @@ import app.aaps.core.utils.JsonHelper import app.aaps.database.entities.UserEntry import app.aaps.database.entities.UserEntry.Sources import app.aaps.database.entities.ValueWithUnit +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.InputProfileName +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.InputProfileName -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionProfileSwitchPercent.kt similarity index 88% rename from plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionProfileSwitchPercent.kt index a6f91abdb3..8ddedddfd0 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionProfileSwitchPercent.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.actions +package app.aaps.plugins.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes @@ -11,14 +11,14 @@ import app.aaps.core.utils.JsonHelper import app.aaps.database.entities.UserEntry import app.aaps.database.entities.UserEntry.Sources import app.aaps.database.entities.ValueWithUnit +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.Comparator +import app.aaps.plugins.automation.elements.InputDuration +import app.aaps.plugins.automation.elements.InputPercent +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.triggers.TriggerProfilePercent import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.Comparator -import info.nightscout.automation.elements.InputDuration -import info.nightscout.automation.elements.InputPercent -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.triggers.TriggerProfilePercent import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionRunAutotune.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionRunAutotune.kt similarity index 93% rename from plugins/automation/src/main/java/info/nightscout/automation/actions/ActionRunAutotune.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionRunAutotune.kt index 88b533204e..d493f2559c 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionRunAutotune.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionRunAutotune.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.actions +package app.aaps.plugins.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes @@ -12,12 +12,12 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.ui.elements.WeekDay import app.aaps.core.utils.JsonHelper +import app.aaps.plugins.automation.elements.InputDuration +import app.aaps.plugins.automation.elements.InputProfileName +import app.aaps.plugins.automation.elements.InputWeekDay +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder import dagger.android.HasAndroidInjector -import info.nightscout.automation.elements.InputDuration -import info.nightscout.automation.elements.InputProfileName -import info.nightscout.automation.elements.InputWeekDay -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionSendSMS.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionSendSMS.kt similarity index 87% rename from plugins/automation/src/main/java/info/nightscout/automation/actions/ActionSendSMS.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionSendSMS.kt index b739a900d0..c5e8339456 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionSendSMS.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionSendSMS.kt @@ -1,15 +1,15 @@ -package info.nightscout.automation.actions +package app.aaps.plugins.automation.actions import android.widget.LinearLayout import app.aaps.core.interfaces.pump.PumpEnactResult import app.aaps.core.interfaces.queue.Callback import app.aaps.core.interfaces.smsCommunicator.SmsCommunicator import app.aaps.core.utils.JsonHelper +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.InputString +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.InputString -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionStartTempTarget.kt similarity index 92% rename from plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionStartTempTarget.kt index 1d0ea2f846..df351ea91c 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionStartTempTarget.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.actions +package app.aaps.plugins.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes @@ -19,14 +19,14 @@ import app.aaps.database.entities.TemporaryTarget import app.aaps.database.entities.UserEntry import app.aaps.database.entities.UserEntry.Sources import app.aaps.database.entities.ValueWithUnit +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.ComparatorExists +import app.aaps.plugins.automation.elements.InputDuration +import app.aaps.plugins.automation.elements.InputTempTarget +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.triggers.TriggerTempTarget import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.ComparatorExists -import info.nightscout.automation.elements.InputDuration -import info.nightscout.automation.elements.InputTempTarget -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.triggers.TriggerTempTarget import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import io.reactivex.rxjava3.disposables.CompositeDisposable @@ -107,7 +107,7 @@ class ActionStartTempTarget(injector: HasAndroidInjector) : Action(injector) { return this } - fun tt() = TemporaryTarget( + private fun tt() = TemporaryTarget( timestamp = dateUtil.now(), duration = TimeUnit.MINUTES.toMillis(duration.getMinutes().toLong()), reason = TemporaryTarget.Reason.AUTOMATION, diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopProcessing.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionStopProcessing.kt similarity index 92% rename from plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopProcessing.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionStopProcessing.kt index 72fe468a9e..cfc877f99f 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopProcessing.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionStopProcessing.kt @@ -1,11 +1,11 @@ -package info.nightscout.automation.actions +package app.aaps.plugins.automation.actions import androidx.annotation.DrawableRes import app.aaps.core.interfaces.pump.PumpEnactResult import app.aaps.core.interfaces.queue.Callback +import app.aaps.plugins.automation.R import com.google.gson.JsonObject import dagger.android.HasAndroidInjector -import info.nightscout.automation.R import org.json.JSONObject class ActionStopProcessing(injector: HasAndroidInjector) : Action(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionStopTempTarget.kt similarity index 95% rename from plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionStopTempTarget.kt index 8e520b226d..43f75fc768 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/actions/ActionStopTempTarget.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.actions +package app.aaps.plugins.automation.actions import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.logging.UserEntryLogger @@ -7,8 +7,8 @@ import app.aaps.core.interfaces.queue.Callback import app.aaps.core.interfaces.utils.DateUtil import app.aaps.database.entities.UserEntry import app.aaps.database.entities.UserEntry.Sources +import app.aaps.plugins.automation.R import dagger.android.HasAndroidInjector -import info.nightscout.automation.R import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/plugins/automation/src/main/java/info/nightscout/automation/di/AutomationModule.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/di/AutomationModule.kt similarity index 61% rename from plugins/automation/src/main/java/info/nightscout/automation/di/AutomationModule.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/di/AutomationModule.kt index 6e74ce3a30..de98e00873 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/di/AutomationModule.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/di/AutomationModule.kt @@ -1,55 +1,55 @@ -package info.nightscout.automation.di +package app.aaps.plugins.automation.di import app.aaps.core.interfaces.automation.Automation +import app.aaps.plugins.automation.AutomationEventObject +import app.aaps.plugins.automation.AutomationFragment +import app.aaps.plugins.automation.AutomationPlugin +import app.aaps.plugins.automation.actions.Action +import app.aaps.plugins.automation.actions.ActionAlarm +import app.aaps.plugins.automation.actions.ActionCarePortalEvent +import app.aaps.plugins.automation.actions.ActionDummy +import app.aaps.plugins.automation.actions.ActionLoopDisable +import app.aaps.plugins.automation.actions.ActionLoopEnable +import app.aaps.plugins.automation.actions.ActionLoopResume +import app.aaps.plugins.automation.actions.ActionLoopSuspend +import app.aaps.plugins.automation.actions.ActionNotification +import app.aaps.plugins.automation.actions.ActionProfileSwitch +import app.aaps.plugins.automation.actions.ActionProfileSwitchPercent +import app.aaps.plugins.automation.actions.ActionRunAutotune +import app.aaps.plugins.automation.actions.ActionSendSMS +import app.aaps.plugins.automation.actions.ActionStartTempTarget +import app.aaps.plugins.automation.actions.ActionStopProcessing +import app.aaps.plugins.automation.actions.ActionStopTempTarget +import app.aaps.plugins.automation.dialogs.ChooseActionDialog +import app.aaps.plugins.automation.dialogs.ChooseOperationDialog +import app.aaps.plugins.automation.dialogs.ChooseTriggerDialog +import app.aaps.plugins.automation.dialogs.EditActionDialog +import app.aaps.plugins.automation.dialogs.EditEventDialog +import app.aaps.plugins.automation.dialogs.EditTriggerDialog +import app.aaps.plugins.automation.services.LocationService +import app.aaps.plugins.automation.triggers.Trigger +import app.aaps.plugins.automation.triggers.TriggerAutosensValue +import app.aaps.plugins.automation.triggers.TriggerBTDevice +import app.aaps.plugins.automation.triggers.TriggerBg +import app.aaps.plugins.automation.triggers.TriggerBolusAgo +import app.aaps.plugins.automation.triggers.TriggerCOB +import app.aaps.plugins.automation.triggers.TriggerConnector +import app.aaps.plugins.automation.triggers.TriggerDelta +import app.aaps.plugins.automation.triggers.TriggerDummy +import app.aaps.plugins.automation.triggers.TriggerHeartRate +import app.aaps.plugins.automation.triggers.TriggerIob +import app.aaps.plugins.automation.triggers.TriggerLocation +import app.aaps.plugins.automation.triggers.TriggerProfilePercent +import app.aaps.plugins.automation.triggers.TriggerPumpLastConnection +import app.aaps.plugins.automation.triggers.TriggerRecurringTime +import app.aaps.plugins.automation.triggers.TriggerTempTarget +import app.aaps.plugins.automation.triggers.TriggerTempTargetValue +import app.aaps.plugins.automation.triggers.TriggerTime +import app.aaps.plugins.automation.triggers.TriggerTimeRange +import app.aaps.plugins.automation.triggers.TriggerWifiSsid import dagger.Binds import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.automation.AutomationEventObject -import info.nightscout.automation.AutomationFragment -import info.nightscout.automation.AutomationPlugin -import info.nightscout.automation.actions.Action -import info.nightscout.automation.actions.ActionAlarm -import info.nightscout.automation.actions.ActionCarePortalEvent -import info.nightscout.automation.actions.ActionDummy -import info.nightscout.automation.actions.ActionLoopDisable -import info.nightscout.automation.actions.ActionLoopEnable -import info.nightscout.automation.actions.ActionLoopResume -import info.nightscout.automation.actions.ActionLoopSuspend -import info.nightscout.automation.actions.ActionNotification -import info.nightscout.automation.actions.ActionProfileSwitch -import info.nightscout.automation.actions.ActionProfileSwitchPercent -import info.nightscout.automation.actions.ActionRunAutotune -import info.nightscout.automation.actions.ActionSendSMS -import info.nightscout.automation.actions.ActionStartTempTarget -import info.nightscout.automation.actions.ActionStopProcessing -import info.nightscout.automation.actions.ActionStopTempTarget -import info.nightscout.automation.dialogs.ChooseActionDialog -import info.nightscout.automation.dialogs.ChooseOperationDialog -import info.nightscout.automation.dialogs.ChooseTriggerDialog -import info.nightscout.automation.dialogs.EditActionDialog -import info.nightscout.automation.dialogs.EditEventDialog -import info.nightscout.automation.dialogs.EditTriggerDialog -import info.nightscout.automation.services.LocationService -import info.nightscout.automation.triggers.Trigger -import info.nightscout.automation.triggers.TriggerAutosensValue -import info.nightscout.automation.triggers.TriggerBTDevice -import info.nightscout.automation.triggers.TriggerBg -import info.nightscout.automation.triggers.TriggerBolusAgo -import info.nightscout.automation.triggers.TriggerCOB -import info.nightscout.automation.triggers.TriggerConnector -import info.nightscout.automation.triggers.TriggerDelta -import info.nightscout.automation.triggers.TriggerDummy -import info.nightscout.automation.triggers.TriggerHeartRate -import info.nightscout.automation.triggers.TriggerIob -import info.nightscout.automation.triggers.TriggerLocation -import info.nightscout.automation.triggers.TriggerProfilePercent -import info.nightscout.automation.triggers.TriggerPumpLastConnection -import info.nightscout.automation.triggers.TriggerRecurringTime -import info.nightscout.automation.triggers.TriggerTempTarget -import info.nightscout.automation.triggers.TriggerTempTargetValue -import info.nightscout.automation.triggers.TriggerTime -import info.nightscout.automation.triggers.TriggerTimeRange -import info.nightscout.automation.triggers.TriggerWifiSsid @Module( includes = [ diff --git a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/BaseDialog.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/BaseDialog.kt similarity index 98% rename from plugins/automation/src/main/java/info/nightscout/automation/dialogs/BaseDialog.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/BaseDialog.kt index d6a607f632..50f42947ed 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/BaseDialog.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/BaseDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.dialogs +package app.aaps.plugins.automation.dialogs import android.os.Bundle import android.view.View diff --git a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/ChooseActionDialog.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/ChooseActionDialog.kt similarity index 89% rename from plugins/automation/src/main/java/info/nightscout/automation/dialogs/ChooseActionDialog.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/ChooseActionDialog.kt index de30b033c8..3fc6dc9e58 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/ChooseActionDialog.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/ChooseActionDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.dialogs +package app.aaps.plugins.automation.dialogs import android.os.Bundle import android.view.LayoutInflater @@ -6,12 +6,12 @@ import android.view.View import android.view.ViewGroup import android.widget.RadioButton import app.aaps.core.interfaces.rx.bus.RxBus +import app.aaps.plugins.automation.AutomationPlugin +import app.aaps.plugins.automation.actions.Action +import app.aaps.plugins.automation.databinding.AutomationDialogChooseActionBinding +import app.aaps.plugins.automation.events.EventAutomationAddAction +import app.aaps.plugins.automation.events.EventAutomationUpdateGui import dagger.android.HasAndroidInjector -import info.nightscout.automation.AutomationPlugin -import info.nightscout.automation.actions.Action -import info.nightscout.automation.databinding.AutomationDialogChooseActionBinding -import info.nightscout.automation.events.EventAutomationAddAction -import info.nightscout.automation.events.EventAutomationUpdateGui import javax.inject.Inject import kotlin.reflect.full.primaryConstructor diff --git a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/ChooseOperationDialog.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/ChooseOperationDialog.kt similarity index 93% rename from plugins/automation/src/main/java/info/nightscout/automation/dialogs/ChooseOperationDialog.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/ChooseOperationDialog.kt index 233319d3c3..9addd6b7f2 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/ChooseOperationDialog.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/ChooseOperationDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.dialogs +package app.aaps.plugins.automation.dialogs import android.os.Bundle import android.view.LayoutInflater @@ -6,8 +6,8 @@ import android.view.View import android.view.ViewGroup import android.widget.RadioButton import app.aaps.core.interfaces.resources.ResourceHelper -import info.nightscout.automation.databinding.AutomationDialogChooseOperationBinding -import info.nightscout.automation.triggers.TriggerConnector +import app.aaps.plugins.automation.databinding.AutomationDialogChooseOperationBinding +import app.aaps.plugins.automation.triggers.TriggerConnector import javax.inject.Inject class ChooseOperationDialog : BaseDialog() { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/ChooseTriggerDialog.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/ChooseTriggerDialog.kt similarity index 93% rename from plugins/automation/src/main/java/info/nightscout/automation/dialogs/ChooseTriggerDialog.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/ChooseTriggerDialog.kt index 5236c94da9..24c7da37e3 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/ChooseTriggerDialog.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/ChooseTriggerDialog.kt @@ -1,14 +1,14 @@ -package info.nightscout.automation.dialogs +package app.aaps.plugins.automation.dialogs import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.RadioButton +import app.aaps.plugins.automation.AutomationPlugin +import app.aaps.plugins.automation.databinding.AutomationDialogChooseTriggerBinding +import app.aaps.plugins.automation.triggers.Trigger import dagger.android.HasAndroidInjector -import info.nightscout.automation.AutomationPlugin -import info.nightscout.automation.databinding.AutomationDialogChooseTriggerBinding -import info.nightscout.automation.triggers.Trigger import javax.inject.Inject import kotlin.reflect.full.primaryConstructor diff --git a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditActionDialog.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/EditActionDialog.kt similarity index 87% rename from plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditActionDialog.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/EditActionDialog.kt index 58b16bbe07..ab09b10ff9 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditActionDialog.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/EditActionDialog.kt @@ -1,15 +1,15 @@ -package info.nightscout.automation.dialogs +package app.aaps.plugins.automation.dialogs import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import app.aaps.core.interfaces.rx.bus.RxBus +import app.aaps.plugins.automation.actions.Action +import app.aaps.plugins.automation.actions.ActionDummy +import app.aaps.plugins.automation.databinding.AutomationDialogActionBinding +import app.aaps.plugins.automation.events.EventAutomationUpdateAction import dagger.android.HasAndroidInjector -import info.nightscout.automation.actions.Action -import info.nightscout.automation.actions.ActionDummy -import info.nightscout.automation.databinding.AutomationDialogActionBinding -import info.nightscout.automation.events.EventAutomationUpdateAction import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/EditEventDialog.kt similarity index 93% rename from plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/EditEventDialog.kt index a3113e6be2..cad9f0206a 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/EditEventDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.dialogs +package app.aaps.plugins.automation.dialogs import android.os.Bundle import android.view.LayoutInflater @@ -9,22 +9,22 @@ import android.widget.LinearLayout import android.widget.TextView import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.extensions.toVisibility import app.aaps.core.interfaces.rx.AapsSchedulers import app.aaps.core.interfaces.rx.bus.RxBus -import dagger.android.HasAndroidInjector -import info.nightscout.automation.AutomationEventObject -import info.nightscout.automation.AutomationPlugin -import info.nightscout.automation.R -import info.nightscout.automation.actions.Action -import info.nightscout.automation.databinding.AutomationDialogEventBinding -import info.nightscout.automation.events.EventAutomationAddAction -import info.nightscout.automation.events.EventAutomationDataChanged -import info.nightscout.automation.events.EventAutomationUpdateAction -import info.nightscout.automation.events.EventAutomationUpdateGui -import info.nightscout.automation.events.EventAutomationUpdateTrigger +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.toast.ToastUtils +import app.aaps.plugins.automation.AutomationEventObject +import app.aaps.plugins.automation.AutomationPlugin +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.actions.Action +import app.aaps.plugins.automation.databinding.AutomationDialogEventBinding +import app.aaps.plugins.automation.events.EventAutomationAddAction +import app.aaps.plugins.automation.events.EventAutomationDataChanged +import app.aaps.plugins.automation.events.EventAutomationUpdateAction +import app.aaps.plugins.automation.events.EventAutomationUpdateGui +import app.aaps.plugins.automation.events.EventAutomationUpdateTrigger +import dagger.android.HasAndroidInjector import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditTriggerDialog.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/EditTriggerDialog.kt similarity index 87% rename from plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditTriggerDialog.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/EditTriggerDialog.kt index 3208d08ce4..efd6de629e 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditTriggerDialog.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/dialogs/EditTriggerDialog.kt @@ -1,21 +1,21 @@ -package info.nightscout.automation.dialogs +package app.aaps.plugins.automation.dialogs import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.rx.AapsSchedulers import app.aaps.core.interfaces.rx.bus.RxBus +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.plugins.automation.databinding.AutomationDialogEditTriggerBinding +import app.aaps.plugins.automation.events.EventAutomationUpdateTrigger +import app.aaps.plugins.automation.events.EventTriggerChanged +import app.aaps.plugins.automation.events.EventTriggerClone +import app.aaps.plugins.automation.events.EventTriggerRemove +import app.aaps.plugins.automation.triggers.Trigger +import app.aaps.plugins.automation.triggers.TriggerConnector +import app.aaps.plugins.automation.triggers.TriggerDummy import dagger.android.HasAndroidInjector -import info.nightscout.automation.databinding.AutomationDialogEditTriggerBinding -import info.nightscout.automation.events.EventAutomationUpdateTrigger -import info.nightscout.automation.events.EventTriggerChanged -import info.nightscout.automation.events.EventTriggerClone -import info.nightscout.automation.events.EventTriggerRemove -import info.nightscout.automation.triggers.Trigger -import info.nightscout.automation.triggers.TriggerConnector -import info.nightscout.automation.triggers.TriggerDummy import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONObject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/Comparator.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/Comparator.kt similarity index 97% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/Comparator.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/Comparator.kt index a52da26a30..00a5391a02 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/Comparator.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/Comparator.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.view.Gravity import android.view.View @@ -8,7 +8,7 @@ import android.widget.LinearLayout import android.widget.Spinner import androidx.annotation.StringRes import app.aaps.core.interfaces.resources.ResourceHelper -import info.nightscout.automation.R +import app.aaps.plugins.automation.R class Comparator(private val rh: ResourceHelper) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/ComparatorConnect.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/ComparatorConnect.kt similarity index 96% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/ComparatorConnect.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/ComparatorConnect.kt index 4d682c8a4b..a466360c54 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/ComparatorConnect.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/ComparatorConnect.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.view.Gravity import android.view.View @@ -8,7 +8,7 @@ import android.widget.LinearLayout import android.widget.Spinner import androidx.annotation.StringRes import app.aaps.core.interfaces.resources.ResourceHelper -import info.nightscout.automation.R +import app.aaps.plugins.automation.R class ComparatorConnect(private val rh: ResourceHelper) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/ComparatorExists.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/ComparatorExists.kt similarity index 97% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/ComparatorExists.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/ComparatorExists.kt index c73cf489df..f269ae3226 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/ComparatorExists.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/ComparatorExists.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.view.Gravity import android.view.View diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/Element.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/Element.kt similarity index 68% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/Element.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/Element.kt index 0f4e512b51..e9af893b6c 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/Element.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/Element.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.widget.LinearLayout diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputBg.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputBg.kt similarity index 97% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/InputBg.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputBg.kt index 0696da4be7..d8696fb864 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputBg.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputBg.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.view.Gravity import android.widget.LinearLayout diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputButton.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputButton.kt similarity index 92% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/InputButton.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputButton.kt index 3841de824e..10b270d7df 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputButton.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputButton.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.view.Gravity import android.widget.Button diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputCarePortalMenu.kt similarity index 98% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputCarePortalMenu.kt index 9efd5e198c..3d35e9bcc1 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputCarePortalMenu.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.view.Gravity import android.view.View diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDateTime.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputDateTime.kt similarity index 94% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/InputDateTime.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputDateTime.kt index 57eaaa3f1f..21a8023b51 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDateTime.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputDateTime.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.content.Context import android.graphics.Typeface @@ -11,10 +11,10 @@ import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.FragmentManager import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.DateUtil +import app.aaps.plugins.automation.R import com.google.android.material.datepicker.MaterialDatePicker import com.google.android.material.timepicker.MaterialTimePicker import com.google.android.material.timepicker.TimeFormat -import info.nightscout.automation.R import java.util.Calendar class InputDateTime(private val rh: ResourceHelper, private val dateUtil: DateUtil, var value: Long = dateUtil.now()) : Element { @@ -63,8 +63,8 @@ class InputDateTime(private val rh: ResourceHelper, private val dateUtil: DateUt val timePicker = MaterialTimePicker.Builder() .setTheme(app.aaps.core.ui.R.style.TimePicker) .setTimeFormat(clockFormat) - .setHour(cal.get(Calendar.HOUR_OF_DAY)) - .setMinute(cal.get(Calendar.MINUTE)) + .setHour(cal[Calendar.HOUR_OF_DAY]) + .setMinute(cal[Calendar.MINUTE]) .build() timePicker.addOnPositiveButtonClickListener { value = dateUtil.mergeHourMinuteToTimestamp(value, timePicker.hour, timePicker.minute) diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDelta.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputDelta.kt similarity index 97% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/InputDelta.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputDelta.kt index fc65440421..c88d37c05a 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDelta.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputDelta.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.view.Gravity import android.view.View @@ -8,8 +8,8 @@ import android.widget.LinearLayout import android.widget.Spinner import androidx.annotation.StringRes import app.aaps.core.interfaces.resources.ResourceHelper -import info.nightscout.automation.R import app.aaps.core.ui.elements.NumberPicker +import app.aaps.plugins.automation.R import java.text.DecimalFormat class InputDelta(private val rh: ResourceHelper) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDouble.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputDouble.kt similarity index 97% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/InputDouble.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputDouble.kt index 1a5a1fcf42..25b95baef5 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDouble.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputDouble.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.view.Gravity import android.widget.LinearLayout diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDropdownMenu.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputDropdownMenu.kt similarity index 97% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/InputDropdownMenu.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputDropdownMenu.kt index 43471066a3..c84f3761d0 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDropdownMenu.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputDropdownMenu.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.view.Gravity import android.view.View diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDuration.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputDuration.kt similarity index 97% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/InputDuration.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputDuration.kt index 0ecc278ec5..ab7b320e0d 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDuration.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputDuration.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.view.Gravity import android.widget.LinearLayout diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputInsulin.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputInsulin.kt similarity index 93% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/InputInsulin.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputInsulin.kt index 3c1c9c0c7f..0418e8095d 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputInsulin.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputInsulin.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.view.Gravity import android.widget.LinearLayout diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputLocationMode.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputLocationMode.kt similarity index 96% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/InputLocationMode.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputLocationMode.kt index 262654bf0b..f519a4a201 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputLocationMode.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputLocationMode.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.view.Gravity import android.view.View @@ -8,7 +8,7 @@ import android.widget.LinearLayout import android.widget.Spinner import androidx.annotation.StringRes import app.aaps.core.interfaces.resources.ResourceHelper -import info.nightscout.automation.R +import app.aaps.plugins.automation.R class InputLocationMode(private val rh: ResourceHelper) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputPercent.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputPercent.kt similarity index 94% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/InputPercent.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputPercent.kt index 4f192cf0ab..31fd56d164 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputPercent.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputPercent.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.view.Gravity import android.widget.LinearLayout diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputProfileName.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputProfileName.kt similarity index 97% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/InputProfileName.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputProfileName.kt index 9465a98fcf..95da31910a 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputProfileName.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputProfileName.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.view.Gravity import android.view.View diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputString.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputString.kt similarity index 95% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/InputString.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputString.kt index 9894e47ef2..da3ddda330 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputString.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputString.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.text.Editable import android.text.TextWatcher diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTempTarget.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputTempTarget.kt similarity index 97% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/InputTempTarget.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputTempTarget.kt index e6cb518bb7..3f124c8f36 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTempTarget.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputTempTarget.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.view.Gravity import android.widget.LinearLayout diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTime.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputTime.kt similarity index 93% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/InputTime.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputTime.kt index 56555e3702..4174bdb988 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTime.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputTime.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.content.Context import android.graphics.Typeface @@ -13,9 +13,9 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.MidnightTime import app.aaps.core.utils.MidnightUtils +import app.aaps.plugins.automation.R import com.google.android.material.timepicker.MaterialTimePicker import com.google.android.material.timepicker.TimeFormat -import info.nightscout.automation.R import java.util.Calendar class InputTime(private val rh: ResourceHelper, private val dateUtil: DateUtil) : Element { @@ -43,8 +43,8 @@ class InputTime(private val rh: ResourceHelper, private val dateUtil: DateUtil) val clockFormat = if (DateFormat.is24HourFormat(context)) TimeFormat.CLOCK_24H else TimeFormat.CLOCK_12H val timePicker = MaterialTimePicker.Builder() .setTimeFormat(clockFormat) - .setHour(cal.get(Calendar.HOUR_OF_DAY)) - .setMinute(cal.get(Calendar.MINUTE)) + .setHour(cal[Calendar.HOUR_OF_DAY]) + .setMinute(cal[Calendar.MINUTE]) .build() timePicker.addOnPositiveButtonClickListener { value = 60 * timePicker.hour + timePicker.minute diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTimeRange.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputTimeRange.kt similarity index 92% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/InputTimeRange.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputTimeRange.kt index 710abfd84d..c8810d75e2 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTimeRange.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputTimeRange.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.content.Context import android.graphics.Typeface @@ -14,9 +14,9 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.MidnightTime import app.aaps.core.utils.MidnightUtils +import app.aaps.plugins.automation.R import com.google.android.material.timepicker.MaterialTimePicker import com.google.android.material.timepicker.TimeFormat -import info.nightscout.automation.R import java.util.Calendar class InputTimeRange(private val rh: ResourceHelper, private val dateUtil: DateUtil) : Element { @@ -48,8 +48,8 @@ class InputTimeRange(private val rh: ResourceHelper, private val dateUtil: DateU val clockFormat = if (DateFormat.is24HourFormat(context)) TimeFormat.CLOCK_24H else TimeFormat.CLOCK_12H val timePicker = MaterialTimePicker.Builder() .setTimeFormat(clockFormat) - .setHour(cal.get(Calendar.HOUR_OF_DAY)) - .setMinute(cal.get(Calendar.MINUTE)) + .setHour(cal[Calendar.HOUR_OF_DAY]) + .setMinute(cal[Calendar.MINUTE]) .build() timePicker.addOnPositiveButtonClickListener { start = 60 * timePicker.hour + timePicker.minute @@ -69,8 +69,8 @@ class InputTimeRange(private val rh: ResourceHelper, private val dateUtil: DateU val clockFormat = if (DateFormat.is24HourFormat(context)) TimeFormat.CLOCK_24H else TimeFormat.CLOCK_12H val timePicker = MaterialTimePicker.Builder() .setTimeFormat(clockFormat) - .setHour(cal.get(Calendar.HOUR_OF_DAY)) - .setMinute(cal.get(Calendar.MINUTE)) + .setHour(cal[Calendar.HOUR_OF_DAY]) + .setMinute(cal[Calendar.MINUTE]) .build() timePicker.addOnPositiveButtonClickListener { end = 60 * timePicker.hour + timePicker.minute diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputWeekDay.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputWeekDay.kt similarity index 64% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/InputWeekDay.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputWeekDay.kt index a46e45aa60..1c9b327025 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputWeekDay.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/InputWeekDay.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import app.aaps.core.ui.elements.WeekDay diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/LabelWithElement.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/LabelWithElement.kt similarity index 96% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/LabelWithElement.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/LabelWithElement.kt index 73dc147001..844cad3ca7 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/LabelWithElement.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/LabelWithElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.graphics.Typeface import android.view.Gravity diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/LayoutBuilder.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/LayoutBuilder.kt similarity index 96% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/LayoutBuilder.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/LayoutBuilder.kt index 187a4b62c0..5175788aa9 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/LayoutBuilder.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/LayoutBuilder.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.content.Context import android.view.ViewGroup diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/StaticLabel.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/StaticLabel.kt similarity index 94% rename from plugins/automation/src/main/java/info/nightscout/automation/elements/StaticLabel.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/StaticLabel.kt index 54fb4f614f..c08ed01de3 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/StaticLabel.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/elements/StaticLabel.kt @@ -1,11 +1,11 @@ -package info.nightscout.automation.elements +package app.aaps.plugins.automation.elements import android.graphics.Typeface import android.view.ViewGroup import android.widget.LinearLayout import android.widget.TextView import app.aaps.core.interfaces.resources.ResourceHelper -import info.nightscout.automation.triggers.Trigger +import app.aaps.plugins.automation.triggers.Trigger class StaticLabel(private val rh: ResourceHelper) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationAddAction.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventAutomationAddAction.kt similarity index 54% rename from plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationAddAction.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventAutomationAddAction.kt index a7ec25904d..8c2744c9dc 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationAddAction.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventAutomationAddAction.kt @@ -1,6 +1,6 @@ -package info.nightscout.automation.events +package app.aaps.plugins.automation.events import app.aaps.core.interfaces.rx.events.Event -import info.nightscout.automation.actions.Action +import app.aaps.plugins.automation.actions.Action class EventAutomationAddAction(val action: Action) : Event() diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationDataChanged.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventAutomationDataChanged.kt similarity index 68% rename from plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationDataChanged.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventAutomationDataChanged.kt index c42b4252f3..26d62c5bab 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationDataChanged.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventAutomationDataChanged.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.events +package app.aaps.plugins.automation.events import app.aaps.core.interfaces.rx.events.Event diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateAction.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventAutomationUpdateAction.kt similarity index 58% rename from plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateAction.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventAutomationUpdateAction.kt index a8efbf23de..391ec207ab 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateAction.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventAutomationUpdateAction.kt @@ -1,6 +1,6 @@ -package info.nightscout.automation.events +package app.aaps.plugins.automation.events import app.aaps.core.interfaces.rx.events.Event -import info.nightscout.automation.actions.Action +import app.aaps.plugins.automation.actions.Action class EventAutomationUpdateAction(val action: Action, val position: Int) : Event() \ No newline at end of file diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateGui.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventAutomationUpdateGui.kt similarity index 67% rename from plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateGui.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventAutomationUpdateGui.kt index f275e309c5..aef9908bef 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateGui.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventAutomationUpdateGui.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.events +package app.aaps.plugins.automation.events import app.aaps.core.interfaces.rx.events.Event diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateTrigger.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventAutomationUpdateTrigger.kt similarity index 54% rename from plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateTrigger.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventAutomationUpdateTrigger.kt index 8377e30092..4b419637a8 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateTrigger.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventAutomationUpdateTrigger.kt @@ -1,6 +1,6 @@ -package info.nightscout.automation.events +package app.aaps.plugins.automation.events import app.aaps.core.interfaces.rx.events.Event -import info.nightscout.automation.triggers.TriggerConnector +import app.aaps.plugins.automation.triggers.TriggerConnector class EventAutomationUpdateTrigger(val trigger: TriggerConnector) : Event() diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventLocationChange.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventLocationChange.kt similarity index 76% rename from plugins/automation/src/main/java/info/nightscout/automation/events/EventLocationChange.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventLocationChange.kt index 7911cac6b5..26be7ca74f 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventLocationChange.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventLocationChange.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.events +package app.aaps.plugins.automation.events import android.location.Location import app.aaps.core.interfaces.rx.events.Event diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerChanged.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventTriggerChanged.kt similarity index 66% rename from plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerChanged.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventTriggerChanged.kt index f37745c935..4dcc503e41 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerChanged.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventTriggerChanged.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.events +package app.aaps.plugins.automation.events import app.aaps.core.interfaces.rx.events.Event diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerClone.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventTriggerClone.kt similarity index 52% rename from plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerClone.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventTriggerClone.kt index 10b8649ccc..06d378e5cd 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerClone.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventTriggerClone.kt @@ -1,6 +1,6 @@ -package info.nightscout.automation.events +package app.aaps.plugins.automation.events import app.aaps.core.interfaces.rx.events.Event -import info.nightscout.automation.triggers.Trigger +import app.aaps.plugins.automation.triggers.Trigger class EventTriggerClone(val trigger: Trigger) : Event() \ No newline at end of file diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerRemove.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventTriggerRemove.kt similarity index 52% rename from plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerRemove.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventTriggerRemove.kt index ae0c04b388..21c194b618 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerRemove.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/events/EventTriggerRemove.kt @@ -1,6 +1,6 @@ -package info.nightscout.automation.events +package app.aaps.plugins.automation.events import app.aaps.core.interfaces.rx.events.Event -import info.nightscout.automation.triggers.Trigger +import app.aaps.plugins.automation.triggers.Trigger class EventTriggerRemove(val trigger: Trigger) : Event() \ No newline at end of file diff --git a/plugins/automation/src/main/java/info/nightscout/automation/services/LastLocationDataContainer.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/services/LastLocationDataContainer.kt similarity index 85% rename from plugins/automation/src/main/java/info/nightscout/automation/services/LastLocationDataContainer.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/services/LastLocationDataContainer.kt index a5b65f3cf0..d79d7d0319 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/services/LastLocationDataContainer.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/services/LastLocationDataContainer.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.services +package app.aaps.plugins.automation.services import android.location.Location import app.aaps.annotations.OpenForTesting diff --git a/plugins/automation/src/main/java/info/nightscout/automation/services/LocationService.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/services/LocationService.kt similarity index 98% rename from plugins/automation/src/main/java/info/nightscout/automation/services/LocationService.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/services/LocationService.kt index 19e64fce09..5c754d2099 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/services/LocationService.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/services/LocationService.kt @@ -1,6 +1,6 @@ @file:Suppress("PrivatePropertyName") -package info.nightscout.automation.services +package app.aaps.plugins.automation.services import android.Manifest import android.app.Notification @@ -14,7 +14,6 @@ import android.os.Binder import android.os.Bundle import android.os.IBinder import androidx.core.app.ActivityCompat -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.notifications.NotificationHolder @@ -23,10 +22,11 @@ import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventAppExit import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.T +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.events.EventLocationChange import com.google.android.gms.location.LocationServices import dagger.android.DaggerService -import info.nightscout.automation.R -import info.nightscout.automation.events.EventLocationChange import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/services/LocationServiceHelper.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/services/LocationServiceHelper.kt similarity index 98% rename from plugins/automation/src/main/java/info/nightscout/automation/services/LocationServiceHelper.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/services/LocationServiceHelper.kt index f9113358d9..a9120e2b73 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/services/LocationServiceHelper.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/services/LocationServiceHelper.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.services +package app.aaps.plugins.automation.services import android.content.ComponentName import android.content.Context diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/Trigger.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/Trigger.kt similarity index 94% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/Trigger.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/Trigger.kt index 55840115a2..f2cd4a34cf 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/Trigger.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/Trigger.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.content.Context import android.content.ContextWrapper @@ -18,16 +18,16 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.dialogs.ChooseTriggerDialog +import app.aaps.plugins.automation.events.EventTriggerChanged +import app.aaps.plugins.automation.events.EventTriggerClone +import app.aaps.plugins.automation.events.EventTriggerRemove +import app.aaps.plugins.automation.services.LastLocationDataContainer import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.dialogs.ChooseTriggerDialog -import info.nightscout.automation.events.EventTriggerChanged -import info.nightscout.automation.events.EventTriggerClone -import info.nightscout.automation.events.EventTriggerRemove -import info.nightscout.automation.services.LastLocationDataContainer import info.nightscout.database.impl.AppRepository import org.json.JSONObject +import java.util.Optional import javax.inject.Inject abstract class Trigger(val injector: HasAndroidInjector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerAutosensValue.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerAutosensValue.kt similarity index 88% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerAutosensValue.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerAutosensValue.kt index 7ba02c9d1e..f49529494f 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerAutosensValue.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerAutosensValue.kt @@ -1,19 +1,19 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.widget.LinearLayout import app.aaps.core.interfaces.logging.LTag import app.aaps.core.utils.JsonHelper.safeGetDouble import app.aaps.core.utils.JsonHelper.safeGetString -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.Comparator +import app.aaps.plugins.automation.elements.InputDouble +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.elements.StaticLabel import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.Comparator -import info.nightscout.automation.elements.InputDouble -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.elements.StaticLabel import org.json.JSONObject import java.text.DecimalFormat +import java.util.Optional class TriggerAutosensValue(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBTDevice.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerBTDevice.kt similarity index 89% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBTDevice.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerBTDevice.kt index 865b634382..87a66fefa2 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBTDevice.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerBTDevice.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.Manifest import android.bluetooth.BluetoothManager @@ -11,15 +11,15 @@ import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.rx.events.EventBTChange import app.aaps.core.ui.toast.ToastUtils import app.aaps.core.utils.JsonHelper -import com.google.common.base.Optional +import app.aaps.plugins.automation.AutomationPlugin +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.ComparatorConnect +import app.aaps.plugins.automation.elements.InputDropdownMenu +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.elements.StaticLabel import dagger.android.HasAndroidInjector -import info.nightscout.automation.AutomationPlugin -import info.nightscout.automation.R -import info.nightscout.automation.elements.ComparatorConnect -import info.nightscout.automation.elements.InputDropdownMenu -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.elements.StaticLabel import org.json.JSONObject +import java.util.Optional import javax.inject.Inject class TriggerBTDevice(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBg.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerBg.kt similarity index 89% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBg.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerBg.kt index 3aa211ffdb..83d0a7c3a3 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBg.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerBg.kt @@ -1,18 +1,18 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.widget.LinearLayout import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.logging.LTag import app.aaps.core.utils.JsonHelper -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.Comparator +import app.aaps.plugins.automation.elements.InputBg +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.elements.StaticLabel import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.Comparator -import info.nightscout.automation.elements.InputBg -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.elements.StaticLabel import org.json.JSONObject +import java.util.Optional class TriggerBg(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBolusAgo.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerBolusAgo.kt similarity index 89% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBolusAgo.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerBolusAgo.kt index 7d3b244747..24bc8267af 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBolusAgo.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerBolusAgo.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.widget.LinearLayout import app.aaps.core.interfaces.logging.LTag @@ -6,15 +6,15 @@ import app.aaps.core.utils.JsonHelper import app.aaps.core.utils.JsonHelper.safeGetString import app.aaps.database.ValueWrapper import app.aaps.database.entities.Bolus -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.Comparator +import app.aaps.plugins.automation.elements.InputDuration +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.elements.StaticLabel import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.Comparator -import info.nightscout.automation.elements.InputDuration -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.elements.StaticLabel import org.json.JSONObject +import java.util.Optional class TriggerBolusAgo(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerCOB.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerCOB.kt similarity index 88% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerCOB.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerCOB.kt index 3d95afad9a..5e466f01ae 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerCOB.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerCOB.kt @@ -1,19 +1,19 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.widget.LinearLayout import app.aaps.core.interfaces.logging.LTag import app.aaps.core.utils.JsonHelper import app.aaps.core.utils.JsonHelper.safeGetDouble -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.Comparator +import app.aaps.plugins.automation.elements.InputDouble +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.elements.StaticLabel import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.Comparator -import info.nightscout.automation.elements.InputDouble -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.elements.StaticLabel import org.json.JSONObject import java.text.DecimalFormat +import java.util.Optional class TriggerCOB(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerConnector.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerConnector.kt similarity index 96% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerConnector.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerConnector.kt index 3a4652b651..f80d86271a 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerConnector.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerConnector.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.content.Context import android.graphics.Typeface @@ -11,12 +11,12 @@ import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.ui.elements.VerticalTextView import app.aaps.core.utils.JsonHelper.safeGetString -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.dialogs.ChooseOperationDialog import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.dialogs.ChooseOperationDialog import org.json.JSONArray import org.json.JSONObject +import java.util.Optional class TriggerConnector(injector: HasAndroidInjector) : Trigger(injector) { @@ -72,7 +72,7 @@ class TriggerConnector(injector: HasAndroidInjector) : Trigger(injector) { @Synchronized override fun shouldRun(): Boolean { var result = true // check first trigger - if (list.size > 0) result = list[0].shouldRun() + if (list.isNotEmpty()) result = list[0].shouldRun() // check all others for (i in 1 until list.size) { result = connectorType.apply(result, list[i].shouldRun()) @@ -114,7 +114,7 @@ class TriggerConnector(injector: HasAndroidInjector) : Trigger(injector) { return result.toString() } - override fun icon(): Optional = Optional.absent() + override fun icon(): Optional = Optional.empty() override fun duplicate(): Trigger = TriggerConnector(injector, connectorType) diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerDelta.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerDelta.kt similarity index 90% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerDelta.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerDelta.kt index a53e87b431..f507402e34 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerDelta.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerDelta.kt @@ -1,20 +1,20 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.widget.LinearLayout import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.logging.LTag import app.aaps.core.utils.JsonHelper -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.Comparator +import app.aaps.plugins.automation.elements.InputDelta +import app.aaps.plugins.automation.elements.InputDelta.DeltaType +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.elements.StaticLabel import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.Comparator -import info.nightscout.automation.elements.InputDelta -import info.nightscout.automation.elements.InputDelta.DeltaType -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.elements.StaticLabel import org.json.JSONObject import java.text.DecimalFormat +import java.util.Optional class TriggerDelta(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerDummy.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerDummy.kt similarity index 91% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerDummy.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerDummy.kt index 7fb05ae910..0bc688b3fa 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerDummy.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerDummy.kt @@ -1,8 +1,8 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers -import com.google.common.base.Optional import dagger.android.HasAndroidInjector import org.json.JSONObject +import java.util.Optional // Used for instantiation of other triggers only class TriggerDummy(injector: HasAndroidInjector, val shouldRun: Boolean = false) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerHeartRate.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerHeartRate.kt similarity index 88% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerHeartRate.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerHeartRate.kt index 68438e9068..8fb2071e51 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerHeartRate.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerHeartRate.kt @@ -1,19 +1,19 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.widget.LinearLayout import androidx.annotation.VisibleForTesting import app.aaps.core.interfaces.logging.LTag import app.aaps.core.utils.JsonHelper -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.Comparator +import app.aaps.plugins.automation.elements.InputDouble +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.elements.StaticLabel import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.Comparator -import info.nightscout.automation.elements.InputDouble -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.elements.StaticLabel import org.json.JSONObject import java.text.DecimalFormat +import java.util.Optional class TriggerHeartRate(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerIob.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerIob.kt similarity index 85% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerIob.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerIob.kt index 122f2ea599..db7a6555ee 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerIob.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerIob.kt @@ -1,17 +1,17 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.widget.LinearLayout import app.aaps.core.interfaces.logging.LTag import app.aaps.core.utils.JsonHelper -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.Comparator +import app.aaps.plugins.automation.elements.InputInsulin +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.elements.StaticLabel import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.Comparator -import info.nightscout.automation.elements.InputInsulin -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.elements.StaticLabel import org.json.JSONObject +import java.util.Optional class TriggerIob(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerLocation.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerLocation.kt similarity index 90% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerLocation.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerLocation.kt index 204375a4e7..9fd4312be3 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerLocation.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerLocation.kt @@ -1,21 +1,21 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.location.Location import android.widget.LinearLayout import app.aaps.core.interfaces.logging.LTag import app.aaps.core.utils.JsonHelper -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.InputButton +import app.aaps.plugins.automation.elements.InputDouble +import app.aaps.plugins.automation.elements.InputLocationMode +import app.aaps.plugins.automation.elements.InputString +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.elements.StaticLabel import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.InputButton -import info.nightscout.automation.elements.InputDouble -import info.nightscout.automation.elements.InputLocationMode -import info.nightscout.automation.elements.InputString -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.elements.StaticLabel import org.json.JSONObject import java.text.DecimalFormat +import java.util.Optional class TriggerLocation(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerProfilePercent.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerProfilePercent.kt similarity index 89% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerProfilePercent.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerProfilePercent.kt index 8bc6bb0489..d13dcc9c49 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerProfilePercent.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerProfilePercent.kt @@ -1,18 +1,18 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.widget.LinearLayout import app.aaps.core.interfaces.logging.LTag import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.utils.JsonHelper -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.Comparator +import app.aaps.plugins.automation.elements.InputPercent +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.elements.StaticLabel import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.Comparator -import info.nightscout.automation.elements.InputPercent -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.elements.StaticLabel import org.json.JSONObject +import java.util.Optional class TriggerProfilePercent(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerPumpLastConnection.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerPumpLastConnection.kt similarity index 89% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerPumpLastConnection.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerPumpLastConnection.kt index ed859a4f81..35fe1f5473 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerPumpLastConnection.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerPumpLastConnection.kt @@ -1,18 +1,18 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.widget.LinearLayout import app.aaps.core.interfaces.logging.LTag import app.aaps.core.utils.JsonHelper.safeGetInt import app.aaps.core.utils.JsonHelper.safeGetString -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.Comparator +import app.aaps.plugins.automation.elements.InputDuration +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.elements.StaticLabel import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.Comparator -import info.nightscout.automation.elements.InputDuration -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.elements.StaticLabel import org.json.JSONObject +import java.util.Optional class TriggerPumpLastConnection(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerRecurringTime.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerRecurringTime.kt similarity index 91% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerRecurringTime.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerRecurringTime.kt index d7de4ab8b7..a12086445b 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerRecurringTime.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerRecurringTime.kt @@ -1,4 +1,4 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.widget.LinearLayout import app.aaps.core.interfaces.logging.LTag @@ -6,16 +6,16 @@ import app.aaps.core.interfaces.utils.MidnightTime import app.aaps.core.ui.elements.WeekDay import app.aaps.core.utils.JsonHelper import app.aaps.core.utils.MidnightUtils -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.InputTime +import app.aaps.plugins.automation.elements.InputWeekDay +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.elements.StaticLabel import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.InputTime -import info.nightscout.automation.elements.InputWeekDay -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.elements.StaticLabel import org.json.JSONObject import java.util.Calendar import java.util.Objects +import java.util.Optional class TriggerRecurringTime(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTarget.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerTempTarget.kt similarity index 89% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTarget.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerTempTarget.kt index 71dd6429cc..7f24006a92 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTarget.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerTempTarget.kt @@ -1,16 +1,16 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.widget.LinearLayout import app.aaps.core.interfaces.logging.LTag import app.aaps.core.utils.JsonHelper import app.aaps.database.ValueWrapper -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.ComparatorExists +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.elements.StaticLabel import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.ComparatorExists -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.elements.StaticLabel import org.json.JSONObject +import java.util.Optional class TriggerTempTarget(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerTempTargetValue.kt similarity index 90% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerTempTargetValue.kt index 6ef316e9d4..4defa7c6eb 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerTempTargetValue.kt @@ -1,19 +1,19 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.widget.LinearLayout import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.logging.LTag import app.aaps.core.utils.JsonHelper import app.aaps.database.ValueWrapper -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.Comparator +import app.aaps.plugins.automation.elements.InputBg +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.elements.StaticLabel import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.Comparator -import info.nightscout.automation.elements.InputBg -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.elements.StaticLabel import org.json.JSONObject +import java.util.Optional class TriggerTempTargetValue(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTime.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerTime.kt similarity index 87% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTime.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerTime.kt index 4bd196bfcc..7dfb80e4bc 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTime.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerTime.kt @@ -1,16 +1,16 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.widget.LinearLayout import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.utils.T import app.aaps.core.utils.JsonHelper -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.InputDateTime +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.elements.StaticLabel import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.InputDateTime -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.elements.StaticLabel import org.json.JSONObject +import java.util.Optional class TriggerTime(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTimeRange.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerTimeRange.kt similarity index 90% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTimeRange.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerTimeRange.kt index 8df60ca761..0bd6e39f04 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTimeRange.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerTimeRange.kt @@ -1,17 +1,17 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.widget.LinearLayout import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.utils.MidnightTime import app.aaps.core.utils.JsonHelper.safeGetInt import app.aaps.core.utils.MidnightUtils -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.InputTimeRange +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.elements.StaticLabel import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.InputTimeRange -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.elements.StaticLabel import org.json.JSONObject +import java.util.Optional // Trigger for time range ( from 10:00AM till 13:00PM ) class TriggerTimeRange(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerWifiSsid.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerWifiSsid.kt similarity index 88% rename from plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerWifiSsid.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerWifiSsid.kt index df7730dd7a..c2e15f6514 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerWifiSsid.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/triggers/TriggerWifiSsid.kt @@ -1,18 +1,18 @@ -package info.nightscout.automation.triggers +package app.aaps.plugins.automation.triggers import android.widget.LinearLayout import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.receivers.ReceiverStatusStore import app.aaps.core.utils.JsonHelper -import com.google.common.base.Optional +import app.aaps.plugins.automation.R +import app.aaps.plugins.automation.elements.Comparator +import app.aaps.plugins.automation.elements.InputString +import app.aaps.plugins.automation.elements.LabelWithElement +import app.aaps.plugins.automation.elements.LayoutBuilder +import app.aaps.plugins.automation.elements.StaticLabel import dagger.android.HasAndroidInjector -import info.nightscout.automation.R -import info.nightscout.automation.elements.Comparator -import info.nightscout.automation.elements.InputString -import info.nightscout.automation.elements.LabelWithElement -import info.nightscout.automation.elements.LayoutBuilder -import info.nightscout.automation.elements.StaticLabel import org.json.JSONObject +import java.util.Optional import javax.inject.Inject class TriggerWifiSsid(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/ui/TimerUtil.kt b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/ui/TimerUtil.kt similarity index 92% rename from plugins/automation/src/main/java/info/nightscout/automation/ui/TimerUtil.kt rename to plugins/automation/src/main/kotlin/app/aaps/plugins/automation/ui/TimerUtil.kt index 5887b55a2f..fc43648f39 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/ui/TimerUtil.kt +++ b/plugins/automation/src/main/kotlin/app/aaps/plugins/automation/ui/TimerUtil.kt @@ -1,11 +1,11 @@ -package info.nightscout.automation.ui +package app.aaps.plugins.automation.ui import android.content.Context import android.content.Intent import android.provider.AlarmClock import app.aaps.annotations.OpenForTesting -import info.nightscout.automation.R import app.aaps.core.ui.toast.ToastUtils +import app.aaps.plugins.automation.R import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/automation/src/main/res/layout/automation_dialog_action.xml b/plugins/automation/src/main/res/layout/automation_dialog_action.xml index e6a5c7db91..41b1a62aae 100644 --- a/plugins/automation/src/main/res/layout/automation_dialog_action.xml +++ b/plugins/automation/src/main/res/layout/automation_dialog_action.xml @@ -6,7 +6,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:focusableInTouchMode="true" - tools:context="info.nightscout.automation.dialogs.EditActionDialog"> + tools:context=".dialogs.EditActionDialog"> + tools:context=".dialogs.EditEventDialog"> + tools:context=".dialogs.ChooseOperationDialog"> + tools:context=".dialogs.EditEventDialog"> + tools:context=".dialogs.EditEventDialog"> + tools:context=".dialogs.EditEventDialog"> + tools:context=".AutomationFragment">