From aa010a03b29389cdc178961f62df096b70bd1f35 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 25 Sep 2023 23:14:05 +0200 Subject: [PATCH 01/17] :implementation cleanup --- app/src/main/kotlin/app/aaps/MainApp.kt | 8 +-- .../app/aaps/activities/HistoryBrowserData.kt | 8 +-- .../aaps/activities/MyPreferenceFragment.kt | 4 +- .../main/kotlin/app/aaps/di/AppComponent.kt | 4 +- .../aaps/implementations/InstantiatorImpl.kt | 2 +- implementation/build.gradle | 2 +- .../alerts}/LocalAlertUtilsImpl.kt | 2 +- .../NotificationHolderImpl.kt | 2 +- .../aaps}/implementation/db/CompatDBHelper.kt | 2 +- .../implementation/db/PersistenceLayerImpl.kt | 2 +- .../implementation/di/CommandQueueModule.kt | 44 ++++++------ .../implementation/di/ImplementationModule.kt | 72 +++++++++---------- .../iob/GlucoseStatusProviderImpl.kt | 6 +- .../lifecycle/ProcessLifecycleListener.kt | 2 +- .../implementation/logging/LoggerUtilsImpl.kt | 2 +- .../logging}/UserEntryLoggerImpl.kt | 2 +- .../overview/OverviewDataImpl.kt | 2 +- .../implementation/plugin/PluginStore.kt | 2 +- .../profile}/DefaultValueHelperImpl.kt | 2 +- .../profile/ProfileFunctionImpl.kt | 2 +- .../profile/ProfileStoreObject.kt | 2 +- .../implementation/profile/ProfileUtilImpl.kt | 2 +- .../implementation/profiling/ProfilerImpl.kt | 2 +- .../protection/BiometricCheck.kt | 2 +- .../protection/PasswordCheckImpl.kt | 8 +-- .../protection/ProtectionCheckImpl.kt | 2 +- .../implementation/pump/BlePreCheckImpl.kt | 2 +- .../pump/DetailedBolusInfoStorageImpl.kt | 4 +- .../pump/PumpSyncImplementation.kt | 2 +- .../pump/TemporaryBasalStorageImpl.kt | 2 +- .../implementation/pump/WarnColorsImpl.kt | 2 +- .../queue/CommandQueueImplementation.kt | 44 ++++++------ .../aaps}/implementation/queue/QueueThread.kt | 2 +- .../queue/commands/CommandBolus.kt | 2 +- .../commands/CommandCancelExtendedBolus.kt | 2 +- .../queue/commands/CommandCancelTempBasal.kt | 2 +- .../queue/commands/CommandClearAlarms.kt | 2 +- .../queue/commands/CommandCustomCommand.kt | 2 +- .../queue/commands/CommandDeactivate.kt | 2 +- .../queue/commands/CommandExtendedBolus.kt | 2 +- .../CommandInsightSetTBROverNotification.kt | 2 +- .../queue/commands/CommandLoadEvents.kt | 2 +- .../queue/commands/CommandLoadHistory.kt | 2 +- .../queue/commands/CommandLoadTDDs.kt | 2 +- .../queue/commands/CommandReadStatus.kt | 2 +- .../queue/commands/CommandSMBBolus.kt | 2 +- .../queue/commands/CommandSetProfile.kt | 2 +- .../queue/commands/CommandSetUserSettings.kt | 2 +- .../queue/commands/CommandStartPump.kt | 2 +- .../queue/commands/CommandStopPump.kt | 2 +- .../commands/CommandTempBasalAbsolute.kt | 2 +- .../queue/commands/CommandTempBasalPercent.kt | 2 +- .../queue/commands/CommandUpdateTime.kt | 2 +- .../receivers/NetworkChangeReceiver.kt | 2 +- .../receivers/ReceiverStatusStoreImpl.kt | 2 +- .../resources/IconsProviderImplementation.kt | 4 +- .../resources/ResourceHelperImpl.kt | 4 +- .../stats/DexcomTirCalculatorImpl.kt | 2 +- .../implementation/stats/DexcomTirImpl.kt | 4 +- .../implementation/stats/TddCalculatorImpl.kt | 2 +- .../implementation/stats/TirCalculatorImpl.kt | 2 +- .../app/aaps}/implementation/stats/TirImpl.kt | 4 +- .../stats/TotalDailyDoseExtension.kt | 4 +- .../implementation/storage/FileStorage.kt | 2 +- .../UserEntryPresentationHelperImpl.kt | 2 +- .../utils/DecimalFormatterImpl.kt | 2 +- .../implementation/utils}/HardLimitsImpl.kt | 2 +- .../implementation/utils}/TranslatorImpl.kt | 2 +- .../utils}/TrendCalculatorImpl.kt | 2 +- .../implementation/iob/GlucoseStatusTest.kt | 2 +- .../overview/OverviewDataImplTest.kt | 2 +- .../profile/ProfileStoreTest.kt | 4 +- .../profile/ProfileUtilImplTest.kt | 4 +- .../pump/DetailedBolusInfoStorageTest.kt | 4 +- .../pump/TemporaryBasalStorageTest.kt | 2 +- .../queue/CommandQueueImplementationTest.kt | 12 ++-- .../implementation/queue/QueueThreadTest.kt | 6 +- .../utils/DecimalFormatterTest.kt | 2 +- .../implementation/wizard/BolusWizardTest.kt | 6 +- .../interfaces/pump/PumpEnactResultTest.kt | 4 +- .../automation/triggers/TriggerTestBase.kt | 2 +- .../constraints/ConstraintsCheckerImplTest.kt | 2 +- .../SmsCommunicatorPluginTest.kt | 2 +- .../nsclientV3/workers/LoadBgWorkerTest.kt | 2 +- .../omnipod/eros/OmnipodErosPumpPluginTest.kt | 2 +- .../aaps/shared/tests/TestBaseWithProfile.kt | 6 +- 86 files changed, 197 insertions(+), 197 deletions(-) rename implementation/src/main/{java/info/nightscout/implementation => kotlin/app/aaps/implementation/alerts}/LocalAlertUtilsImpl.kt (99%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/androidNotification/NotificationHolderImpl.kt (97%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/db/CompatDBHelper.kt (99%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/db/PersistenceLayerImpl.kt (98%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/di/CommandQueueModule.kt (57%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/di/ImplementationModule.kt (70%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/iob/GlucoseStatusProviderImpl.kt (99%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/lifecycle/ProcessLifecycleListener.kt (89%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/logging/LoggerUtilsImpl.kt (95%) rename implementation/src/main/{java/info/nightscout/implementation => kotlin/app/aaps/implementation/logging}/UserEntryLoggerImpl.kt (98%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/overview/OverviewDataImpl.kt (99%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/plugin/PluginStore.kt (99%) rename implementation/src/main/{java/info/nightscout/implementation => kotlin/app/aaps/implementation/profile}/DefaultValueHelperImpl.kt (99%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/profile/ProfileFunctionImpl.kt (99%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/profile/ProfileStoreObject.kt (98%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/profile/ProfileUtilImpl.kt (98%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/profiling/ProfilerImpl.kt (92%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/protection/BiometricCheck.kt (98%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/protection/PasswordCheckImpl.kt (99%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/protection/ProtectionCheckImpl.kt (99%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/pump/BlePreCheckImpl.kt (99%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/pump/DetailedBolusInfoStorageImpl.kt (97%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/pump/PumpSyncImplementation.kt (99%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/pump/TemporaryBasalStorageImpl.kt (98%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/pump/WarnColorsImpl.kt (97%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/CommandQueueImplementation.kt (94%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/QueueThread.kt (99%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandBolus.kt (97%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandCancelExtendedBolus.kt (95%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandCancelTempBasal.kt (95%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandClearAlarms.kt (95%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandCustomCommand.kt (95%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandDeactivate.kt (95%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandExtendedBolus.kt (96%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandInsightSetTBROverNotification.kt (95%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandLoadEvents.kt (97%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandLoadHistory.kt (96%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandLoadTDDs.kt (95%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandReadStatus.kt (96%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandSMBBolus.kt (97%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandSetProfile.kt (97%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandSetUserSettings.kt (97%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandStartPump.kt (95%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandStopPump.kt (95%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandTempBasalAbsolute.kt (96%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandTempBasalPercent.kt (96%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/commands/CommandUpdateTime.kt (95%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/receivers/NetworkChangeReceiver.kt (98%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/receivers/ReceiverStatusStoreImpl.kt (96%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/resources/IconsProviderImplementation.kt (91%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/resources/ResourceHelperImpl.kt (99%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/stats/DexcomTirCalculatorImpl.kt (97%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/stats/DexcomTirImpl.kt (99%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/stats/TddCalculatorImpl.kt (99%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/stats/TirCalculatorImpl.kt (99%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/stats/TirImpl.kt (98%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/stats/TotalDailyDoseExtension.kt (98%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/storage/FileStorage.kt (89%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/userEntry/UserEntryPresentationHelperImpl.kt (99%) rename implementation/src/main/{java/info/nightscout => kotlin/app/aaps}/implementation/utils/DecimalFormatterImpl.kt (97%) rename implementation/src/main/{java/info/nightscout/implementation => kotlin/app/aaps/implementation/utils}/HardLimitsImpl.kt (99%) rename implementation/src/main/{java/info/nightscout/implementation => kotlin/app/aaps/implementation/utils}/TranslatorImpl.kt (99%) rename implementation/src/main/{java/info/nightscout/implementation => kotlin/app/aaps/implementation/utils}/TrendCalculatorImpl.kt (99%) rename implementation/src/test/{java/info/nightscout => kotlin/app/aaps}/implementation/iob/GlucoseStatusTest.kt (99%) rename implementation/src/test/{java/info/nightscout => kotlin/app/aaps}/implementation/overview/OverviewDataImplTest.kt (98%) rename implementation/src/test/{java/info/nightscout => kotlin/app/aaps}/implementation/profile/ProfileStoreTest.kt (96%) rename implementation/src/test/{java/info/nightscout => kotlin/app/aaps}/implementation/profile/ProfileUtilImplTest.kt (95%) rename implementation/src/test/{java/info/nightscout => kotlin/app/aaps}/implementation/pump/DetailedBolusInfoStorageTest.kt (97%) rename implementation/src/test/{java/info/nightscout => kotlin/app/aaps}/implementation/pump/TemporaryBasalStorageTest.kt (98%) rename implementation/src/test/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/CommandQueueImplementationTest.kt (98%) rename implementation/src/test/{java/info/nightscout => kotlin/app/aaps}/implementation/queue/QueueThreadTest.kt (96%) rename implementation/src/test/{java/info/nightscout => kotlin/app/aaps}/implementation/utils/DecimalFormatterTest.kt (96%) rename implementation/src/test/{java/info/nightscout => kotlin/app/aaps}/implementation/wizard/BolusWizardTest.kt (98%) rename implementation/src/test/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/PumpEnactResultTest.kt (99%) diff --git a/app/src/main/kotlin/app/aaps/MainApp.kt b/app/src/main/kotlin/app/aaps/MainApp.kt index e1101296b6..7dc27770d2 100644 --- a/app/src/main/kotlin/app/aaps/MainApp.kt +++ b/app/src/main/kotlin/app/aaps/MainApp.kt @@ -31,6 +31,10 @@ import app.aaps.core.ui.locale.LocaleHelper import app.aaps.database.entities.TherapyEvent import app.aaps.database.entities.UserEntry import app.aaps.di.DaggerAppComponent +import app.aaps.implementation.db.CompatDBHelper +import app.aaps.implementation.lifecycle.ProcessLifecycleListener +import app.aaps.implementation.plugin.PluginStore +import app.aaps.implementation.receivers.NetworkChangeReceiver import app.aaps.receivers.BTReceiver import app.aaps.receivers.ChargingStateReceiver import app.aaps.receivers.KeepAliveWorker @@ -42,10 +46,6 @@ import info.nightscout.androidaps.R import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.database.impl.transactions.VersionChangeTransaction -import info.nightscout.implementation.db.CompatDBHelper -import info.nightscout.implementation.lifecycle.ProcessLifecycleListener -import info.nightscout.implementation.plugin.PluginStore -import info.nightscout.implementation.receivers.NetworkChangeReceiver import info.nightscout.plugins.aps.utils.StaticInjector import info.nightscout.plugins.general.overview.notifications.NotificationStore import info.nightscout.plugins.general.themes.ThemeSwitcherPlugin diff --git a/app/src/main/kotlin/app/aaps/activities/HistoryBrowserData.kt b/app/src/main/kotlin/app/aaps/activities/HistoryBrowserData.kt index b83662ae3f..ff4ec88c38 100644 --- a/app/src/main/kotlin/app/aaps/activities/HistoryBrowserData.kt +++ b/app/src/main/kotlin/app/aaps/activities/HistoryBrowserData.kt @@ -1,8 +1,5 @@ package app.aaps.activities -import app.aaps.core.main.graph.OverviewData -import app.aaps.core.main.utils.fabric.FabricPrivacy -import app.aaps.core.main.workflow.CalculationWorkflow import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.profile.DefaultValueHelper @@ -13,9 +10,12 @@ import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter +import app.aaps.core.main.graph.OverviewData +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.core.main.workflow.CalculationWorkflow +import app.aaps.implementation.overview.OverviewDataImpl import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.implementation.overview.OverviewDataImpl import info.nightscout.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt index e570fa2715..f47bf711f5 100644 --- a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt @@ -31,6 +31,8 @@ import app.aaps.core.interfaces.rx.events.EventPreferenceChange import app.aaps.core.interfaces.rx.events.EventRebuildTabs import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.SafeParse +import app.aaps.core.ui.dialogs.OKDialog +import app.aaps.implementation.plugin.PluginStore import dagger.android.support.AndroidSupportInjection import info.nightscout.androidaps.R import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin @@ -40,8 +42,6 @@ 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 app.aaps.core.ui.dialogs.OKDialog -import info.nightscout.implementation.plugin.PluginStore import info.nightscout.insulin.InsulinOrefFreePeakPlugin import info.nightscout.plugins.aps.loop.LoopPlugin import info.nightscout.plugins.aps.openAPSAMA.OpenAPSAMAPlugin diff --git a/app/src/main/kotlin/app/aaps/di/AppComponent.kt b/app/src/main/kotlin/app/aaps/di/AppComponent.kt index fc91e86655..9d6a7df1f7 100644 --- a/app/src/main/kotlin/app/aaps/di/AppComponent.kt +++ b/app/src/main/kotlin/app/aaps/di/AppComponent.kt @@ -3,6 +3,8 @@ package app.aaps.di import app.aaps.MainApp import app.aaps.configuration.di.ConfigurationModule import app.aaps.core.main.di.CoreModule +import app.aaps.core.validators.di.ValidatorsModule +import app.aaps.implementation.di.ImplementationModule import app.aaps.shared.impl.di.SharedImplModule import dagger.BindsInstance import dagger.Component @@ -17,9 +19,7 @@ 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 app.aaps.core.validators.di.ValidatorsModule import info.nightscout.database.impl.DatabaseModule -import info.nightscout.implementation.di.ImplementationModule import info.nightscout.insulin.di.InsulinModule import info.nightscout.plugins.aps.di.ApsModule import info.nightscout.plugins.constraints.di.PluginsConstraintsModule diff --git a/app/src/main/kotlin/app/aaps/implementations/InstantiatorImpl.kt b/app/src/main/kotlin/app/aaps/implementations/InstantiatorImpl.kt index 1eaa1401b7..5cb0a6ae97 100644 --- a/app/src/main/kotlin/app/aaps/implementations/InstantiatorImpl.kt +++ b/app/src/main/kotlin/app/aaps/implementations/InstantiatorImpl.kt @@ -5,9 +5,9 @@ import app.aaps.core.interfaces.aps.AutosensData import app.aaps.core.interfaces.objects.Instantiator import app.aaps.core.interfaces.profile.ProfileStore import app.aaps.core.interfaces.utils.DateUtil +import app.aaps.implementation.profile.ProfileStoreObject import dagger.Reusable import dagger.android.HasAndroidInjector -import info.nightscout.implementation.profile.ProfileStoreObject import info.nightscout.plugins.aps.APSResultObject import info.nightscout.plugins.iob.iobCobCalculator.data.AutosensDataObject import org.json.JSONObject diff --git a/implementation/build.gradle b/implementation/build.gradle index 224a629b69..ac3a14775f 100644 --- a/implementation/build.gradle +++ b/implementation/build.gradle @@ -11,7 +11,7 @@ apply from: "${project.rootDir}/core/main/test_dependencies.gradle" apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/main/jacoco_global.gradle" android { - namespace 'info.nightscout.implementation' + namespace 'app.aaps.implementation' } dependencies { diff --git a/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/alerts/LocalAlertUtilsImpl.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/alerts/LocalAlertUtilsImpl.kt index a0a093706d..54cae16e54 100644 --- a/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/alerts/LocalAlertUtilsImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation +package app.aaps.implementation.alerts import app.aaps.core.interfaces.alerts.LocalAlertUtils import app.aaps.core.interfaces.configuration.Config diff --git a/implementation/src/main/java/info/nightscout/implementation/androidNotification/NotificationHolderImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/androidNotification/NotificationHolderImpl.kt similarity index 97% rename from implementation/src/main/java/info/nightscout/implementation/androidNotification/NotificationHolderImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/androidNotification/NotificationHolderImpl.kt index 6154319395..ed304d824b 100644 --- a/implementation/src/main/java/info/nightscout/implementation/androidNotification/NotificationHolderImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/androidNotification/NotificationHolderImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.androidNotification +package app.aaps.implementation.androidNotification import android.app.Notification import android.app.NotificationChannel diff --git a/implementation/src/main/java/info/nightscout/implementation/db/CompatDBHelper.kt b/implementation/src/main/kotlin/app/aaps/implementation/db/CompatDBHelper.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/db/CompatDBHelper.kt rename to implementation/src/main/kotlin/app/aaps/implementation/db/CompatDBHelper.kt index d0cf4fefab..d27bcc4eca 100644 --- a/implementation/src/main/java/info/nightscout/implementation/db/CompatDBHelper.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/db/CompatDBHelper.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.db +package app.aaps.implementation.db import android.content.Context import app.aaps.core.interfaces.logging.AAPSLogger diff --git a/implementation/src/main/java/info/nightscout/implementation/db/PersistenceLayerImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/db/PersistenceLayerImpl.kt similarity index 98% rename from implementation/src/main/java/info/nightscout/implementation/db/PersistenceLayerImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/db/PersistenceLayerImpl.kt index bcd9739154..c52ea63442 100644 --- a/implementation/src/main/java/info/nightscout/implementation/db/PersistenceLayerImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/db/PersistenceLayerImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.db +package app.aaps.implementation.db import app.aaps.core.interfaces.db.PersistenceLayer import app.aaps.core.interfaces.logging.AAPSLogger diff --git a/implementation/src/main/java/info/nightscout/implementation/di/CommandQueueModule.kt b/implementation/src/main/kotlin/app/aaps/implementation/di/CommandQueueModule.kt similarity index 57% rename from implementation/src/main/java/info/nightscout/implementation/di/CommandQueueModule.kt rename to implementation/src/main/kotlin/app/aaps/implementation/di/CommandQueueModule.kt index 3c83defd4f..5e425b751d 100644 --- a/implementation/src/main/java/info/nightscout/implementation/di/CommandQueueModule.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/di/CommandQueueModule.kt @@ -1,28 +1,28 @@ -package info.nightscout.implementation.di +package app.aaps.implementation.di +import app.aaps.implementation.queue.CommandQueueImplementation +import app.aaps.implementation.queue.commands.CommandBolus +import app.aaps.implementation.queue.commands.CommandCancelExtendedBolus +import app.aaps.implementation.queue.commands.CommandCancelTempBasal +import app.aaps.implementation.queue.commands.CommandClearAlarms +import app.aaps.implementation.queue.commands.CommandCustomCommand +import app.aaps.implementation.queue.commands.CommandDeactivate +import app.aaps.implementation.queue.commands.CommandExtendedBolus +import app.aaps.implementation.queue.commands.CommandInsightSetTBROverNotification +import app.aaps.implementation.queue.commands.CommandLoadEvents +import app.aaps.implementation.queue.commands.CommandLoadHistory +import app.aaps.implementation.queue.commands.CommandLoadTDDs +import app.aaps.implementation.queue.commands.CommandReadStatus +import app.aaps.implementation.queue.commands.CommandSMBBolus +import app.aaps.implementation.queue.commands.CommandSetProfile +import app.aaps.implementation.queue.commands.CommandSetUserSettings +import app.aaps.implementation.queue.commands.CommandStartPump +import app.aaps.implementation.queue.commands.CommandStopPump +import app.aaps.implementation.queue.commands.CommandTempBasalAbsolute +import app.aaps.implementation.queue.commands.CommandTempBasalPercent +import app.aaps.implementation.queue.commands.CommandUpdateTime import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.implementation.queue.CommandQueueImplementation -import info.nightscout.implementation.queue.commands.CommandReadStatus -import info.nightscout.implementation.queue.commands.CommandSMBBolus -import info.nightscout.implementation.queue.commands.CommandSetProfile -import info.nightscout.implementation.queue.commands.CommandSetUserSettings -import info.nightscout.implementation.queue.commands.CommandStartPump -import info.nightscout.implementation.queue.commands.CommandStopPump -import info.nightscout.implementation.queue.commands.CommandTempBasalAbsolute -import info.nightscout.implementation.queue.commands.CommandTempBasalPercent -import info.nightscout.implementation.queue.commands.CommandBolus -import info.nightscout.implementation.queue.commands.CommandCancelExtendedBolus -import info.nightscout.implementation.queue.commands.CommandCancelTempBasal -import info.nightscout.implementation.queue.commands.CommandClearAlarms -import info.nightscout.implementation.queue.commands.CommandCustomCommand -import info.nightscout.implementation.queue.commands.CommandDeactivate -import info.nightscout.implementation.queue.commands.CommandExtendedBolus -import info.nightscout.implementation.queue.commands.CommandInsightSetTBROverNotification -import info.nightscout.implementation.queue.commands.CommandLoadEvents -import info.nightscout.implementation.queue.commands.CommandLoadHistory -import info.nightscout.implementation.queue.commands.CommandLoadTDDs -import info.nightscout.implementation.queue.commands.CommandUpdateTime @Module @Suppress("unused") diff --git a/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt b/implementation/src/main/kotlin/app/aaps/implementation/di/ImplementationModule.kt similarity index 70% rename from implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt rename to implementation/src/main/kotlin/app/aaps/implementation/di/ImplementationModule.kt index 23a0cd200e..d840ec985f 100644 --- a/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/di/ImplementationModule.kt @@ -1,6 +1,5 @@ -package info.nightscout.implementation.di +package app.aaps.implementation.di -import app.aaps.core.main.graph.OverviewData import app.aaps.core.interfaces.alerts.LocalAlertUtils import app.aaps.core.interfaces.db.PersistenceLayer import app.aaps.core.interfaces.iob.GlucoseStatusProvider @@ -32,43 +31,44 @@ import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.HardLimits import app.aaps.core.interfaces.utils.Translator import app.aaps.core.interfaces.utils.TrendCalculator +import app.aaps.core.main.graph.OverviewData +import app.aaps.implementation.alerts.LocalAlertUtilsImpl +import app.aaps.implementation.androidNotification.NotificationHolderImpl +import app.aaps.implementation.db.PersistenceLayerImpl +import app.aaps.implementation.iob.GlucoseStatusProviderImpl +import app.aaps.implementation.logging.LoggerUtilsImpl +import app.aaps.implementation.logging.UserEntryLoggerImpl +import app.aaps.implementation.overview.OverviewDataImpl +import app.aaps.implementation.plugin.PluginStore +import app.aaps.implementation.profile.DefaultValueHelperImpl +import app.aaps.implementation.profile.ProfileFunctionImpl +import app.aaps.implementation.profile.ProfileStoreObject +import app.aaps.implementation.profile.ProfileUtilImpl +import app.aaps.implementation.profiling.ProfilerImpl +import app.aaps.implementation.protection.PasswordCheckImpl +import app.aaps.implementation.protection.ProtectionCheckImpl +import app.aaps.implementation.pump.BlePreCheckImpl +import app.aaps.implementation.pump.DetailedBolusInfoStorageImpl +import app.aaps.implementation.pump.PumpSyncImplementation +import app.aaps.implementation.pump.TemporaryBasalStorageImpl +import app.aaps.implementation.pump.WarnColorsImpl +import app.aaps.implementation.queue.CommandQueueImplementation +import app.aaps.implementation.receivers.NetworkChangeReceiver +import app.aaps.implementation.receivers.ReceiverStatusStoreImpl +import app.aaps.implementation.resources.IconsProviderImplementation +import app.aaps.implementation.resources.ResourceHelperImpl +import app.aaps.implementation.stats.DexcomTirCalculatorImpl +import app.aaps.implementation.stats.TddCalculatorImpl +import app.aaps.implementation.stats.TirCalculatorImpl +import app.aaps.implementation.storage.FileStorage +import app.aaps.implementation.userEntry.UserEntryPresentationHelperImpl +import app.aaps.implementation.utils.DecimalFormatterImpl +import app.aaps.implementation.utils.HardLimitsImpl +import app.aaps.implementation.utils.TranslatorImpl +import app.aaps.implementation.utils.TrendCalculatorImpl import dagger.Binds import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.implementation.DefaultValueHelperImpl -import info.nightscout.implementation.HardLimitsImpl -import info.nightscout.implementation.LocalAlertUtilsImpl -import info.nightscout.implementation.TranslatorImpl -import info.nightscout.implementation.TrendCalculatorImpl -import info.nightscout.implementation.UserEntryLoggerImpl -import info.nightscout.implementation.androidNotification.NotificationHolderImpl -import info.nightscout.implementation.db.PersistenceLayerImpl -import info.nightscout.implementation.iob.GlucoseStatusProviderImpl -import info.nightscout.implementation.logging.LoggerUtilsImpl -import info.nightscout.implementation.overview.OverviewDataImpl -import info.nightscout.implementation.plugin.PluginStore -import info.nightscout.implementation.profile.ProfileFunctionImpl -import info.nightscout.implementation.profile.ProfileStoreObject -import info.nightscout.implementation.profile.ProfileUtilImpl -import info.nightscout.implementation.profiling.ProfilerImpl -import info.nightscout.implementation.protection.PasswordCheckImpl -import info.nightscout.implementation.protection.ProtectionCheckImpl -import info.nightscout.implementation.pump.BlePreCheckImpl -import info.nightscout.implementation.pump.DetailedBolusInfoStorageImpl -import info.nightscout.implementation.pump.PumpSyncImplementation -import info.nightscout.implementation.pump.TemporaryBasalStorageImpl -import info.nightscout.implementation.pump.WarnColorsImpl -import info.nightscout.implementation.queue.CommandQueueImplementation -import info.nightscout.implementation.receivers.NetworkChangeReceiver -import info.nightscout.implementation.receivers.ReceiverStatusStoreImpl -import info.nightscout.implementation.resources.IconsProviderImplementation -import info.nightscout.implementation.resources.ResourceHelperImpl -import info.nightscout.implementation.stats.DexcomTirCalculatorImpl -import info.nightscout.implementation.stats.TddCalculatorImpl -import info.nightscout.implementation.stats.TirCalculatorImpl -import info.nightscout.implementation.storage.FileStorage -import info.nightscout.implementation.userEntry.UserEntryPresentationHelperImpl -import info.nightscout.implementation.utils.DecimalFormatterImpl @Module( includes = [ diff --git a/implementation/src/main/java/info/nightscout/implementation/iob/GlucoseStatusProviderImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/iob/GlucoseStatusProviderImpl.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/iob/GlucoseStatusProviderImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/iob/GlucoseStatusProviderImpl.kt index 5eb3e4d4e5..77c8a5606a 100644 --- a/implementation/src/main/java/info/nightscout/implementation/iob/GlucoseStatusProviderImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/iob/GlucoseStatusProviderImpl.kt @@ -1,8 +1,6 @@ -package info.nightscout.implementation.iob +package app.aaps.implementation.iob import app.aaps.annotations.OpenForTesting -import app.aaps.core.main.iob.asRounded -import app.aaps.core.main.iob.log import app.aaps.core.interfaces.iob.GlucoseStatus import app.aaps.core.interfaces.iob.GlucoseStatusProvider import app.aaps.core.interfaces.iob.IobCobCalculator @@ -10,6 +8,8 @@ import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter +import app.aaps.core.main.iob.asRounded +import app.aaps.core.main.iob.log import dagger.Reusable import javax.inject.Inject import kotlin.math.roundToLong diff --git a/implementation/src/main/java/info/nightscout/implementation/lifecycle/ProcessLifecycleListener.kt b/implementation/src/main/kotlin/app/aaps/implementation/lifecycle/ProcessLifecycleListener.kt similarity index 89% rename from implementation/src/main/java/info/nightscout/implementation/lifecycle/ProcessLifecycleListener.kt rename to implementation/src/main/kotlin/app/aaps/implementation/lifecycle/ProcessLifecycleListener.kt index 0a6e71dc1b..b023c974f1 100644 --- a/implementation/src/main/java/info/nightscout/implementation/lifecycle/ProcessLifecycleListener.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/lifecycle/ProcessLifecycleListener.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.lifecycle +package app.aaps.implementation.lifecycle import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.LifecycleOwner diff --git a/implementation/src/main/java/info/nightscout/implementation/logging/LoggerUtilsImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/logging/LoggerUtilsImpl.kt similarity index 95% rename from implementation/src/main/java/info/nightscout/implementation/logging/LoggerUtilsImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/logging/LoggerUtilsImpl.kt index 50d42c823f..d53cd814fb 100644 --- a/implementation/src/main/java/info/nightscout/implementation/logging/LoggerUtilsImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/logging/LoggerUtilsImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.logging +package app.aaps.implementation.logging import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.logging.LoggerUtils diff --git a/implementation/src/main/java/info/nightscout/implementation/UserEntryLoggerImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/logging/UserEntryLoggerImpl.kt similarity index 98% rename from implementation/src/main/java/info/nightscout/implementation/UserEntryLoggerImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/logging/UserEntryLoggerImpl.kt index 83eedf6647..01de79653b 100644 --- a/implementation/src/main/java/info/nightscout/implementation/UserEntryLoggerImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/logging/UserEntryLoggerImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation +package app.aaps.implementation.logging import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.logging.AAPSLogger diff --git a/implementation/src/main/java/info/nightscout/implementation/overview/OverviewDataImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/overview/OverviewDataImpl.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/overview/OverviewDataImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/overview/OverviewDataImpl.kt index 8b4c40d9c7..35f65be2e6 100644 --- a/implementation/src/main/java/info/nightscout/implementation/overview/OverviewDataImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/overview/OverviewDataImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.overview +package app.aaps.implementation.overview import android.content.Context import androidx.annotation.AttrRes diff --git a/implementation/src/main/java/info/nightscout/implementation/plugin/PluginStore.kt b/implementation/src/main/kotlin/app/aaps/implementation/plugin/PluginStore.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/plugin/PluginStore.kt rename to implementation/src/main/kotlin/app/aaps/implementation/plugin/PluginStore.kt index 187f192969..7b4a97e7d7 100644 --- a/implementation/src/main/java/info/nightscout/implementation/plugin/PluginStore.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/plugin/PluginStore.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.plugin +package app.aaps.implementation.plugin import app.aaps.core.interfaces.aps.APS import app.aaps.core.interfaces.aps.Sensitivity diff --git a/implementation/src/main/java/info/nightscout/implementation/DefaultValueHelperImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/profile/DefaultValueHelperImpl.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/DefaultValueHelperImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/profile/DefaultValueHelperImpl.kt index 9ec45b093f..0ad91a518e 100644 --- a/implementation/src/main/java/info/nightscout/implementation/DefaultValueHelperImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/profile/DefaultValueHelperImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation +package app.aaps.implementation.profile import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.configuration.Constants diff --git a/implementation/src/main/java/info/nightscout/implementation/profile/ProfileFunctionImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/profile/ProfileFunctionImpl.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/profile/ProfileFunctionImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/profile/ProfileFunctionImpl.kt index f8070ab999..8aab6075cc 100644 --- a/implementation/src/main/java/info/nightscout/implementation/profile/ProfileFunctionImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/profile/ProfileFunctionImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.profile +package app.aaps.implementation.profile import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.db.GlucoseUnit diff --git a/implementation/src/main/java/info/nightscout/implementation/profile/ProfileStoreObject.kt b/implementation/src/main/kotlin/app/aaps/implementation/profile/ProfileStoreObject.kt similarity index 98% rename from implementation/src/main/java/info/nightscout/implementation/profile/ProfileStoreObject.kt rename to implementation/src/main/kotlin/app/aaps/implementation/profile/ProfileStoreObject.kt index 024d294138..a1c01d8f71 100644 --- a/implementation/src/main/java/info/nightscout/implementation/profile/ProfileStoreObject.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/profile/ProfileStoreObject.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.profile +package app.aaps.implementation.profile import androidx.collection.ArrayMap import app.aaps.core.interfaces.configuration.Config diff --git a/implementation/src/main/java/info/nightscout/implementation/profile/ProfileUtilImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/profile/ProfileUtilImpl.kt similarity index 98% rename from implementation/src/main/java/info/nightscout/implementation/profile/ProfileUtilImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/profile/ProfileUtilImpl.kt index 18476ffc1b..990af1515f 100644 --- a/implementation/src/main/java/info/nightscout/implementation/profile/ProfileUtilImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/profile/ProfileUtilImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.profile +package app.aaps.implementation.profile import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.profile.ProfileUtil diff --git a/implementation/src/main/java/info/nightscout/implementation/profiling/ProfilerImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/profiling/ProfilerImpl.kt similarity index 92% rename from implementation/src/main/java/info/nightscout/implementation/profiling/ProfilerImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/profiling/ProfilerImpl.kt index 3182a00154..609e879d9d 100644 --- a/implementation/src/main/java/info/nightscout/implementation/profiling/ProfilerImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/profiling/ProfilerImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.profiling +package app.aaps.implementation.profiling import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.logging.AAPSLogger diff --git a/implementation/src/main/java/info/nightscout/implementation/protection/BiometricCheck.kt b/implementation/src/main/kotlin/app/aaps/implementation/protection/BiometricCheck.kt similarity index 98% rename from implementation/src/main/java/info/nightscout/implementation/protection/BiometricCheck.kt rename to implementation/src/main/kotlin/app/aaps/implementation/protection/BiometricCheck.kt index b1623269ec..0a7f208904 100644 --- a/implementation/src/main/java/info/nightscout/implementation/protection/BiometricCheck.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/protection/BiometricCheck.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.protection +package app.aaps.implementation.protection import androidx.biometric.BiometricPrompt import androidx.biometric.BiometricPrompt.AuthenticationResult diff --git a/implementation/src/main/java/info/nightscout/implementation/protection/PasswordCheckImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/protection/PasswordCheckImpl.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/protection/PasswordCheckImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/protection/PasswordCheckImpl.kt index f9a9524f21..9874b556a0 100644 --- a/implementation/src/main/java/info/nightscout/implementation/protection/PasswordCheckImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/protection/PasswordCheckImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.protection +package app.aaps.implementation.protection import android.annotation.SuppressLint import android.content.Context @@ -11,13 +11,13 @@ import android.view.inputmethod.InputMethodManager import android.widget.EditText import android.widget.TextView import androidx.annotation.StringRes -import app.aaps.core.main.R -import app.aaps.core.main.utils.CryptoUtil import app.aaps.core.interfaces.protection.PasswordCheck import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.core.main.R +import app.aaps.core.main.utils.CryptoUtil +import app.aaps.core.ui.toast.ToastUtils import com.google.android.material.dialog.MaterialAlertDialogBuilder import dagger.Reusable -import app.aaps.core.ui.toast.ToastUtils import javax.inject.Inject @Reusable diff --git a/implementation/src/main/java/info/nightscout/implementation/protection/ProtectionCheckImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/protection/ProtectionCheckImpl.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/protection/ProtectionCheckImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/protection/ProtectionCheckImpl.kt index e4627da8df..89d753bdfe 100644 --- a/implementation/src/main/java/info/nightscout/implementation/protection/ProtectionCheckImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/protection/ProtectionCheckImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.protection +package app.aaps.implementation.protection import androidx.fragment.app.FragmentActivity import app.aaps.core.interfaces.protection.PasswordCheck diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/BlePreCheckImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/pump/BlePreCheckImpl.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/pump/BlePreCheckImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/pump/BlePreCheckImpl.kt index f61b53efb0..6d0177973f 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/BlePreCheckImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/pump/BlePreCheckImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.pump +package app.aaps.implementation.pump import android.Manifest import android.bluetooth.BluetoothManager diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/DetailedBolusInfoStorageImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/pump/DetailedBolusInfoStorageImpl.kt similarity index 97% rename from implementation/src/main/java/info/nightscout/implementation/pump/DetailedBolusInfoStorageImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/pump/DetailedBolusInfoStorageImpl.kt index 0b520d3eda..6b9bdccc67 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/DetailedBolusInfoStorageImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/pump/DetailedBolusInfoStorageImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.pump +package app.aaps.implementation.pump import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.logging.AAPSLogger @@ -8,9 +8,9 @@ import app.aaps.core.interfaces.pump.DetailedBolusInfoStorage import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.T +import app.aaps.implementation.R import com.google.gson.Gson import com.google.gson.reflect.TypeToken -import info.nightscout.implementation.R import javax.inject.Inject import javax.inject.Singleton import kotlin.math.abs diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt b/implementation/src/main/kotlin/app/aaps/implementation/pump/PumpSyncImplementation.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt rename to implementation/src/main/kotlin/app/aaps/implementation/pump/PumpSyncImplementation.kt index 974e4ab88f..f0e9b1ee8c 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/pump/PumpSyncImplementation.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.pump +package app.aaps.implementation.pump import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/TemporaryBasalStorageImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/pump/TemporaryBasalStorageImpl.kt similarity index 98% rename from implementation/src/main/java/info/nightscout/implementation/pump/TemporaryBasalStorageImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/pump/TemporaryBasalStorageImpl.kt index 769ef7ccc8..ff75ffd941 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/TemporaryBasalStorageImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/pump/TemporaryBasalStorageImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.pump +package app.aaps.implementation.pump import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.logging.AAPSLogger diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/WarnColorsImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/pump/WarnColorsImpl.kt similarity index 97% rename from implementation/src/main/java/info/nightscout/implementation/pump/WarnColorsImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/pump/WarnColorsImpl.kt index 469e9f4504..fab6ef2266 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/WarnColorsImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/pump/WarnColorsImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.pump +package app.aaps.implementation.pump import android.widget.TextView import app.aaps.core.interfaces.pump.WarnColors diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/CommandQueueImplementation.kt similarity index 94% rename from implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/CommandQueueImplementation.kt index ac0fdacc9f..7ddd2d8b73 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/CommandQueueImplementation.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue +package app.aaps.implementation.queue import android.content.Context import android.content.Intent @@ -48,29 +48,29 @@ import app.aaps.database.ValueWrapper import app.aaps.database.entities.EffectiveProfileSwitch import app.aaps.database.entities.ProfileSwitch import app.aaps.database.entities.interfaces.end +import app.aaps.implementation.R +import app.aaps.implementation.queue.commands.CommandBolus +import app.aaps.implementation.queue.commands.CommandCancelExtendedBolus +import app.aaps.implementation.queue.commands.CommandCancelTempBasal +import app.aaps.implementation.queue.commands.CommandClearAlarms +import app.aaps.implementation.queue.commands.CommandCustomCommand +import app.aaps.implementation.queue.commands.CommandDeactivate +import app.aaps.implementation.queue.commands.CommandExtendedBolus +import app.aaps.implementation.queue.commands.CommandInsightSetTBROverNotification +import app.aaps.implementation.queue.commands.CommandLoadEvents +import app.aaps.implementation.queue.commands.CommandLoadHistory +import app.aaps.implementation.queue.commands.CommandLoadTDDs +import app.aaps.implementation.queue.commands.CommandReadStatus +import app.aaps.implementation.queue.commands.CommandSMBBolus +import app.aaps.implementation.queue.commands.CommandSetProfile +import app.aaps.implementation.queue.commands.CommandSetUserSettings +import app.aaps.implementation.queue.commands.CommandStartPump +import app.aaps.implementation.queue.commands.CommandStopPump +import app.aaps.implementation.queue.commands.CommandTempBasalAbsolute +import app.aaps.implementation.queue.commands.CommandTempBasalPercent +import app.aaps.implementation.queue.commands.CommandUpdateTime import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.implementation.R -import info.nightscout.implementation.queue.commands.CommandBolus -import info.nightscout.implementation.queue.commands.CommandCancelExtendedBolus -import info.nightscout.implementation.queue.commands.CommandCancelTempBasal -import info.nightscout.implementation.queue.commands.CommandClearAlarms -import info.nightscout.implementation.queue.commands.CommandCustomCommand -import info.nightscout.implementation.queue.commands.CommandDeactivate -import info.nightscout.implementation.queue.commands.CommandExtendedBolus -import info.nightscout.implementation.queue.commands.CommandInsightSetTBROverNotification -import info.nightscout.implementation.queue.commands.CommandLoadEvents -import info.nightscout.implementation.queue.commands.CommandLoadHistory -import info.nightscout.implementation.queue.commands.CommandLoadTDDs -import info.nightscout.implementation.queue.commands.CommandReadStatus -import info.nightscout.implementation.queue.commands.CommandSMBBolus -import info.nightscout.implementation.queue.commands.CommandSetProfile -import info.nightscout.implementation.queue.commands.CommandSetUserSettings -import info.nightscout.implementation.queue.commands.CommandStartPump -import info.nightscout.implementation.queue.commands.CommandStopPump -import info.nightscout.implementation.queue.commands.CommandTempBasalAbsolute -import info.nightscout.implementation.queue.commands.CommandTempBasalPercent -import info.nightscout.implementation.queue.commands.CommandUpdateTime import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.LinkedList diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/QueueThread.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/QueueThread.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/queue/QueueThread.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/QueueThread.kt index 7317508a2f..46c5531285 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/QueueThread.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/QueueThread.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue +package app.aaps.implementation.queue import android.bluetooth.BluetoothManager import android.content.Context diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandBolus.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandBolus.kt similarity index 97% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandBolus.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandBolus.kt index 4e562518c7..38ff3d5247 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandBolus.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandBolus.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCancelExtendedBolus.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandCancelExtendedBolus.kt similarity index 95% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCancelExtendedBolus.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandCancelExtendedBolus.kt index d640bee195..5a0b9b7464 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCancelExtendedBolus.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandCancelExtendedBolus.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCancelTempBasal.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandCancelTempBasal.kt similarity index 95% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCancelTempBasal.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandCancelTempBasal.kt index 8264d0473a..f0e8bbc319 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCancelTempBasal.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandCancelTempBasal.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandClearAlarms.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandClearAlarms.kt similarity index 95% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandClearAlarms.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandClearAlarms.kt index 694f46f5a9..f4bf1b5572 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandClearAlarms.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandClearAlarms.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCustomCommand.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandCustomCommand.kt similarity index 95% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCustomCommand.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandCustomCommand.kt index d652f6e639..5089d35157 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCustomCommand.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandCustomCommand.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandDeactivate.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandDeactivate.kt similarity index 95% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandDeactivate.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandDeactivate.kt index da8c765ddc..903445c412 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandDeactivate.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandDeactivate.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandExtendedBolus.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandExtendedBolus.kt similarity index 96% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandExtendedBolus.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandExtendedBolus.kt index 76514b8615..f4d0edfbb0 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandExtendedBolus.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandExtendedBolus.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandInsightSetTBROverNotification.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandInsightSetTBROverNotification.kt similarity index 95% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandInsightSetTBROverNotification.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandInsightSetTBROverNotification.kt index 639e5b7ab4..2e2dc4064b 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandInsightSetTBROverNotification.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandInsightSetTBROverNotification.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadEvents.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandLoadEvents.kt similarity index 97% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadEvents.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandLoadEvents.kt index 0bce6ebd2c..1da1b17270 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadEvents.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandLoadEvents.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadHistory.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandLoadHistory.kt similarity index 96% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadHistory.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandLoadHistory.kt index 7bae4164df..aff9c7f55d 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadHistory.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandLoadHistory.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadTDDs.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandLoadTDDs.kt similarity index 95% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadTDDs.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandLoadTDDs.kt index fd501c6e6c..7672e12c2d 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadTDDs.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandLoadTDDs.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandReadStatus.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandReadStatus.kt similarity index 96% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandReadStatus.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandReadStatus.kt index 1b66f215ed..d0665c45ad 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandReadStatus.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandReadStatus.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.alerts.LocalAlertUtils import app.aaps.core.interfaces.logging.LTag diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandSMBBolus.kt similarity index 97% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandSMBBolus.kt index 8504c46074..f271ec279d 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandSMBBolus.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandSetProfile.kt similarity index 97% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandSetProfile.kt index 3dc7688039..9a58634722 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandSetProfile.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.logging.LTag diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetUserSettings.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandSetUserSettings.kt similarity index 97% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetUserSettings.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandSetUserSettings.kt index 15fc652546..3d8dec7f25 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetUserSettings.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandSetUserSettings.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStartPump.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandStartPump.kt similarity index 95% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStartPump.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandStartPump.kt index 22308f899f..4dca1c605d 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStartPump.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandStartPump.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStopPump.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandStopPump.kt similarity index 95% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStopPump.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandStopPump.kt index 7a012ccdbb..f4479bb263 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStopPump.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandStopPump.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalAbsolute.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandTempBasalAbsolute.kt similarity index 96% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalAbsolute.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandTempBasalAbsolute.kt index b0691eefc7..6a137db06a 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalAbsolute.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandTempBasalAbsolute.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalPercent.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandTempBasalPercent.kt similarity index 96% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalPercent.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandTempBasalPercent.kt index 2541160fca..9e7ac24e00 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalPercent.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandTempBasalPercent.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandUpdateTime.kt b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandUpdateTime.kt similarity index 95% rename from implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandUpdateTime.kt rename to implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandUpdateTime.kt index d4b5af8726..2dd8e6b8a1 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandUpdateTime.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/queue/commands/CommandUpdateTime.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue.commands +package app.aaps.implementation.queue.commands import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/receivers/NetworkChangeReceiver.kt b/implementation/src/main/kotlin/app/aaps/implementation/receivers/NetworkChangeReceiver.kt similarity index 98% rename from implementation/src/main/java/info/nightscout/implementation/receivers/NetworkChangeReceiver.kt rename to implementation/src/main/kotlin/app/aaps/implementation/receivers/NetworkChangeReceiver.kt index 7be2ca397b..061071223b 100644 --- a/implementation/src/main/java/info/nightscout/implementation/receivers/NetworkChangeReceiver.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/receivers/NetworkChangeReceiver.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.receivers +package app.aaps.implementation.receivers import android.content.Context import android.content.Intent diff --git a/implementation/src/main/java/info/nightscout/implementation/receivers/ReceiverStatusStoreImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/receivers/ReceiverStatusStoreImpl.kt similarity index 96% rename from implementation/src/main/java/info/nightscout/implementation/receivers/ReceiverStatusStoreImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/receivers/ReceiverStatusStoreImpl.kt index d41862ea7c..c339951d89 100644 --- a/implementation/src/main/java/info/nightscout/implementation/receivers/ReceiverStatusStoreImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/receivers/ReceiverStatusStoreImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.receivers +package app.aaps.implementation.receivers import android.content.Context import android.content.Intent diff --git a/implementation/src/main/java/info/nightscout/implementation/resources/IconsProviderImplementation.kt b/implementation/src/main/kotlin/app/aaps/implementation/resources/IconsProviderImplementation.kt similarity index 91% rename from implementation/src/main/java/info/nightscout/implementation/resources/IconsProviderImplementation.kt rename to implementation/src/main/kotlin/app/aaps/implementation/resources/IconsProviderImplementation.kt index 35bf03d050..1af83d578e 100644 --- a/implementation/src/main/java/info/nightscout/implementation/resources/IconsProviderImplementation.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/resources/IconsProviderImplementation.kt @@ -1,8 +1,8 @@ -package info.nightscout.implementation.resources +package app.aaps.implementation.resources import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.ui.IconsProvider -import info.nightscout.implementation.R +import app.aaps.implementation.R import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/resources/ResourceHelperImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/resources/ResourceHelperImpl.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/resources/ResourceHelperImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/resources/ResourceHelperImpl.kt index ee20b6d45d..06315632f6 100644 --- a/implementation/src/main/java/info/nightscout/implementation/resources/ResourceHelperImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/resources/ResourceHelperImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.resources +package app.aaps.implementation.resources import android.annotation.SuppressLint import android.content.Context @@ -18,8 +18,8 @@ import androidx.annotation.StringRes import androidx.appcompat.app.AppCompatDelegate import androidx.appcompat.view.ContextThemeWrapper import androidx.core.content.ContextCompat -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.resources.ResourceHelper +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.getThemeColor import app.aaps.core.ui.locale.LocaleHelper import java.util.Locale diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirCalculatorImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/stats/DexcomTirCalculatorImpl.kt similarity index 97% rename from implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirCalculatorImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/stats/DexcomTirCalculatorImpl.kt index 0046f46d3f..a77ce3d282 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirCalculatorImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/stats/DexcomTirCalculatorImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.stats +package app.aaps.implementation.stats import android.annotation.SuppressLint import android.content.Context diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/stats/DexcomTirImpl.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/stats/DexcomTirImpl.kt index f1364d59b7..02a2c2dd0d 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/stats/DexcomTirImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.stats +package app.aaps.implementation.stats import android.annotation.SuppressLint import android.content.Context @@ -9,7 +9,7 @@ import android.widget.TextView import app.aaps.core.interfaces.configuration.Constants import app.aaps.core.interfaces.profile.ProfileUtil import app.aaps.core.interfaces.stats.DexcomTIR -import info.nightscout.implementation.R +import app.aaps.implementation.R import java.util.Calendar import kotlin.math.pow import kotlin.math.roundToInt diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/stats/TddCalculatorImpl.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/stats/TddCalculatorImpl.kt index 1455634531..fa4e52e27a 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/stats/TddCalculatorImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.stats +package app.aaps.implementation.stats import android.content.Context import android.graphics.Typeface diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/stats/TirCalculatorImpl.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/stats/TirCalculatorImpl.kt index 71a4bbae65..e2087199dc 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/stats/TirCalculatorImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.stats +package app.aaps.implementation.stats import android.annotation.SuppressLint import android.content.Context diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/TirImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/stats/TirImpl.kt similarity index 98% rename from implementation/src/main/java/info/nightscout/implementation/stats/TirImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/stats/TirImpl.kt index 78396e9c6e..d8938c8912 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/TirImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/stats/TirImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.stats +package app.aaps.implementation.stats import android.annotation.SuppressLint import android.content.Context @@ -8,7 +8,7 @@ import android.widget.TextView import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.stats.TIR import app.aaps.core.interfaces.utils.DateUtil -import info.nightscout.implementation.R +import app.aaps.implementation.R class TirImpl(override val date: Long, override val lowThreshold: Double, override val highThreshold: Double) : TIR { diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/TotalDailyDoseExtension.kt b/implementation/src/main/kotlin/app/aaps/implementation/stats/TotalDailyDoseExtension.kt similarity index 98% rename from implementation/src/main/java/info/nightscout/implementation/stats/TotalDailyDoseExtension.kt rename to implementation/src/main/kotlin/app/aaps/implementation/stats/TotalDailyDoseExtension.kt index 6b97d2056b..afc55c4ba4 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/TotalDailyDoseExtension.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/stats/TotalDailyDoseExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.stats +package app.aaps.implementation.stats import android.annotation.SuppressLint import android.content.Context @@ -8,7 +8,7 @@ import android.widget.TextView import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.DateUtil import app.aaps.database.entities.TotalDailyDose -import info.nightscout.implementation.R +import app.aaps.implementation.R val TotalDailyDose.total get() = if (totalAmount > 0) totalAmount else basalAmount + bolusAmount diff --git a/implementation/src/main/java/info/nightscout/implementation/storage/FileStorage.kt b/implementation/src/main/kotlin/app/aaps/implementation/storage/FileStorage.kt similarity index 89% rename from implementation/src/main/java/info/nightscout/implementation/storage/FileStorage.kt rename to implementation/src/main/kotlin/app/aaps/implementation/storage/FileStorage.kt index da38622bb0..0270b59c69 100644 --- a/implementation/src/main/java/info/nightscout/implementation/storage/FileStorage.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/storage/FileStorage.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.storage +package app.aaps.implementation.storage import app.aaps.core.interfaces.storage.Storage import java.io.File diff --git a/implementation/src/main/java/info/nightscout/implementation/userEntry/UserEntryPresentationHelperImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/userEntry/UserEntryPresentationHelperImpl.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/userEntry/UserEntryPresentationHelperImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/userEntry/UserEntryPresentationHelperImpl.kt index 09f4be2d0b..46b4ca5f74 100644 --- a/implementation/src/main/java/info/nightscout/implementation/userEntry/UserEntryPresentationHelperImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/userEntry/UserEntryPresentationHelperImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.userEntry +package app.aaps.implementation.userEntry import android.text.Spanned import app.aaps.core.interfaces.configuration.Constants diff --git a/implementation/src/main/java/info/nightscout/implementation/utils/DecimalFormatterImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/utils/DecimalFormatterImpl.kt similarity index 97% rename from implementation/src/main/java/info/nightscout/implementation/utils/DecimalFormatterImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/utils/DecimalFormatterImpl.kt index 1767b505fc..325792feaa 100644 --- a/implementation/src/main/java/info/nightscout/implementation/utils/DecimalFormatterImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/utils/DecimalFormatterImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.utils +package app.aaps.implementation.utils import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.DecimalFormatter diff --git a/implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/utils/HardLimitsImpl.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/utils/HardLimitsImpl.kt index 76ba181b9f..e514c94e75 100644 --- a/implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/utils/HardLimitsImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation +package app.aaps.implementation.utils import android.content.Context import app.aaps.annotations.OpenForTesting diff --git a/implementation/src/main/java/info/nightscout/implementation/TranslatorImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/utils/TranslatorImpl.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/TranslatorImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/utils/TranslatorImpl.kt index 3d83c7cc83..5c2ef141b3 100644 --- a/implementation/src/main/java/info/nightscout/implementation/TranslatorImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/utils/TranslatorImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation +package app.aaps.implementation.utils import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.Translator diff --git a/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt b/implementation/src/main/kotlin/app/aaps/implementation/utils/TrendCalculatorImpl.kt similarity index 99% rename from implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt rename to implementation/src/main/kotlin/app/aaps/implementation/utils/TrendCalculatorImpl.kt index 7e99e1fba9..25e652b30b 100644 --- a/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt +++ b/implementation/src/main/kotlin/app/aaps/implementation/utils/TrendCalculatorImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation +package app.aaps.implementation.utils import app.aaps.core.interfaces.aps.AutosensDataStore import app.aaps.core.interfaces.iob.InMemoryGlucoseValue diff --git a/implementation/src/test/java/info/nightscout/implementation/iob/GlucoseStatusTest.kt b/implementation/src/test/kotlin/app/aaps/implementation/iob/GlucoseStatusTest.kt similarity index 99% rename from implementation/src/test/java/info/nightscout/implementation/iob/GlucoseStatusTest.kt rename to implementation/src/test/kotlin/app/aaps/implementation/iob/GlucoseStatusTest.kt index 4620e4560d..62a87b1544 100644 --- a/implementation/src/test/java/info/nightscout/implementation/iob/GlucoseStatusTest.kt +++ b/implementation/src/test/kotlin/app/aaps/implementation/iob/GlucoseStatusTest.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.iob +package app.aaps.implementation.iob import app.aaps.core.interfaces.aps.AutosensDataStore import app.aaps.core.interfaces.iob.GlucoseStatus diff --git a/implementation/src/test/java/info/nightscout/implementation/overview/OverviewDataImplTest.kt b/implementation/src/test/kotlin/app/aaps/implementation/overview/OverviewDataImplTest.kt similarity index 98% rename from implementation/src/test/java/info/nightscout/implementation/overview/OverviewDataImplTest.kt rename to implementation/src/test/kotlin/app/aaps/implementation/overview/OverviewDataImplTest.kt index 9754b90432..dc36c27bd9 100644 --- a/implementation/src/test/java/info/nightscout/implementation/overview/OverviewDataImplTest.kt +++ b/implementation/src/test/kotlin/app/aaps/implementation/overview/OverviewDataImplTest.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.overview +package app.aaps.implementation.overview import app.aaps.core.interfaces.aps.AutosensDataStore import app.aaps.core.interfaces.db.GlucoseUnit diff --git a/implementation/src/test/java/info/nightscout/implementation/profile/ProfileStoreTest.kt b/implementation/src/test/kotlin/app/aaps/implementation/profile/ProfileStoreTest.kt similarity index 96% rename from implementation/src/test/java/info/nightscout/implementation/profile/ProfileStoreTest.kt rename to implementation/src/test/kotlin/app/aaps/implementation/profile/ProfileStoreTest.kt index a0444dadf0..b5dda1cae2 100644 --- a/implementation/src/test/java/info/nightscout/implementation/profile/ProfileStoreTest.kt +++ b/implementation/src/test/kotlin/app/aaps/implementation/profile/ProfileStoreTest.kt @@ -1,10 +1,10 @@ -package info.nightscout.implementation.profile +package app.aaps.implementation.profile import app.aaps.core.interfaces.profile.PureProfile import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat -import kotlin.test.assertIs import org.junit.jupiter.api.Test +import kotlin.test.assertIs internal class ProfileStoreTest : TestBaseWithProfile() { diff --git a/implementation/src/test/java/info/nightscout/implementation/profile/ProfileUtilImplTest.kt b/implementation/src/test/kotlin/app/aaps/implementation/profile/ProfileUtilImplTest.kt similarity index 95% rename from implementation/src/test/java/info/nightscout/implementation/profile/ProfileUtilImplTest.kt rename to implementation/src/test/kotlin/app/aaps/implementation/profile/ProfileUtilImplTest.kt index 3900f4c8dd..886c6bfcb3 100644 --- a/implementation/src/test/java/info/nightscout/implementation/profile/ProfileUtilImplTest.kt +++ b/implementation/src/test/kotlin/app/aaps/implementation/profile/ProfileUtilImplTest.kt @@ -1,12 +1,12 @@ -package info.nightscout.implementation.profile +package app.aaps.implementation.profile import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.database.entities.GlucoseValue +import app.aaps.implementation.utils.DecimalFormatterImpl import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat -import info.nightscout.implementation.utils.DecimalFormatterImpl import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/implementation/src/test/java/info/nightscout/implementation/pump/DetailedBolusInfoStorageTest.kt b/implementation/src/test/kotlin/app/aaps/implementation/pump/DetailedBolusInfoStorageTest.kt similarity index 97% rename from implementation/src/test/java/info/nightscout/implementation/pump/DetailedBolusInfoStorageTest.kt rename to implementation/src/test/kotlin/app/aaps/implementation/pump/DetailedBolusInfoStorageTest.kt index 01ceca4a8f..6d49756754 100644 --- a/implementation/src/test/java/info/nightscout/implementation/pump/DetailedBolusInfoStorageTest.kt +++ b/implementation/src/test/kotlin/app/aaps/implementation/pump/DetailedBolusInfoStorageTest.kt @@ -1,11 +1,11 @@ -package info.nightscout.implementation.pump +package app.aaps.implementation.pump import app.aaps.core.interfaces.pump.DetailedBolusInfo import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.implementation.R import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat -import info.nightscout.implementation.R import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/implementation/src/test/java/info/nightscout/implementation/pump/TemporaryBasalStorageTest.kt b/implementation/src/test/kotlin/app/aaps/implementation/pump/TemporaryBasalStorageTest.kt similarity index 98% rename from implementation/src/test/java/info/nightscout/implementation/pump/TemporaryBasalStorageTest.kt rename to implementation/src/test/kotlin/app/aaps/implementation/pump/TemporaryBasalStorageTest.kt index 660cda54da..ef82c24237 100644 --- a/implementation/src/test/java/info/nightscout/implementation/pump/TemporaryBasalStorageTest.kt +++ b/implementation/src/test/kotlin/app/aaps/implementation/pump/TemporaryBasalStorageTest.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.pump +package app.aaps.implementation.pump import app.aaps.core.interfaces.pump.PumpSync import app.aaps.shared.tests.TestBase diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt b/implementation/src/test/kotlin/app/aaps/implementation/queue/CommandQueueImplementationTest.kt similarity index 98% rename from implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt rename to implementation/src/test/kotlin/app/aaps/implementation/queue/CommandQueueImplementationTest.kt index 3ca25cffc6..0b5393f98c 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt +++ b/implementation/src/test/kotlin/app/aaps/implementation/queue/CommandQueueImplementationTest.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.queue +package app.aaps.implementation.queue import android.content.Context import android.os.Handler @@ -27,17 +27,17 @@ import app.aaps.core.main.constraints.ConstraintObject import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.database.ValueWrapper import app.aaps.database.entities.Bolus +import app.aaps.implementation.queue.commands.CommandBolus +import app.aaps.implementation.queue.commands.CommandCustomCommand +import app.aaps.implementation.queue.commands.CommandExtendedBolus +import app.aaps.implementation.queue.commands.CommandLoadHistory +import app.aaps.implementation.queue.commands.CommandTempBasalPercent import app.aaps.shared.tests.TestBaseWithProfile import app.aaps.shared.tests.TestPumpPlugin import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.implementation.queue.commands.CommandBolus -import info.nightscout.implementation.queue.commands.CommandCustomCommand -import info.nightscout.implementation.queue.commands.CommandExtendedBolus -import info.nightscout.implementation.queue.commands.CommandLoadHistory -import info.nightscout.implementation.queue.commands.CommandTempBasalPercent import io.reactivex.rxjava3.core.Single import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt b/implementation/src/test/kotlin/app/aaps/implementation/queue/QueueThreadTest.kt similarity index 96% rename from implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt rename to implementation/src/test/kotlin/app/aaps/implementation/queue/QueueThreadTest.kt index f977e6236d..7b3ba7b307 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt +++ b/implementation/src/test/kotlin/app/aaps/implementation/queue/QueueThreadTest.kt @@ -1,8 +1,7 @@ -package info.nightscout.implementation.queue +package app.aaps.implementation.queue import android.content.Context import android.os.PowerManager -import app.aaps.core.main.constraints.ConstraintObject import app.aaps.core.interfaces.androidPermissions.AndroidPermission import app.aaps.core.interfaces.constraints.ConstraintsChecker import app.aaps.core.interfaces.db.PersistenceLayer @@ -10,13 +9,14 @@ import app.aaps.core.interfaces.pump.PumpSync import app.aaps.core.interfaces.pump.defs.PumpDescription import app.aaps.core.interfaces.queue.Command import app.aaps.core.interfaces.ui.UiInteraction +import app.aaps.core.main.constraints.ConstraintObject +import app.aaps.implementation.queue.commands.CommandTempBasalAbsolute import app.aaps.shared.tests.TestBaseWithProfile import app.aaps.shared.tests.TestPumpPlugin import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.implementation.queue.commands.CommandTempBasalAbsolute import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.ArgumentMatchers diff --git a/implementation/src/test/java/info/nightscout/implementation/utils/DecimalFormatterTest.kt b/implementation/src/test/kotlin/app/aaps/implementation/utils/DecimalFormatterTest.kt similarity index 96% rename from implementation/src/test/java/info/nightscout/implementation/utils/DecimalFormatterTest.kt rename to implementation/src/test/kotlin/app/aaps/implementation/utils/DecimalFormatterTest.kt index 29ead4228c..a1bd974b98 100644 --- a/implementation/src/test/java/info/nightscout/implementation/utils/DecimalFormatterTest.kt +++ b/implementation/src/test/kotlin/app/aaps/implementation/utils/DecimalFormatterTest.kt @@ -1,4 +1,4 @@ -package info.nightscout.implementation.utils +package app.aaps.implementation.utils import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.utils.DecimalFormatter diff --git a/implementation/src/test/java/info/nightscout/implementation/wizard/BolusWizardTest.kt b/implementation/src/test/kotlin/app/aaps/implementation/wizard/BolusWizardTest.kt similarity index 98% rename from implementation/src/test/java/info/nightscout/implementation/wizard/BolusWizardTest.kt rename to implementation/src/test/kotlin/app/aaps/implementation/wizard/BolusWizardTest.kt index daff11c509..6c4497bfe9 100644 --- a/implementation/src/test/java/info/nightscout/implementation/wizard/BolusWizardTest.kt +++ b/implementation/src/test/kotlin/app/aaps/implementation/wizard/BolusWizardTest.kt @@ -1,6 +1,5 @@ -package info.nightscout.implementation.wizard +package app.aaps.implementation.wizard -import app.aaps.core.main.wizard.BolusWizard import app.aaps.core.interfaces.aps.AutosensDataStore import app.aaps.core.interfaces.aps.Loop import app.aaps.core.interfaces.constraints.Constraint @@ -9,11 +8,12 @@ import app.aaps.core.interfaces.iob.IobTotal import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.pump.defs.PumpDescription import app.aaps.core.interfaces.queue.CommandQueue +import app.aaps.core.main.wizard.BolusWizard +import app.aaps.implementation.iob.GlucoseStatusProviderImpl import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.implementation.iob.GlucoseStatusProviderImpl import org.junit.jupiter.api.Test import org.mockito.Mock import org.mockito.Mockito diff --git a/implementation/src/test/java/info/nightscout/interfaces/pump/PumpEnactResultTest.kt b/implementation/src/test/kotlin/app/aaps/interfaces/pump/PumpEnactResultTest.kt similarity index 99% rename from implementation/src/test/java/info/nightscout/interfaces/pump/PumpEnactResultTest.kt rename to implementation/src/test/kotlin/app/aaps/interfaces/pump/PumpEnactResultTest.kt index 99aa320dc3..4f28d3d573 100644 --- a/implementation/src/test/java/info/nightscout/interfaces/pump/PumpEnactResultTest.kt +++ b/implementation/src/test/kotlin/app/aaps/interfaces/pump/PumpEnactResultTest.kt @@ -1,7 +1,7 @@ -package info.nightscout.interfaces.pump +package app.aaps.interfaces.pump -import app.aaps.core.main.pump.toHtml import app.aaps.core.interfaces.pump.PumpEnactResult +import app.aaps.core.main.pump.toHtml import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector diff --git a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTestBase.kt b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTestBase.kt index 114437959a..cd5c219b5b 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTestBase.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTestBase.kt @@ -2,13 +2,13 @@ package info.nightscout.automation.triggers import app.aaps.core.interfaces.aps.AutosensDataStore import app.aaps.core.interfaces.receivers.ReceiverStatusStore +import app.aaps.implementation.iob.GlucoseStatusProviderImpl import app.aaps.shared.tests.TestBaseWithProfile import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.automation.AutomationPlugin import info.nightscout.automation.services.LastLocationDataContainer import info.nightscout.database.impl.AppRepository -import info.nightscout.implementation.iob.GlucoseStatusProviderImpl import org.junit.jupiter.api.BeforeEach import org.mockito.Mock import org.mockito.Mockito.`when` diff --git a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/ConstraintsCheckerImplTest.kt b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/ConstraintsCheckerImplTest.kt index 81ff45315f..bc2aa4e9bd 100644 --- a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/ConstraintsCheckerImplTest.kt +++ b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/ConstraintsCheckerImplTest.kt @@ -17,6 +17,7 @@ import app.aaps.core.interfaces.pump.defs.PumpDescription import app.aaps.core.interfaces.queue.CommandQueue import app.aaps.core.interfaces.stats.TddCalculator import app.aaps.core.interfaces.ui.UiInteraction +import app.aaps.implementation.iob.GlucoseStatusProviderImpl import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector @@ -27,7 +28,6 @@ import info.nightscout.androidaps.insight.database.InsightDatabaseDao import info.nightscout.androidaps.insight.database.InsightDbHelper import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin import info.nightscout.database.impl.AppRepository -import info.nightscout.implementation.iob.GlucoseStatusProviderImpl import info.nightscout.plugins.aps.openAPSAMA.OpenAPSAMAPlugin import info.nightscout.plugins.aps.openAPSSMB.OpenAPSSMBPlugin import info.nightscout.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin diff --git a/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt b/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt index a77bdfcff1..5b171b8538 100644 --- a/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt +++ b/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt @@ -21,6 +21,7 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.core.main.constraints.ConstraintObject import app.aaps.database.entities.GlucoseValue +import app.aaps.implementation.iob.GlucoseStatusProviderImpl import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector @@ -30,7 +31,6 @@ import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAny import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.database.impl.transactions.Transaction -import info.nightscout.implementation.iob.GlucoseStatusProviderImpl import info.nightscout.plugins.R import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePasswordValidationResult diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorkerTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorkerTest.kt index c764ac8102..3c7f12e618 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorkerTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorkerTest.kt @@ -21,12 +21,12 @@ import app.aaps.core.nssdk.remotemodel.LastModified import app.aaps.core.utils.receivers.DataWorkerStorage import app.aaps.database.entities.GlucoseValue import app.aaps.database.entities.embedments.InterfaceIDs +import app.aaps.implementation.utils.DecimalFormatterImpl import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.implementation.utils.DecimalFormatterImpl import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor import info.nightscout.plugins.sync.nsclient.ReceiverDelegate import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt index cc4a74bb26..a9f079cc50 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt @@ -8,6 +8,7 @@ import app.aaps.core.interfaces.queue.CommandQueue import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.DecimalFormatter +import app.aaps.implementation.utils.DecimalFormatterImpl import app.aaps.shared.tests.TestBase import app.aaps.shared.tests.rx.TestAapsSchedulers import dagger.android.AndroidInjector @@ -15,7 +16,6 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.ErosHistoryDatabase import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager -import info.nightscout.implementation.utils.DecimalFormatterImpl import info.nightscout.pump.common.defs.TempBasalPair import org.joda.time.DateTimeZone import org.joda.time.tz.UTCProvider diff --git a/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestBaseWithProfile.kt b/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestBaseWithProfile.kt index 942b3080df..664083d83a 100644 --- a/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestBaseWithProfile.kt +++ b/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestBaseWithProfile.kt @@ -18,12 +18,12 @@ import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.database.entities.EffectiveProfileSwitch import app.aaps.database.entities.embedments.InsulinConfiguration +import app.aaps.implementation.profile.ProfileStoreObject +import app.aaps.implementation.profile.ProfileUtilImpl +import app.aaps.implementation.utils.DecimalFormatterImpl import app.aaps.shared.impl.utils.DateUtilImpl import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.implementation.profile.ProfileStoreObject -import info.nightscout.implementation.profile.ProfileUtilImpl -import info.nightscout.implementation.utils.DecimalFormatterImpl import org.json.JSONObject import org.junit.jupiter.api.BeforeEach import org.mockito.ArgumentMatchers.anyDouble From 8bf9e83948de2a0aa82ed1c7839d3421c280435b Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 26 Sep 2023 10:23:01 +0200 Subject: [PATCH 02/17] :plugins:aps cleanup --- app/src/main/AndroidManifest.xml | 2 +- app/src/main/kotlin/app/aaps/MainApp.kt | 2 +- .../aaps/activities/MyPreferenceFragment.kt | 10 ++--- .../main/kotlin/app/aaps/di/AppComponent.kt | 2 +- .../kotlin/app/aaps/di/PluginsListModule.kt | 10 ++--- .../aaps/implementations/InstantiatorImpl.kt | 2 +- .../interfaces/pump/PumpEnactResultTest.kt | 2 +- plugins/aps/build.gradle | 3 +- .../nightscout/plugins/aps/di/AlgModule.kt | 16 -------- .../app/aaps}/plugins/aps/APSResultObject.kt | 2 +- .../app/aaps}/plugins/aps/OpenAPSFragment.kt | 12 +++--- .../plugins/aps}/autotune/AutotuneCore.kt | 8 ++-- .../aaps/plugins/aps}/autotune/AutotuneFS.kt | 6 +-- .../plugins/aps}/autotune/AutotuneFragment.kt | 12 +++--- .../aaps/plugins/aps}/autotune/AutotuneIob.kt | 6 +-- .../plugins/aps}/autotune/AutotunePlugin.kt | 12 +++--- .../plugins/aps}/autotune/AutotunePrep.kt | 16 ++++---- .../plugins/aps}/autotune/data/ATProfile.kt | 2 +- .../plugins/aps}/autotune/data/BGDatum.kt | 2 +- .../plugins/aps}/autotune/data/CRDatum.kt | 2 +- .../aps}/autotune/data/DiaDeviation.kt | 2 +- .../aps}/autotune/data/LocalInsulin.kt | 2 +- .../aps}/autotune/data/PeakDeviation.kt | 2 +- .../aps}/autotune/data/PreppedGlucose.kt | 2 +- .../autotune/events/EventAutotuneUpdateGui.kt | 2 +- .../app/aaps/plugins/aps/di/AlgModule.kt | 22 ++++++++++ .../app/aaps}/plugins/aps/di/ApsModule.kt | 10 ++--- .../aaps}/plugins/aps/di/AutotuneModule.kt | 28 ++++++++----- .../app/aaps}/plugins/aps/di/LoopModule.kt | 6 +-- .../aps/events/EventOpenAPSUpdateGui.kt | 2 +- .../aps/events/EventResetOpenAPSGui.kt | 2 +- .../plugins/aps/logger/LoggerCallback.kt | 4 +- .../aps/loop/CarbSuggestionReceiver.kt | 2 +- .../aaps}/plugins/aps/loop/LoopFragment.kt | 8 ++-- .../app/aaps}/plugins/aps/loop/LoopPlugin.kt | 8 ++-- .../aps/loop/events/EventLoopSetLastRunGui.kt | 2 +- .../extensions/PumpEnactResultExtension.kt | 2 +- .../openAPSAMA/DetermineBasalAdapterAMAJS.kt | 16 ++++---- .../aps/openAPSAMA/DetermineBasalResultAMA.kt | 4 +- .../aps/openAPSAMA/OpenAPSAMAPlugin.kt | 12 +++--- .../openAPSSMB/DetermineBasalAdapterSMBJS.kt | 16 ++++---- .../aps/openAPSSMB/DetermineBasalResultSMB.kt | 4 +- .../aps/openAPSSMB/OpenAPSSMBPlugin.kt | 14 ++++--- .../DetermineBasalAdapterSMBDynamicISFJS.kt | 16 ++++---- .../OpenAPSSMBDynamicISFPlugin.kt | 10 ++--- .../aaps}/plugins/aps/utils/JSONFormatter.kt | 2 +- .../aaps}/plugins/aps/utils/ScriptReader.kt | 2 +- .../aaps}/plugins/aps/utils/StaticInjector.kt | 2 +- .../src/main/res/layout/autotune_fragment.xml | 2 +- .../plugins/aps}/autotune/AutotuneCoreTest.kt | 9 +++-- .../plugins/aps}/autotune/AutotunePrepTest.kt | 14 ++++--- .../aps}/autotune/PreppedGlucoseTest.kt | 8 ++-- .../aaps}/plugins/aps/loop/LoopPluginTest.kt | 10 ++--- .../constraints/ConstraintsCheckerImplTest.kt | 34 ++++++++-------- .../constraints/safety/SafetyPluginTest.kt | 40 +++++++++---------- 55 files changed, 235 insertions(+), 215 deletions(-) delete mode 100644 plugins/aps/src/main/java/info/nightscout/plugins/aps/di/AlgModule.kt rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/APSResultObject.kt (99%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/OpenAPSFragment.kt (96%) rename plugins/aps/src/main/{java/info/nightscout/plugins/general => kotlin/app/aaps/plugins/aps}/autotune/AutotuneCore.kt (99%) rename plugins/aps/src/main/{java/info/nightscout/plugins/general => kotlin/app/aaps/plugins/aps}/autotune/AutotuneFS.kt (97%) rename plugins/aps/src/main/{java/info/nightscout/plugins/general => kotlin/app/aaps/plugins/aps}/autotune/AutotuneFragment.kt (98%) rename plugins/aps/src/main/{java/info/nightscout/plugins/general => kotlin/app/aaps/plugins/aps}/autotune/AutotuneIob.kt (99%) rename plugins/aps/src/main/{java/info/nightscout/plugins/general => kotlin/app/aaps/plugins/aps}/autotune/AutotunePlugin.kt (98%) rename plugins/aps/src/main/{java/info/nightscout/plugins/general => kotlin/app/aaps/plugins/aps}/autotune/AutotunePrep.kt (98%) rename plugins/aps/src/main/{java/info/nightscout/plugins/general => kotlin/app/aaps/plugins/aps}/autotune/data/ATProfile.kt (99%) rename plugins/aps/src/main/{java/info/nightscout/plugins/general => kotlin/app/aaps/plugins/aps}/autotune/data/BGDatum.kt (98%) rename plugins/aps/src/main/{java/info/nightscout/plugins/general => kotlin/app/aaps/plugins/aps}/autotune/data/CRDatum.kt (97%) rename plugins/aps/src/main/{java/info/nightscout/plugins/general => kotlin/app/aaps/plugins/aps}/autotune/data/DiaDeviation.kt (94%) rename plugins/aps/src/main/{java/info/nightscout/plugins/general => kotlin/app/aaps/plugins/aps}/autotune/data/LocalInsulin.kt (96%) rename plugins/aps/src/main/{java/info/nightscout/plugins/general => kotlin/app/aaps/plugins/aps}/autotune/data/PeakDeviation.kt (94%) rename plugins/aps/src/main/{java/info/nightscout/plugins/general => kotlin/app/aaps/plugins/aps}/autotune/data/PreppedGlucose.kt (98%) rename plugins/aps/src/main/{java/info/nightscout/plugins/general => kotlin/app/aaps/plugins/aps}/autotune/events/EventAutotuneUpdateGui.kt (61%) create mode 100644 plugins/aps/src/main/kotlin/app/aaps/plugins/aps/di/AlgModule.kt rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/di/ApsModule.kt (74%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/di/AutotuneModule.kt (53%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/di/LoopModule.kt (67%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/events/EventOpenAPSUpdateGui.kt (71%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/events/EventResetOpenAPSGui.kt (74%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/logger/LoggerCallback.kt (94%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/loop/CarbSuggestionReceiver.kt (92%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/loop/LoopFragment.kt (97%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/loop/LoopPlugin.kt (99%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/loop/events/EventLoopSetLastRunGui.kt (77%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/loop/extensions/PumpEnactResultExtension.kt (94%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt (97%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/openAPSAMA/DetermineBasalResultAMA.kt (95%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt (97%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt (98%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/openAPSSMB/DetermineBasalResultSMB.kt (96%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt (97%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt (98%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt (91%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/utils/JSONFormatter.kt (98%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/utils/ScriptReader.kt (94%) rename plugins/aps/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/utils/StaticInjector.kt (94%) rename plugins/aps/src/test/{java/info/nightscout/plugins/general => kotlin/app/aaps/plugins/aps}/autotune/AutotuneCoreTest.kt (96%) rename plugins/aps/src/test/{java/info/nightscout/plugins/general => kotlin/app/aaps/plugins/aps}/autotune/AutotunePrepTest.kt (96%) rename plugins/aps/src/test/{java/info/nightscout/plugins/general => kotlin/app/aaps/plugins/aps}/autotune/PreppedGlucoseTest.kt (91%) rename plugins/aps/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/aps/loop/LoopPluginTest.kt (96%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ae87ca840c..2ce0ccee01 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -112,7 +112,7 @@ - + ): Constraint { diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt b/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt similarity index 98% rename from plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt rename to plugins/aps/src/main/kotlin/app/aaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt index 22bd151daa..8c6196d5ad 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt +++ b/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt @@ -1,8 +1,5 @@ -package info.nightscout.plugins.aps.openAPSSMBDynamicISF +package app.aaps.plugins.aps.openAPSSMBDynamicISF -import app.aaps.core.main.extensions.convertedToAbsolute -import app.aaps.core.main.extensions.getPassedDurationToTimeInMinutes -import app.aaps.core.main.extensions.plannedRemainingMinutes import app.aaps.core.interfaces.aps.DetermineBasalAdapter import app.aaps.core.interfaces.aps.SMBDefaults import app.aaps.core.interfaces.db.GlucoseUnit @@ -19,11 +16,14 @@ import app.aaps.core.interfaces.profile.ProfileUtil import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.Round import app.aaps.core.interfaces.utils.SafeParse +import app.aaps.core.main.extensions.convertedToAbsolute +import app.aaps.core.main.extensions.getPassedDurationToTimeInMinutes +import app.aaps.core.main.extensions.plannedRemainingMinutes +import app.aaps.plugins.aps.R +import app.aaps.plugins.aps.logger.LoggerCallback +import app.aaps.plugins.aps.openAPSSMB.DetermineBasalResultSMB +import app.aaps.plugins.aps.utils.ScriptReader import dagger.android.HasAndroidInjector -import info.nightscout.plugins.aps.R -import info.nightscout.plugins.aps.logger.LoggerCallback -import info.nightscout.plugins.aps.openAPSSMB.DetermineBasalResultSMB -import info.nightscout.plugins.aps.utils.ScriptReader import org.json.JSONArray import org.json.JSONException import org.json.JSONObject diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt b/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt similarity index 91% rename from plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt rename to plugins/aps/src/main/kotlin/app/aaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt index e49b904a34..b9a311b223 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt +++ b/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.aps.openAPSSMBDynamicISF +package app.aaps.plugins.aps.openAPSSMBDynamicISF import android.content.Context import app.aaps.annotations.OpenForTesting @@ -18,12 +18,12 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.stats.TddCalculator import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.HardLimits +import app.aaps.plugins.aps.R +import app.aaps.plugins.aps.openAPSSMB.DetermineBasalAdapterSMBJS +import app.aaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin +import app.aaps.plugins.aps.utils.ScriptReader import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.aps.R -import info.nightscout.plugins.aps.openAPSSMB.DetermineBasalAdapterSMBJS -import info.nightscout.plugins.aps.openAPSSMB.OpenAPSSMBPlugin -import info.nightscout.plugins.aps.utils.ScriptReader import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/utils/JSONFormatter.kt b/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/utils/JSONFormatter.kt similarity index 98% rename from plugins/aps/src/main/java/info/nightscout/plugins/aps/utils/JSONFormatter.kt rename to plugins/aps/src/main/kotlin/app/aaps/plugins/aps/utils/JSONFormatter.kt index ffaa890a3d..82fec6a11b 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/utils/JSONFormatter.kt +++ b/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/utils/JSONFormatter.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.aps.utils +package app.aaps.plugins.aps.utils import android.text.Spanned import app.aaps.core.interfaces.logging.AAPSLogger diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/utils/ScriptReader.kt b/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/utils/ScriptReader.kt similarity index 94% rename from plugins/aps/src/main/java/info/nightscout/plugins/aps/utils/ScriptReader.kt rename to plugins/aps/src/main/kotlin/app/aaps/plugins/aps/utils/ScriptReader.kt index 3781c4b89a..c59acf83d4 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/utils/ScriptReader.kt +++ b/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/utils/ScriptReader.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.aps.utils +package app.aaps.plugins.aps.utils import android.content.Context import java.io.ByteArrayOutputStream diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/utils/StaticInjector.kt b/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/utils/StaticInjector.kt similarity index 94% rename from plugins/aps/src/main/java/info/nightscout/plugins/aps/utils/StaticInjector.kt rename to plugins/aps/src/main/kotlin/app/aaps/plugins/aps/utils/StaticInjector.kt index a861a6d4fe..e511bc30a7 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/utils/StaticInjector.kt +++ b/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/utils/StaticInjector.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.aps.utils +package app.aaps.plugins.aps.utils import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector diff --git a/plugins/aps/src/main/res/layout/autotune_fragment.xml b/plugins/aps/src/main/res/layout/autotune_fragment.xml index b97d84a846..105c300944 100644 --- a/plugins/aps/src/main/res/layout/autotune_fragment.xml +++ b/plugins/aps/src/main/res/layout/autotune_fragment.xml @@ -3,7 +3,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="info.nightscout.plugins.general.autotune.AutotuneFragment"> + tools:context=".autotune.AutotuneFragment"> (1).also { diff --git a/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt b/plugins/aps/src/test/kotlin/app/aaps/plugins/aps/autotune/AutotunePrepTest.kt similarity index 96% rename from plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt rename to plugins/aps/src/test/kotlin/app/aaps/plugins/aps/autotune/AutotunePrepTest.kt index 012fed9ea2..ff7ff36d35 100644 --- a/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt +++ b/plugins/aps/src/test/kotlin/app/aaps/plugins/aps/autotune/AutotunePrepTest.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.general.autotune +package app.aaps.plugins.aps.autotune import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.iob.IobTotal @@ -16,10 +16,12 @@ import app.aaps.database.entities.Carbs import app.aaps.database.entities.GlucoseValue import app.aaps.database.entities.data.Block import app.aaps.database.entities.data.TargetBlock +import app.aaps.plugins.aps.autotune.data.ATProfile +import app.aaps.plugins.aps.autotune.data.LocalInsulin +import app.aaps.plugins.aps.autotune.data.PreppedGlucose import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.general.autotune.data.PreppedGlucose import org.json.JSONArray import org.json.JSONObject import org.junit.jupiter.api.BeforeEach @@ -149,7 +151,7 @@ class AutotunePrepTest : TestBaseWithProfile() { * OpenAPS profile for Autotune only have one ISF value and one IC value */ @Suppress("SpellCheckingInspection") - private fun atProfileFromOapsJson(jsonObject: JSONObject, dateUtil: DateUtil, defaultUnits: String? = null): info.nightscout.plugins.general.autotune.data.ATProfile? { + private fun atProfileFromOapsJson(jsonObject: JSONObject, dateUtil: DateUtil, defaultUnits: String? = null): ATProfile? { try { min5mCarbImpact = JsonHelper.safeGetDoubleAllowNull(jsonObject, "min_5m_carbimpact") ?: return null autotuneMin = JsonHelper.safeGetDoubleAllowNull(jsonObject, "autosens_min") ?: return null @@ -158,7 +160,7 @@ class AutotunePrepTest : TestBaseWithProfile() { val units = GlucoseUnit.fromText(txtUnits) val dia = JsonHelper.safeGetDoubleAllowNull(jsonObject, "dia") ?: return null val peak = JsonHelper.safeGetIntAllowNull(jsonObject, "insulinPeakTime") ?: return null - val localInsulin = info.nightscout.plugins.general.autotune.data.LocalInsulin("insulin", peak, dia) + val localInsulin = LocalInsulin("insulin", peak, dia) val timezone = TimeZone.getTimeZone(JsonHelper.safeGetString(jsonObject, "timezone", "UTC")) val isfJson = jsonObject.getJSONObject("isfProfile") val isfBlocks = ArrayList(1).also { @@ -186,7 +188,7 @@ class AutotunePrepTest : TestBaseWithProfile() { timeZone = timezone, dia = dia ) - return info.nightscout.plugins.general.autotune.data.ATProfile(ProfileSealed.Pure(pure), localInsulin, profileInjector).also { it.dateUtil = dateUtil } + return ATProfile(ProfileSealed.Pure(pure), localInsulin, profileInjector).also { it.dateUtil = dateUtil } } catch (ignored: Exception) { return null } @@ -296,7 +298,7 @@ class AutotunePrepTest : TestBaseWithProfile() { autotuneFS ) { - override fun getIOB(time: Long, localInsulin: info.nightscout.plugins.general.autotune.data.LocalInsulin): IobTotal { + override fun getIOB(time: Long, localInsulin: LocalInsulin): IobTotal { val bolusIob = IobTotal(time) iobOapsCalculation.forEach { if (it.time == time) diff --git a/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/PreppedGlucoseTest.kt b/plugins/aps/src/test/kotlin/app/aaps/plugins/aps/autotune/PreppedGlucoseTest.kt similarity index 91% rename from plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/PreppedGlucoseTest.kt rename to plugins/aps/src/test/kotlin/app/aaps/plugins/aps/autotune/PreppedGlucoseTest.kt index 38237e91df..5eb011a232 100644 --- a/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/PreppedGlucoseTest.kt +++ b/plugins/aps/src/test/kotlin/app/aaps/plugins/aps/autotune/PreppedGlucoseTest.kt @@ -1,10 +1,10 @@ -package info.nightscout.plugins.general.autotune +package app.aaps.plugins.aps.autotune +import app.aaps.plugins.aps.autotune.data.BGDatum +import app.aaps.plugins.aps.autotune.data.CRDatum +import app.aaps.plugins.aps.autotune.data.PreppedGlucose import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat -import info.nightscout.plugins.general.autotune.data.BGDatum -import info.nightscout.plugins.general.autotune.data.CRDatum -import info.nightscout.plugins.general.autotune.data.PreppedGlucose import org.json.JSONObject import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/aps/src/test/java/info/nightscout/plugins/aps/loop/LoopPluginTest.kt b/plugins/aps/src/test/kotlin/app/aaps/plugins/aps/loop/LoopPluginTest.kt similarity index 96% rename from plugins/aps/src/test/java/info/nightscout/plugins/aps/loop/LoopPluginTest.kt rename to plugins/aps/src/test/kotlin/app/aaps/plugins/aps/loop/LoopPluginTest.kt index f8c951a51c..7fb4577c31 100644 --- a/plugins/aps/src/test/java/info/nightscout/plugins/aps/loop/LoopPluginTest.kt +++ b/plugins/aps/src/test/kotlin/app/aaps/plugins/aps/loop/LoopPluginTest.kt @@ -1,8 +1,7 @@ -package info.nightscout.plugins.aps.loop +package app.aaps.plugins.aps.loop import android.app.NotificationManager import android.content.Context -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.aps.ApsMode import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.constraints.ConstraintsChecker @@ -18,13 +17,14 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.DateUtil +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.core.nssdk.interfaces.RunningConfiguration import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository import info.nightscout.pump.virtual.VirtualPumpPlugin -import app.aaps.core.nssdk.interfaces.RunningConfiguration import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock @@ -68,7 +68,7 @@ class LoopPluginTest : TestBase() { @Test fun testPluginInterface() { `when`(rh.gs(app.aaps.core.ui.R.string.loop)).thenReturn("Loop") - `when`(rh.gs(info.nightscout.plugins.aps.R.string.loop_shortname)).thenReturn("LOOP") + `when`(rh.gs(app.aaps.plugins.aps.R.string.loop_shortname)).thenReturn("LOOP") `when`(sp.getString(info.nightscout.core.utils.R.string.key_aps_mode, ApsMode.OPEN.name)).thenReturn(ApsMode.CLOSED.name) val pumpDescription = PumpDescription() `when`(virtualPumpPlugin.pumpDescription).thenReturn(pumpDescription) @@ -78,7 +78,7 @@ class LoopPluginTest : TestBase() { assertThat(loopPlugin.nameShort).isEqualTo("LOOP") assertThat(loopPlugin.hasFragment()).isTrue() assertThat(loopPlugin.showInList(PluginType.LOOP)).isTrue() - assertThat(loopPlugin.preferencesId.toLong()).isEqualTo(info.nightscout.plugins.aps.R.xml.pref_loop.toLong()) + assertThat(loopPlugin.preferencesId.toLong()).isEqualTo(app.aaps.plugins.aps.R.xml.pref_loop.toLong()) // Plugin is disabled by default assertThat(loopPlugin.isEnabled()).isFalse() diff --git a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/ConstraintsCheckerImplTest.kt b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/ConstraintsCheckerImplTest.kt index bc2aa4e9bd..f5cf082961 100644 --- a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/ConstraintsCheckerImplTest.kt +++ b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/ConstraintsCheckerImplTest.kt @@ -18,6 +18,9 @@ import app.aaps.core.interfaces.queue.CommandQueue import app.aaps.core.interfaces.stats.TddCalculator import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.implementation.iob.GlucoseStatusProviderImpl +import app.aaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin +import app.aaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin +import app.aaps.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector @@ -28,9 +31,6 @@ import info.nightscout.androidaps.insight.database.InsightDatabaseDao import info.nightscout.androidaps.insight.database.InsightDbHelper import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.aps.openAPSAMA.OpenAPSAMAPlugin -import info.nightscout.plugins.aps.openAPSSMB.OpenAPSSMBPlugin -import info.nightscout.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin import info.nightscout.plugins.constraints.objectives.ObjectivesPlugin import info.nightscout.plugins.constraints.objectives.objectives.Objective import info.nightscout.plugins.constraints.safety.SafetyPlugin @@ -99,19 +99,19 @@ class ConstraintsCheckerImplTest : TestBaseWithProfile() { `when`(rh.gs(info.nightscout.plugins.constraints.R.string.closed_loop_disabled_on_dev_branch)).thenReturn("Running dev version. Closed loop is disabled.") `when`(rh.gs(info.nightscout.plugins.constraints.R.string.closedmodedisabledinpreferences)).thenReturn("Closed loop mode disabled in preferences") `when`(rh.gs(app.aaps.core.ui.R.string.no_valid_basal_rate)).thenReturn("No valid basal rate read from pump") - `when`(rh.gs(info.nightscout.plugins.aps.R.string.autosens_disabled_in_preferences)).thenReturn("Autosens disabled in preferences") - `when`(rh.gs(info.nightscout.plugins.aps.R.string.smb_disabled_in_preferences)).thenReturn("SMB disabled in preferences") + `when`(rh.gs(app.aaps.plugins.aps.R.string.autosens_disabled_in_preferences)).thenReturn("Autosens disabled in preferences") + `when`(rh.gs(app.aaps.plugins.aps.R.string.smb_disabled_in_preferences)).thenReturn("SMB disabled in preferences") `when`(rh.gs(app.aaps.core.ui.R.string.pumplimit)).thenReturn("pump limit") `when`(rh.gs(app.aaps.core.ui.R.string.itmustbepositivevalue)).thenReturn("it must be positive value") `when`(rh.gs(info.nightscout.plugins.constraints.R.string.maxvalueinpreferences)).thenReturn("max value in preferences") - `when`(rh.gs(info.nightscout.plugins.aps.R.string.max_basal_multiplier)).thenReturn("max basal multiplier") - `when`(rh.gs(info.nightscout.plugins.aps.R.string.max_daily_basal_multiplier)).thenReturn("max daily basal multiplier") + `when`(rh.gs(app.aaps.plugins.aps.R.string.max_basal_multiplier)).thenReturn("max basal multiplier") + `when`(rh.gs(app.aaps.plugins.aps.R.string.max_daily_basal_multiplier)).thenReturn("max daily basal multiplier") `when`(rh.gs(app.aaps.core.ui.R.string.pumplimit)).thenReturn("pump limit") `when`(rh.gs(app.aaps.core.ui.R.string.limitingbolus)).thenReturn("Limiting bolus to %.1f U because of %s") `when`(rh.gs(info.nightscout.plugins.constraints.R.string.hardlimit)).thenReturn("hard limit") `when`(rh.gs(info.nightscout.core.utils.R.string.key_child)).thenReturn("child") `when`(rh.gs(info.nightscout.plugins.constraints.R.string.limitingcarbs)).thenReturn("Limiting carbs to %d g because of %s") - `when`(rh.gs(info.nightscout.plugins.aps.R.string.limiting_iob)).thenReturn("Limiting IOB to %.1f U because of %s") + `when`(rh.gs(app.aaps.plugins.aps.R.string.limiting_iob)).thenReturn("Limiting IOB to %.1f U because of %s") `when`(rh.gs(app.aaps.core.ui.R.string.limitingbasalratio)).thenReturn("Limiting max basal rate to %1\$.2f U/h because of %2\$s") `when`(rh.gs(app.aaps.core.ui.R.string.limitingpercentrate)).thenReturn("Limiting max percent rate to %1\$d%% because of %2\$s") `when`(rh.gs(app.aaps.core.ui.R.string.itmustbepositivevalue)).thenReturn("it must be positive value") @@ -291,7 +291,7 @@ class ConstraintsCheckerImplTest : TestBaseWithProfile() { fun isSMBModeEnabledTest() { openAPSSMBPlugin.setPluginEnabled(PluginType.APS, true) objectivesPlugin.objectives[Objectives.SMB_OBJECTIVE].startedOn = 0 - `when`(sp.getBoolean(info.nightscout.plugins.aps.R.string.key_use_smb, false)).thenReturn(false) + `when`(sp.getBoolean(app.aaps.plugins.aps.R.string.key_use_smb, false)).thenReturn(false) `when`(sp.getString(info.nightscout.core.utils.R.string.key_aps_mode, ApsMode.OPEN.name)).thenReturn(ApsMode.OPEN.name) // `when`(constraintChecker.isClosedLoopAllowed()).thenReturn(ConstraintObject(true)) val c = constraintChecker.isSMBModeEnabled() @@ -316,9 +316,9 @@ class ConstraintsCheckerImplTest : TestBaseWithProfile() { // insightPlugin.setStatusResult(result); // No limit by default - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0) - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapsama_current_basal_safety_multiplier, 4.0)).thenReturn(4.0) - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapsama_max_daily_safety_multiplier, 3.0)).thenReturn(3.0) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_current_basal_safety_multiplier, 4.0)).thenReturn(4.0) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_max_daily_safety_multiplier, 3.0)).thenReturn(3.0) `when`(sp.getString(info.nightscout.core.utils.R.string.key_age, "")).thenReturn("child") // Apply all limits @@ -343,9 +343,9 @@ class ConstraintsCheckerImplTest : TestBaseWithProfile() { // insightPlugin.setStatusResult(result); // No limit by default - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0) - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapsama_current_basal_safety_multiplier, 4.0)).thenReturn(4.0) - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapsama_max_daily_safety_multiplier, 3.0)).thenReturn(3.0) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_current_basal_safety_multiplier, 4.0)).thenReturn(4.0) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_max_daily_safety_multiplier, 3.0)).thenReturn(3.0) `when`(sp.getString(info.nightscout.core.utils.R.string.key_age, "")).thenReturn("child") // Apply all limits @@ -400,7 +400,7 @@ class ConstraintsCheckerImplTest : TestBaseWithProfile() { fun iobAMAShouldBeLimited() { // No limit by default `when`(sp.getString(info.nightscout.core.utils.R.string.key_aps_mode, ApsMode.OPEN.name)).thenReturn(ApsMode.CLOSED.name) - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapsma_max_iob, 1.5)).thenReturn(1.5) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsma_max_iob, 1.5)).thenReturn(1.5) `when`(sp.getString(info.nightscout.core.utils.R.string.key_age, "")).thenReturn("teenage") openAPSAMAPlugin.setPluginEnabled(PluginType.APS, true) openAPSSMBPlugin.setPluginEnabled(PluginType.APS, false) @@ -416,7 +416,7 @@ class ConstraintsCheckerImplTest : TestBaseWithProfile() { fun iobSMBShouldBeLimited() { // No limit by default `when`(sp.getString(info.nightscout.core.utils.R.string.key_aps_mode, ApsMode.OPEN.name)).thenReturn(ApsMode.CLOSED.name) - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapssmb_max_iob, 3.0)).thenReturn(3.0) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapssmb_max_iob, 3.0)).thenReturn(3.0) `when`(sp.getString(info.nightscout.core.utils.R.string.key_age, "")).thenReturn("teenage") openAPSSMBPlugin.setPluginEnabled(PluginType.APS, true) openAPSAMAPlugin.setPluginEnabled(PluginType.APS, false) diff --git a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/safety/SafetyPluginTest.kt b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/safety/SafetyPluginTest.kt index e2eaa9c7f9..0b637e8595 100644 --- a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/safety/SafetyPluginTest.kt +++ b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/safety/SafetyPluginTest.kt @@ -1,6 +1,5 @@ package info.nightscout.plugins.constraints.safety -import app.aaps.core.main.constraints.ConstraintObject import app.aaps.core.interfaces.aps.ApsMode import app.aaps.core.interfaces.bgQualityCheck.BgQualityCheck import app.aaps.core.interfaces.constraints.Constraint @@ -12,13 +11,14 @@ import app.aaps.core.interfaces.pump.defs.PumpDescription import app.aaps.core.interfaces.stats.TddCalculator import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.HardLimits +import app.aaps.core.main.constraints.ConstraintObject +import app.aaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin +import app.aaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.aps.openAPSAMA.OpenAPSAMAPlugin -import info.nightscout.plugins.aps.openAPSSMB.OpenAPSSMBPlugin import info.nightscout.pump.virtual.VirtualPumpPlugin import info.nightscout.source.GlimpPlugin import org.junit.jupiter.api.BeforeEach @@ -54,16 +54,16 @@ class SafetyPluginTest : TestBaseWithProfile() { `when`(rh.gs(app.aaps.core.ui.R.string.itmustbepositivevalue)).thenReturn("it must be positive value") `when`(rh.gs(app.aaps.core.ui.R.string.pumplimit)).thenReturn("pump limit") `when`(rh.gs(info.nightscout.plugins.constraints.R.string.maxvalueinpreferences)).thenReturn("max value in preferences") - `when`(rh.gs(info.nightscout.plugins.aps.R.string.max_daily_basal_multiplier)).thenReturn("max daily basal multiplier") - `when`(rh.gs(info.nightscout.plugins.aps.R.string.max_basal_multiplier)).thenReturn("max basal multiplier") + `when`(rh.gs(app.aaps.plugins.aps.R.string.max_daily_basal_multiplier)).thenReturn("max daily basal multiplier") + `when`(rh.gs(app.aaps.plugins.aps.R.string.max_basal_multiplier)).thenReturn("max basal multiplier") `when`(rh.gs(app.aaps.core.ui.R.string.limitingbolus)).thenReturn("Limiting bolus to %1\$.1f U because of %2\$s") `when`(rh.gs(app.aaps.core.ui.R.string.limitingbasalratio)).thenReturn("Limiting max basal rate to %1\$.2f U/h because of %2\$s") `when`(rh.gs(app.aaps.core.ui.R.string.limiting_iob)).thenReturn("Limiting IOB to %1\$.1f U because of %2\$s") `when`(rh.gs(info.nightscout.plugins.constraints.R.string.limitingcarbs)).thenReturn("Limiting carbs to %1\$d g because of %2\$s") `when`(rh.gs(app.aaps.core.ui.R.string.limitingpercentrate)).thenReturn("Limiting max percent rate to %1\$d%% because of %2\$s") `when`(rh.gs(info.nightscout.plugins.constraints.R.string.pumpisnottempbasalcapable)).thenReturn("Pump is not temp basal capable") - `when`(rh.gs(info.nightscout.plugins.aps.R.string.increasing_max_basal)).thenReturn("Increasing max basal value because setting is lower than your max basal in profile") - `when`(rh.gs(info.nightscout.plugins.aps.R.string.smb_disabled_in_preferences)).thenReturn("SMB disabled in preferences") + `when`(rh.gs(app.aaps.plugins.aps.R.string.increasing_max_basal)).thenReturn("Increasing max basal value because setting is lower than your max basal in profile") + `when`(rh.gs(app.aaps.plugins.aps.R.string.smb_disabled_in_preferences)).thenReturn("SMB disabled in preferences") `when`(rh.gs(info.nightscout.plugins.constraints.R.string.closedmodedisabledinpreferences)).thenReturn("Closed loop mode disabled in preferences") `when`(rh.gs(info.nightscout.plugins.constraints.R.string.closed_loop_disabled_on_dev_branch)).thenReturn("Running dev version. Closed loop is disabled.") `when`(rh.gs(info.nightscout.plugins.constraints.R.string.smbalwaysdisabled)).thenReturn("SMB always and after carbs disabled because active BG source doesn\\'t support advanced filtering") @@ -112,7 +112,7 @@ class SafetyPluginTest : TestBaseWithProfile() { @Test fun notEnabledSMBInPreferencesDisablesSMB() { - `when`(sp.getBoolean(info.nightscout.plugins.aps.R.string.key_use_smb, false)).thenReturn(false) + `when`(sp.getBoolean(app.aaps.plugins.aps.R.string.key_use_smb, false)).thenReturn(false) `when`(constraintChecker.isClosedLoopAllowed(anyObject())).thenReturn(ConstraintObject(true, aapsLogger)) val c = openAPSSMBPlugin.isSMBModeEnabled(ConstraintObject(true, aapsLogger)) assertThat(c.getReasons()).contains("SMB disabled in preferences") @@ -121,7 +121,7 @@ class SafetyPluginTest : TestBaseWithProfile() { @Test fun openLoopPreventsSMB() { - `when`(sp.getBoolean(info.nightscout.plugins.aps.R.string.key_use_smb, false)).thenReturn(true) + `when`(sp.getBoolean(app.aaps.plugins.aps.R.string.key_use_smb, false)).thenReturn(true) `when`(constraintChecker.isClosedLoopAllowed()).thenReturn(ConstraintObject(false, aapsLogger)) val c = safetyPlugin.isSMBModeEnabled(ConstraintObject(true, aapsLogger)) assertThat(c.getReasons()).contains("SMB not allowed in open loop mode") @@ -138,9 +138,9 @@ class SafetyPluginTest : TestBaseWithProfile() { @Test fun basalRateShouldBeLimited() { - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0) - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapsama_current_basal_safety_multiplier, 4.0)).thenReturn(4.0) - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapsama_max_daily_safety_multiplier, 3.0)).thenReturn(3.0) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_current_basal_safety_multiplier, 4.0)).thenReturn(4.0) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_max_daily_safety_multiplier, 3.0)).thenReturn(3.0) `when`(sp.getString(info.nightscout.core.utils.R.string.key_age, "")).thenReturn("child") val c = ConstraintObject(Double.MAX_VALUE, aapsLogger) safetyPlugin.applyBasalConstraints(c, validProfile) @@ -167,9 +167,9 @@ class SafetyPluginTest : TestBaseWithProfile() { @Test fun percentBasalRateShouldBeLimited() { // No limit by default - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0) - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapsama_current_basal_safety_multiplier, 4.0)).thenReturn(4.0) - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapsama_max_daily_safety_multiplier, 3.0)).thenReturn(3.0) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_current_basal_safety_multiplier, 4.0)).thenReturn(4.0) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_max_daily_safety_multiplier, 3.0)).thenReturn(3.0) `when`(sp.getString(info.nightscout.core.utils.R.string.key_age, "")).thenReturn("child") val i = ConstraintObject(Int.MAX_VALUE, aapsLogger) safetyPlugin.applyBasalPercentConstraints(i, validProfile) @@ -190,9 +190,9 @@ Safety: Limiting max basal rate to 500.00 U/h because of pump limit @Test fun percentBasalShouldBeLimitedBySMB() { // No limit by default - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0) - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapsama_current_basal_safety_multiplier, 4.0)).thenReturn(4.0) - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapsama_max_daily_safety_multiplier, 3.0)).thenReturn(3.0) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_current_basal_safety_multiplier, 4.0)).thenReturn(4.0) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_max_daily_safety_multiplier, 3.0)).thenReturn(3.0) `when`(sp.getString(info.nightscout.core.utils.R.string.key_age, "")).thenReturn("child") openAPSSMBPlugin.setPluginEnabled(PluginType.APS, true) val i = ConstraintObject(Double.MAX_VALUE, aapsLogger) @@ -273,8 +273,8 @@ Safety: Limiting max basal rate to 500.00 U/h because of pump limit //`when`(openAPSSMBPlugin.isEnabled()).thenReturn(true) //`when`(openAPSAMAPlugin.isEnabled()).thenReturn(false) `when`(sp.getString(info.nightscout.core.utils.R.string.key_aps_mode, ApsMode.OPEN.name)).thenReturn(ApsMode.LGS.name) - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapsma_max_iob, 1.5)).thenReturn(1.5) - `when`(sp.getDouble(info.nightscout.plugins.aps.R.string.key_openapssmb_max_iob, 3.0)).thenReturn(3.0) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsma_max_iob, 1.5)).thenReturn(1.5) + `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapssmb_max_iob, 3.0)).thenReturn(3.0) `when`(sp.getString(info.nightscout.core.utils.R.string.key_age, "")).thenReturn("teenage") // Apply all limits From 5e28d9465db1d1cb904115cfa08d514ed41c1303 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 26 Sep 2023 11:04:05 +0200 Subject: [PATCH 03/17] fix NPE --- .../app/aaps/core/ui/elements/DigitsKeyListenerWithComma.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/ui/src/main/kotlin/app/aaps/core/ui/elements/DigitsKeyListenerWithComma.kt b/core/ui/src/main/kotlin/app/aaps/core/ui/elements/DigitsKeyListenerWithComma.kt index fc7e1e2b5f..cd45f8320e 100644 --- a/core/ui/src/main/kotlin/app/aaps/core/ui/elements/DigitsKeyListenerWithComma.kt +++ b/core/ui/src/main/kotlin/app/aaps/core/ui/elements/DigitsKeyListenerWithComma.kt @@ -36,7 +36,7 @@ internal class DigitsKeyListenerWithComma @JvmOverloads constructor(private val override fun filter( source: CharSequence, start: Int, end: Int, dest: Spanned, dstart: Int, dend: Int - ): CharSequence { + ): CharSequence? { var sourceSequence = source var startIndex = start var endIndex = end From 101c5288704655bc92febf154f907177469724c2 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 26 Sep 2023 12:32:07 +0200 Subject: [PATCH 04/17] :plugins:automation cleanup --- .../aaps/activities/MyPreferenceFragment.kt | 2 +- .../main/kotlin/app/aaps/di/AppComponent.kt | 2 +- .../kotlin/app/aaps/di/PluginsListModule.kt | 2 +- plugins/automation/build.gradle | 2 +- .../plugins}/automation/AutomationEvent.kt | 12 +-- .../plugins}/automation/AutomationFragment.kt | 14 +-- .../plugins}/automation/AutomationPlugin.kt | 80 ++++++++-------- .../plugins}/automation/actions/Action.kt | 4 +- .../automation/actions/ActionAlarm.kt | 12 +-- .../actions/ActionCarePortalEvent.kt | 14 +-- .../automation/actions/ActionDummy.kt | 2 +- .../automation/actions/ActionLoopDisable.kt | 4 +- .../automation/actions/ActionLoopEnable.kt | 4 +- .../automation/actions/ActionLoopResume.kt | 4 +- .../automation/actions/ActionLoopSuspend.kt | 10 +- .../automation/actions/ActionNotification.kt | 10 +- .../automation/actions/ActionProfileSwitch.kt | 10 +- .../actions/ActionProfileSwitchPercent.kt | 16 ++-- .../automation/actions/ActionRunAutotune.kt | 12 +-- .../automation/actions/ActionSendSMS.kt | 10 +- .../actions/ActionStartTempTarget.kt | 18 ++-- .../actions/ActionStopProcessing.kt | 4 +- .../actions/ActionStopTempTarget.kt | 4 +- .../automation/di/AutomationModule.kt | 94 +++++++++---------- .../plugins}/automation/dialogs/BaseDialog.kt | 2 +- .../automation/dialogs/ChooseActionDialog.kt | 12 +-- .../dialogs/ChooseOperationDialog.kt | 6 +- .../automation/dialogs/ChooseTriggerDialog.kt | 8 +- .../automation/dialogs/EditActionDialog.kt | 10 +- .../automation/dialogs/EditEventDialog.kt | 26 ++--- .../automation/dialogs/EditTriggerDialog.kt | 20 ++-- .../automation/elements/Comparator.kt | 4 +- .../automation/elements/ComparatorConnect.kt | 4 +- .../automation/elements/ComparatorExists.kt | 2 +- .../plugins}/automation/elements/Element.kt | 2 +- .../plugins}/automation/elements/InputBg.kt | 2 +- .../automation/elements/InputButton.kt | 2 +- .../elements/InputCarePortalMenu.kt | 2 +- .../automation/elements/InputDateTime.kt | 8 +- .../automation/elements/InputDelta.kt | 4 +- .../automation/elements/InputDouble.kt | 2 +- .../automation/elements/InputDropdownMenu.kt | 2 +- .../automation/elements/InputDuration.kt | 2 +- .../automation/elements/InputInsulin.kt | 2 +- .../automation/elements/InputLocationMode.kt | 4 +- .../automation/elements/InputPercent.kt | 2 +- .../automation/elements/InputProfileName.kt | 2 +- .../automation/elements/InputString.kt | 2 +- .../automation/elements/InputTempTarget.kt | 2 +- .../plugins}/automation/elements/InputTime.kt | 8 +- .../automation/elements/InputTimeRange.kt | 12 +-- .../automation/elements/InputWeekDay.kt | 2 +- .../automation/elements/LabelWithElement.kt | 2 +- .../automation/elements/LayoutBuilder.kt | 2 +- .../automation/elements/StaticLabel.kt | 4 +- .../events/EventAutomationAddAction.kt | 4 +- .../events/EventAutomationDataChanged.kt | 2 +- .../events/EventAutomationUpdateAction.kt | 4 +- .../events/EventAutomationUpdateGui.kt | 2 +- .../events/EventAutomationUpdateTrigger.kt | 4 +- .../automation/events/EventLocationChange.kt | 2 +- .../automation/events/EventTriggerChanged.kt | 2 +- .../automation/events/EventTriggerClone.kt | 4 +- .../automation/events/EventTriggerRemove.kt | 4 +- .../services/LastLocationDataContainer.kt | 2 +- .../automation/services/LocationService.kt | 8 +- .../services/LocationServiceHelper.kt | 2 +- .../plugins}/automation/triggers/Trigger.kt | 16 ++-- .../triggers/TriggerAutosensValue.kt | 16 ++-- .../automation/triggers/TriggerBTDevice.kt | 16 ++-- .../plugins}/automation/triggers/TriggerBg.kt | 16 ++-- .../automation/triggers/TriggerBolusAgo.kt | 16 ++-- .../automation/triggers/TriggerCOB.kt | 16 ++-- .../automation/triggers/TriggerConnector.kt | 12 +-- .../automation/triggers/TriggerDelta.kt | 18 ++-- .../automation/triggers/TriggerDummy.kt | 4 +- .../automation/triggers/TriggerHeartRate.kt | 16 ++-- .../automation/triggers/TriggerIob.kt | 16 ++-- .../automation/triggers/TriggerLocation.kt | 20 ++-- .../triggers/TriggerProfilePercent.kt | 16 ++-- .../triggers/TriggerPumpLastConnection.kt | 16 ++-- .../triggers/TriggerRecurringTime.kt | 14 +-- .../automation/triggers/TriggerTempTarget.kt | 12 +-- .../triggers/TriggerTempTargetValue.kt | 16 ++-- .../automation/triggers/TriggerTime.kt | 12 +-- .../automation/triggers/TriggerTimeRange.kt | 12 +-- .../automation/triggers/TriggerWifiSsid.kt | 16 ++-- .../aaps/plugins}/automation/ui/TimerUtil.kt | 4 +- .../res/layout/automation_dialog_action.xml | 2 +- .../automation_dialog_choose_action.xml | 2 +- .../automation_dialog_choose_operation.xml | 2 +- .../automation_dialog_choose_trigger.xml | 2 +- .../layout/automation_dialog_edit_trigger.xml | 2 +- .../res/layout/automation_dialog_event.xml | 2 +- .../main/res/layout/automation_fragment.xml | 2 +- .../automation/AutomationEventTest.kt | 14 +-- .../plugins}/automation/BolusTimerImplTest.kt | 10 +- .../plugins}/automation/CarbTimerImplTest.kt | 10 +- .../plugins}/automation/ComposeTriggerTest.kt | 8 +- .../automation/actions/ActionAlarmTest.kt | 8 +- .../actions/ActionCarePortalEventTest.kt | 8 +- .../automation/actions/ActionDummyTest.kt | 4 +- .../actions/ActionLoopDisableTest.kt | 4 +- .../actions/ActionLoopEnableTest.kt | 4 +- .../actions/ActionLoopResumeTest.kt | 4 +- .../actions/ActionLoopSuspendTest.kt | 6 +- .../actions/ActionNotificationTest.kt | 6 +- .../actions/ActionProfileSwitchPercentTest.kt | 8 +- .../actions/ActionProfileSwitchTest.kt | 6 +- .../automation/actions/ActionSendSMSTest.kt | 6 +- .../actions/ActionStartTempTargetTest.kt | 8 +- .../actions/ActionStopProcessingTest.kt | 4 +- .../actions/ActionStopTempTargetTest.kt | 4 +- .../automation/actions/ActionsTestBase.kt | 4 +- .../elements/ComparatorConnectTest.kt | 4 +- .../elements/ComparatorExistsTest.kt | 4 +- .../automation/elements/ComparatorTest.kt | 4 +- .../automation/elements/InputBgTest.kt | 4 +- .../elements/InputCarePortalEventTest.kt | 4 +- .../automation/elements/InputDurationTest.kt | 4 +- .../automation/elements/InputInsulinTest.kt | 4 +- .../automation/elements/InputPercentTest.kt | 4 +- .../elements/InputProfileNameTest.kt | 4 +- .../automation/elements/InputStringTest.kt | 4 +- .../elements/InputTempTargetTest.kt | 4 +- .../elements/LabelWithElementTest.kt | 4 +- .../automation/elements/LayoutBuilderTest.kt | 2 +- .../automation/elements/StaticLabelTest.kt | 6 +- .../triggers/TriggerAutosensValueTest.kt | 6 +- .../triggers/TriggerBTDeviceTest.kt | 4 +- .../automation/triggers/TriggerBgTest.kt | 4 +- .../triggers/TriggerBolusAgoTest.kt | 4 +- .../automation/triggers/TriggerCOBTest.kt | 4 +- .../triggers/TriggerConnectorTest.kt | 4 +- .../automation/triggers/TriggerDeltaTest.kt | 8 +- .../automation/triggers/TriggerDummyTest.kt | 4 +- .../triggers/TriggerHeartRateTest.kt | 6 +- .../automation/triggers/TriggerIobTest.kt | 6 +- .../triggers/TriggerLocationTest.kt | 6 +- .../triggers/TriggerProfilePercentTest.kt | 6 +- .../triggers/TriggerPumpLastConnectionTest.kt | 6 +- .../triggers/TriggerRecurringTimeTest.kt | 2 +- .../triggers/TriggerTempTargetTest.kt | 6 +- .../triggers/TriggerTempTargetValueTest.kt | 6 +- .../automation/triggers/TriggerTestBase.kt | 6 +- .../triggers/TriggerTimeRangeTest.kt | 4 +- .../automation/triggers/TriggerTimeTest.kt | 4 +- .../triggers/TriggerWifiSsidTest.kt | 6 +- 148 files changed, 574 insertions(+), 574 deletions(-) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/AutomationEvent.kt (91%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/AutomationFragment.kt (96%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/AutomationPlugin.kt (89%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/Action.kt (97%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionAlarm.kt (87%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionCarePortalEvent.kt (93%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionDummy.kt (94%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionLoopDisable.kt (96%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionLoopEnable.kt (95%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionLoopResume.kt (96%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionLoopSuspend.kt (91%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionNotification.kt (90%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionProfileSwitch.kt (93%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionProfileSwitchPercent.kt (88%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionRunAutotune.kt (93%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionSendSMS.kt (87%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionStartTempTarget.kt (92%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionStopProcessing.kt (92%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionStopTempTarget.kt (95%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/di/AutomationModule.kt (61%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/dialogs/BaseDialog.kt (98%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/dialogs/ChooseActionDialog.kt (89%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/dialogs/ChooseOperationDialog.kt (93%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/dialogs/ChooseTriggerDialog.kt (93%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/dialogs/EditActionDialog.kt (87%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/dialogs/EditEventDialog.kt (93%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/dialogs/EditTriggerDialog.kt (87%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/Comparator.kt (97%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/ComparatorConnect.kt (96%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/ComparatorExists.kt (97%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/Element.kt (68%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputBg.kt (97%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputButton.kt (92%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputCarePortalMenu.kt (98%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputDateTime.kt (94%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputDelta.kt (97%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputDouble.kt (97%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputDropdownMenu.kt (97%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputDuration.kt (97%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputInsulin.kt (93%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputLocationMode.kt (96%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputPercent.kt (94%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputProfileName.kt (97%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputString.kt (95%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputTempTarget.kt (97%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputTime.kt (93%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputTimeRange.kt (92%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputWeekDay.kt (64%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/LabelWithElement.kt (96%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/LayoutBuilder.kt (96%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/StaticLabel.kt (94%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/events/EventAutomationAddAction.kt (54%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/events/EventAutomationDataChanged.kt (68%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/events/EventAutomationUpdateAction.kt (58%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/events/EventAutomationUpdateGui.kt (67%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/events/EventAutomationUpdateTrigger.kt (54%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/events/EventLocationChange.kt (76%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/events/EventTriggerChanged.kt (66%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/events/EventTriggerClone.kt (52%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/events/EventTriggerRemove.kt (52%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/services/LastLocationDataContainer.kt (85%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/services/LocationService.kt (98%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/services/LocationServiceHelper.kt (98%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/Trigger.kt (94%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerAutosensValue.kt (88%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerBTDevice.kt (89%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerBg.kt (89%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerBolusAgo.kt (89%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerCOB.kt (88%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerConnector.kt (96%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerDelta.kt (90%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerDummy.kt (91%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerHeartRate.kt (88%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerIob.kt (85%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerLocation.kt (90%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerProfilePercent.kt (89%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerPumpLastConnection.kt (89%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerRecurringTime.kt (91%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerTempTarget.kt (89%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerTempTargetValue.kt (90%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerTime.kt (87%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerTimeRange.kt (90%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerWifiSsid.kt (88%) rename plugins/automation/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/ui/TimerUtil.kt (92%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/AutomationEventTest.kt (89%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/BolusTimerImplTest.kt (92%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/CarbTimerImplTest.kt (93%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/ComposeTriggerTest.kt (87%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionAlarmTest.kt (93%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionCarePortalEventTest.kt (92%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionDummyTest.kt (86%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionLoopDisableTest.kt (96%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionLoopEnableTest.kt (95%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionLoopResumeTest.kt (96%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionLoopSuspendTest.kt (93%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionNotificationTest.kt (96%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionProfileSwitchPercentTest.kt (92%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionProfileSwitchTest.kt (96%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionSendSMSTest.kt (92%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionStartTempTargetTest.kt (94%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionStopProcessingTest.kt (92%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionStopTempTargetTest.kt (96%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/actions/ActionsTestBase.kt (98%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/ComparatorConnectTest.kt (81%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/ComparatorExistsTest.kt (80%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/ComparatorTest.kt (93%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputBgTest.kt (89%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputCarePortalEventTest.kt (81%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputDurationTest.kt (85%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputInsulinTest.kt (71%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputPercentTest.kt (71%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputProfileNameTest.kt (79%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputStringTest.kt (71%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/InputTempTargetTest.kt (83%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/LabelWithElementTest.kt (79%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/LayoutBuilderTest.kt (95%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/elements/StaticLabelTest.kt (76%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerAutosensValueTest.kt (97%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerBTDeviceTest.kt (93%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerBgTest.kt (97%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerBolusAgoTest.kt (97%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerCOBTest.kt (96%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerConnectorTest.kt (98%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerDeltaTest.kt (96%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerDummyTest.kt (85%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerHeartRateTest.kt (96%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerIobTest.kt (95%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerLocationTest.kt (96%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerProfilePercentTest.kt (95%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerPumpLastConnectionTest.kt (95%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerRecurringTimeTest.kt (97%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerTempTargetTest.kt (93%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerTempTargetValueTest.kt (97%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerTestBase.kt (93%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerTimeRangeTest.kt (96%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerTimeTest.kt (96%) rename plugins/automation/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/automation/triggers/TriggerWifiSsidTest.kt (95%) 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"> Date: Tue, 26 Sep 2023 12:44:36 +0200 Subject: [PATCH 05/17] :plugins:configuration cleanup --- app/src/main/kotlin/app/aaps/MainActivity.kt | 12 +++--- app/src/main/kotlin/app/aaps/MainApp.kt | 4 +- .../aaps/activities/MyPreferenceFragment.kt | 10 ++--- .../aaps/activities/PreferencesActivity.kt | 4 +- .../main/kotlin/app/aaps/di/AppComponent.kt | 2 +- .../kotlin/app/aaps/di/PluginsListModule.kt | 4 +- .../aaps/implementations/UiInteractionImpl.kt | 6 +-- .../app/aaps/receivers/KeepAliveWorker.kt | 6 +-- .../maintenance/MaintenancePluginTest.kt | 2 +- plugins/configuration/build.gradle | 3 +- .../configuration/AndroidPermissionImpl.kt | 4 +- .../DaggerAppCompatActivityWithResult.kt | 10 ++--- .../OptimizationPermissionContract.kt | 2 +- .../activities/SingleFragmentActivity.kt | 6 +-- .../configBuilder/ConfigBuilderFragment.kt | 10 ++--- .../configBuilder/ConfigBuilderPlugin.kt | 6 +-- .../configBuilder/RunningConfigurationImpl.kt | 4 +- .../events/EventConfigBuilderUpdateGui.kt | 2 +- .../configuration/di/ConfigurationModule.kt | 28 +++++++------- .../configuration/di/SetupWizardModule.kt | 38 +++++++++---------- .../CustomWatchfaceFileContract.kt | 4 +- .../maintenance/ImportExportPrefsImpl.kt | 20 +++++----- .../maintenance/MaintenanceFragment.kt | 8 ++-- .../maintenance/MaintenancePlugin.kt | 4 +- .../maintenance/PrefFileListProviderImpl.kt | 10 ++--- .../maintenance/PrefsFileContract.kt | 4 +- .../maintenance/PrefsMetadataKeyImpl.kt | 6 +-- .../CustomWatchfaceImportListActivity.kt | 8 ++-- .../activities/LogSettingActivity.kt | 6 +-- .../activities/PrefImportListActivity.kt | 14 +++---- .../maintenance/data/PrefsFormat.kt | 4 +- .../dialogs/PrefImportSummaryDialog.kt | 10 ++--- .../formats/EncryptedPrefsFormat.kt | 20 +++++----- .../configuration/setupwizard/SWDefinition.kt | 30 +++++++-------- .../setupwizard/SWEventListener.kt | 4 +- .../configuration/setupwizard/SWScreen.kt | 4 +- .../setupwizard/SetupWizardActivity.kt | 20 +++++----- .../setupwizard/elements/SWBreak.kt | 2 +- .../setupwizard/elements/SWButton.kt | 2 +- .../elements/SWEditEncryptedPassword.kt | 4 +- .../setupwizard/elements/SWEditIntNumber.kt | 4 +- .../setupwizard/elements/SWEditNumber.kt | 4 +- .../elements/SWEditNumberWithUnits.kt | 4 +- .../setupwizard/elements/SWEditString.kt | 2 +- .../setupwizard/elements/SWEditUrl.kt | 4 +- .../setupwizard/elements/SWFragment.kt | 4 +- .../setupwizard/elements/SWHtmlLink.kt | 2 +- .../setupwizard/elements/SWInfoText.kt | 2 +- .../setupwizard/elements/SWItem.kt | 2 +- .../setupwizard/elements/SWPlugin.kt | 8 ++-- .../setupwizard/elements/SWPreference.kt | 4 +- .../setupwizard/elements/SWRadioButton.kt | 2 +- .../setupwizard/events/EventSWLabel.kt | 2 +- .../formats/EncryptedPrefsFormatTest.kt | 14 +++---- .../formats/SingleStringStorage.kt | 2 +- 55 files changed, 204 insertions(+), 203 deletions(-) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/AndroidPermissionImpl.kt (98%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/activities/DaggerAppCompatActivityWithResult.kt (92%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/activities/OptimizationPermissionContract.kt (92%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/activities/SingleFragmentActivity.kt (92%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/configBuilder/ConfigBuilderFragment.kt (97%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/configBuilder/ConfigBuilderPlugin.kt (99%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/configBuilder/RunningConfigurationImpl.kt (98%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/configBuilder/events/EventConfigBuilderUpdateGui.kt (64%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/di/ConfigurationModule.kt (69%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/di/SetupWizardModule.kt (55%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/maintenance/CustomWatchfaceFileContract.kt (77%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/maintenance/ImportExportPrefsImpl.kt (96%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/maintenance/MaintenanceFragment.kt (97%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/maintenance/MaintenancePlugin.kt (99%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/maintenance/PrefFileListProviderImpl.kt (97%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/maintenance/PrefsFileContract.kt (86%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/maintenance/PrefsMetadataKeyImpl.kt (92%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/maintenance/activities/CustomWatchfaceImportListActivity.kt (96%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/maintenance/activities/LogSettingActivity.kt (91%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/maintenance/activities/PrefImportListActivity.kt (90%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/maintenance/data/PrefsFormat.kt (93%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/maintenance/dialogs/PrefImportSummaryDialog.kt (96%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/maintenance/formats/EncryptedPrefsFormat.kt (94%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/SWDefinition.kt (95%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/SWEventListener.kt (94%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/SWScreen.kt (90%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/SetupWizardActivity.kt (93%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/elements/SWBreak.kt (93%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/elements/SWButton.kt (95%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/elements/SWEditEncryptedPassword.kt (98%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/elements/SWEditIntNumber.kt (97%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/elements/SWEditNumber.kt (97%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/elements/SWEditNumberWithUnits.kt (97%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/elements/SWEditString.kt (97%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/elements/SWEditUrl.kt (93%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/elements/SWFragment.kt (82%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/elements/SWHtmlLink.kt (95%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/elements/SWInfoText.kt (94%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/elements/SWItem.kt (98%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/elements/SWPlugin.kt (91%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/elements/SWPreference.kt (90%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/elements/SWRadioButton.kt (97%) rename plugins/configuration/src/main/kotlin/app/aaps/{ => plugins}/configuration/setupwizard/events/EventSWLabel.kt (62%) diff --git a/app/src/main/kotlin/app/aaps/MainActivity.kt b/app/src/main/kotlin/app/aaps/MainActivity.kt index 901ffd821f..96744efb95 100644 --- a/app/src/main/kotlin/app/aaps/MainActivity.kt +++ b/app/src/main/kotlin/app/aaps/MainActivity.kt @@ -31,9 +31,6 @@ import androidx.core.view.MenuProvider import androidx.viewpager2.widget.ViewPager2 import app.aaps.activities.HistoryBrowseActivity import app.aaps.activities.PreferencesActivity -import app.aaps.configuration.activities.DaggerAppCompatActivityWithResult -import app.aaps.configuration.activities.SingleFragmentActivity -import app.aaps.configuration.setupwizard.SetupWizardActivity import app.aaps.core.interfaces.androidPermissions.AndroidPermission import app.aaps.core.interfaces.aps.Loop import app.aaps.core.interfaces.configuration.Config @@ -62,6 +59,9 @@ import app.aaps.core.ui.toast.ToastUtils import app.aaps.core.utils.isRunningRealPumpTest import app.aaps.database.entities.UserEntry.Action import app.aaps.database.entities.UserEntry.Sources +import app.aaps.plugins.configuration.activities.DaggerAppCompatActivityWithResult +import app.aaps.plugins.configuration.activities.SingleFragmentActivity +import app.aaps.plugins.configuration.setupwizard.SetupWizardActivity import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.tabs.TabLayoutMediator import com.google.firebase.crashlytics.FirebaseCrashlytics @@ -209,8 +209,8 @@ class MainActivity : DaggerAppCompatActivityWithResult() { R.id.nav_about -> { var message = "Build: ${BuildConfig.BUILDVERSION}\n" message += "Flavor: ${BuildConfig.FLAVOR}${BuildConfig.BUILD_TYPE}\n" - message += "${rh.gs(app.aaps.configuration.R.string.configbuilder_nightscoutversion_label)} ${activePlugin.activeNsClient?.detectedNsVersion() ?: rh.gs(info.nightscout.plugins.R.string.not_available_full)}" - if (config.isEngineeringMode()) message += "\n${rh.gs(app.aaps.configuration.R.string.engineering_mode_enabled)}" + message += "${rh.gs(app.aaps.plugins.configuration.R.string.configbuilder_nightscoutversion_label)} ${activePlugin.activeNsClient?.detectedNsVersion() ?: rh.gs(info.nightscout.plugins.R.string.not_available_full)}" + if (config.isEngineeringMode()) message += "\n${rh.gs(app.aaps.plugins.configuration.R.string.engineering_mode_enabled)}" if (config.isUnfinishedMode()) message += "\nUnfinished mode enabled" if (!fabricPrivacy.fabricEnabled()) message += "\n${rh.gs(app.aaps.core.ui.R.string.fabric_upload_disabled)}" message += rh.gs(app.aaps.core.ui.R.string.about_link_urls) @@ -309,7 +309,7 @@ class MainActivity : DaggerAppCompatActivityWithResult() { } private fun startWizard(): Boolean = - !sp.getBoolean(app.aaps.configuration.R.string.key_setupwizard_processed, false) + !sp.getBoolean(app.aaps.plugins.configuration.R.string.key_setupwizard_processed, false) override fun onPostCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) { super.onPostCreate(savedInstanceState, persistentState) diff --git a/app/src/main/kotlin/app/aaps/MainApp.kt b/app/src/main/kotlin/app/aaps/MainApp.kt index aca19f24b5..4eeb983dd0 100644 --- a/app/src/main/kotlin/app/aaps/MainApp.kt +++ b/app/src/main/kotlin/app/aaps/MainApp.kt @@ -225,8 +225,8 @@ class MainApp : DaggerApplication() { } if (!sp.contains(info.nightscout.plugins.sync.R.string.key_ns_log_app_started_event)) sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_log_app_started_event, config.APS) - if (sp.getString(app.aaps.configuration.R.string.key_maintenance_logs_email, "") == "logs@androidaps.org") - sp.putString(app.aaps.configuration.R.string.key_maintenance_logs_email, "logs@aaps.app") + if (sp.getString(app.aaps.plugins.configuration.R.string.key_maintenance_logs_email, "") == "logs@androidaps.org") + sp.putString(app.aaps.plugins.configuration.R.string.key_maintenance_logs_email, "logs@aaps.app") // fix values for theme switching sp.putString(info.nightscout.plugins.R.string.value_dark_theme, "dark") sp.putString(info.nightscout.plugins.R.string.value_light_theme, "light") diff --git a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt index b47eab04d2..c71b7eda1f 100644 --- a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt @@ -15,7 +15,6 @@ import androidx.preference.PreferenceGroup import androidx.preference.PreferenceManager import androidx.preference.PreferenceScreen import androidx.preference.size -import app.aaps.configuration.maintenance.MaintenancePlugin import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.nsclient.NSSettingsStatus import app.aaps.core.interfaces.plugin.PluginBase @@ -39,6 +38,7 @@ 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 app.aaps.plugins.configuration.maintenance.MaintenancePlugin import dagger.android.support.AndroidSupportInjection import info.nightscout.androidaps.R import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin @@ -226,7 +226,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang addPreferencesFromResourceIfEnabled(wearPlugin, rootKey) addPreferencesFromResourceIfEnabled(statusLinePlugin, rootKey) addPreferencesFromResource(R.xml.pref_alerts, rootKey) - addPreferencesFromResource(app.aaps.configuration.R.xml.pref_datachoices, rootKey) + addPreferencesFromResource(app.aaps.plugins.configuration.R.xml.pref_datachoices, rootKey) addPreferencesFromResourceIfEnabled(maintenancePlugin, rootKey) addPreferencesFromResourceIfEnabled(openHumansUploaderPlugin, rootKey) } @@ -252,7 +252,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang } if (key == rh.gs(info.nightscout.core.utils.R.string.key_use_autosens) && sp.getBoolean(info.nightscout.core.utils.R.string.key_use_autosens, false)) { activity?.let { - OKDialog.show(it, rh.gs(app.aaps.configuration.R.string.configbuilder_sensitivity), rh.gs(R.string.sensitivity_warning)) + OKDialog.show(it, rh.gs(app.aaps.plugins.configuration.R.string.configbuilder_sensitivity), rh.gs(R.string.sensitivity_warning)) } } checkForBiometricFallback(key) @@ -278,7 +278,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang activity?.let { val title = rh.gs(app.aaps.core.ui.R.string.unsecure_fallback_biometric) val message = - rh.gs(app.aaps.configuration.R.string.master_password_missing, rh.gs(app.aaps.configuration.R.string.configbuilder_general), rh.gs(app.aaps.configuration.R.string.protection)) + rh.gs(app.aaps.plugins.configuration.R.string.master_password_missing, rh.gs(app.aaps.plugins.configuration.R.string.configbuilder_general), rh.gs(app.aaps.plugins.configuration.R.string.protection)) OKDialog.show(it, title = title, message = message) } } @@ -439,7 +439,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang context?.let { context -> when (preference.key) { rh.gs(info.nightscout.core.utils.R.string.key_master_password) -> { - passwordCheck.queryPassword(context, app.aaps.configuration.R.string.current_master_password, info.nightscout.core.utils.R.string.key_master_password, { + passwordCheck.queryPassword(context, app.aaps.plugins.configuration.R.string.current_master_password, info.nightscout.core.utils.R.string.key_master_password, { passwordCheck.setPassword(context, app.aaps.core.ui.R.string.master_password, info.nightscout.core.utils.R.string.key_master_password) }) true diff --git a/app/src/main/kotlin/app/aaps/activities/PreferencesActivity.kt b/app/src/main/kotlin/app/aaps/activities/PreferencesActivity.kt index 2115ee0f80..656146f503 100644 --- a/app/src/main/kotlin/app/aaps/activities/PreferencesActivity.kt +++ b/app/src/main/kotlin/app/aaps/activities/PreferencesActivity.kt @@ -8,7 +8,7 @@ import androidx.appcompat.widget.SearchView import androidx.core.view.MenuProvider import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceScreen -import app.aaps.configuration.activities.DaggerAppCompatActivityWithResult +import app.aaps.plugins.configuration.activities.DaggerAppCompatActivityWithResult import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.ActivityPreferencesBinding @@ -25,7 +25,7 @@ class PreferencesActivity : DaggerAppCompatActivityWithResult(), PreferenceFragm binding = ActivityPreferencesBinding.inflate(layoutInflater) setContentView(binding.root) - title = rh.gs(app.aaps.configuration.R.string.nav_preferences) + title = rh.gs(app.aaps.plugins.configuration.R.string.nav_preferences) supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayShowHomeEnabled(true) myPreferenceFragment = MyPreferenceFragment() diff --git a/app/src/main/kotlin/app/aaps/di/AppComponent.kt b/app/src/main/kotlin/app/aaps/di/AppComponent.kt index ae16146a17..4971b924a5 100644 --- a/app/src/main/kotlin/app/aaps/di/AppComponent.kt +++ b/app/src/main/kotlin/app/aaps/di/AppComponent.kt @@ -1,12 +1,12 @@ package app.aaps.di import app.aaps.MainApp -import app.aaps.configuration.di.ConfigurationModule 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.plugins.configuration.di.ConfigurationModule import app.aaps.shared.impl.di.SharedImplModule import dagger.BindsInstance import dagger.Component diff --git a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt index c518705f4f..a89810a1a5 100644 --- a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt +++ b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt @@ -1,7 +1,5 @@ package app.aaps.di -import app.aaps.configuration.configBuilder.ConfigBuilderPlugin -import app.aaps.configuration.maintenance.MaintenancePlugin import app.aaps.core.interfaces.plugin.PluginBase import app.aaps.plugins.aps.autotune.AutotunePlugin import app.aaps.plugins.aps.loop.LoopPlugin @@ -9,6 +7,8 @@ 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 app.aaps.plugins.configuration.configBuilder.ConfigBuilderPlugin +import app.aaps.plugins.configuration.maintenance.MaintenancePlugin import dagger.Binds import dagger.Module import dagger.multibindings.IntKey diff --git a/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt b/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt index 575947b15c..b367e1aff0 100644 --- a/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt +++ b/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt @@ -10,15 +10,15 @@ import app.aaps.MainActivity import app.aaps.activities.HistoryBrowseActivity import app.aaps.activities.MyPreferenceFragment import app.aaps.activities.PreferencesActivity -import app.aaps.configuration.activities.SingleFragmentActivity -import app.aaps.core.main.events.EventNewNotification import app.aaps.core.interfaces.notifications.Notification import app.aaps.core.interfaces.nsclient.NSAlarm import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.ui.UiInteraction +import app.aaps.core.main.events.EventNewNotification +import app.aaps.core.ui.toast.ToastUtils +import app.aaps.plugins.configuration.activities.SingleFragmentActivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import app.aaps.core.ui.toast.ToastUtils import info.nightscout.plugins.general.overview.notifications.NotificationWithAction import info.nightscout.ui.activities.BolusProgressHelperActivity import info.nightscout.ui.activities.ErrorHelperActivity diff --git a/app/src/main/kotlin/app/aaps/receivers/KeepAliveWorker.kt b/app/src/main/kotlin/app/aaps/receivers/KeepAliveWorker.kt index 4bef277f54..0483f61d56 100644 --- a/app/src/main/kotlin/app/aaps/receivers/KeepAliveWorker.kt +++ b/app/src/main/kotlin/app/aaps/receivers/KeepAliveWorker.kt @@ -9,9 +9,6 @@ import androidx.work.WorkManager import androidx.work.WorkQuery import androidx.work.WorkerParameters import androidx.work.workDataOf -import app.aaps.configuration.maintenance.MaintenancePlugin -import app.aaps.core.main.profile.ProfileSealed -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.alerts.LocalAlertUtils import app.aaps.core.interfaces.aps.Loop import app.aaps.core.interfaces.configuration.Config @@ -27,6 +24,9 @@ import app.aaps.core.interfaces.rx.events.EventProfileSwitchChanged 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.profile.ProfileSealed +import app.aaps.core.main.utils.worker.LoggingWorker +import app.aaps.plugins.configuration.maintenance.MaintenancePlugin import com.google.common.util.concurrent.ListenableFuture import info.nightscout.androidaps.R import info.nightscout.database.impl.AppRepository diff --git a/app/src/test/kotlin/app/aaps/configuration/maintenance/MaintenancePluginTest.kt b/app/src/test/kotlin/app/aaps/configuration/maintenance/MaintenancePluginTest.kt index c0cf316d28..75aae777f1 100644 --- a/app/src/test/kotlin/app/aaps/configuration/maintenance/MaintenancePluginTest.kt +++ b/app/src/test/kotlin/app/aaps/configuration/maintenance/MaintenancePluginTest.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.maintenance +package app.aaps.plugins.configuration.maintenance import android.content.Context import app.aaps.core.interfaces.configuration.Config diff --git a/plugins/configuration/build.gradle b/plugins/configuration/build.gradle index b2ce9b4cae..cb33277adb 100644 --- a/plugins/configuration/build.gradle +++ b/plugins/configuration/build.gradle @@ -11,8 +11,9 @@ apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/main/test_dependencies.gradle" apply from: "${project.rootDir}/core/main/jacoco_global.gradle" + android { - namespace 'app.aaps.configuration' + namespace 'app.aaps.plugins.configuration' } diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/AndroidPermissionImpl.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/AndroidPermissionImpl.kt similarity index 98% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/AndroidPermissionImpl.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/AndroidPermissionImpl.kt index d5c9193894..bb1f7a1a0a 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/AndroidPermissionImpl.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/AndroidPermissionImpl.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration +package app.aaps.plugins.configuration import android.Manifest import android.annotation.SuppressLint @@ -13,7 +13,6 @@ import android.os.PowerManager import android.provider.Settings import androidx.core.content.ContextCompat import androidx.fragment.app.FragmentActivity -import app.aaps.configuration.activities.DaggerAppCompatActivityWithResult import app.aaps.core.interfaces.androidPermissions.AndroidPermission import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.notifications.Notification @@ -22,6 +21,7 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.smsCommunicator.SmsCommunicator import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.toast.ToastUtils +import app.aaps.plugins.configuration.activities.DaggerAppCompatActivityWithResult import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/activities/DaggerAppCompatActivityWithResult.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/activities/DaggerAppCompatActivityWithResult.kt similarity index 92% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/activities/DaggerAppCompatActivityWithResult.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/activities/DaggerAppCompatActivityWithResult.kt index 465feb5901..bcd52c2e03 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/activities/DaggerAppCompatActivityWithResult.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/activities/DaggerAppCompatActivityWithResult.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.activities +package app.aaps.plugins.configuration.activities import android.Manifest import android.content.Context @@ -6,18 +6,18 @@ import android.content.pm.PackageManager import android.os.Bundle import androidx.activity.result.contract.ActivityResultContracts import androidx.core.app.ActivityCompat -import app.aaps.configuration.R -import app.aaps.configuration.maintenance.CustomWatchfaceFileContract -import app.aaps.configuration.maintenance.PrefsFileContract import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.maintenance.ImportExportPrefs import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventThemeSwitch -import dagger.android.support.DaggerAppCompatActivity import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.locale.LocaleHelper +import app.aaps.plugins.configuration.R +import app.aaps.plugins.configuration.maintenance.CustomWatchfaceFileContract +import app.aaps.plugins.configuration.maintenance.PrefsFileContract +import dagger.android.support.DaggerAppCompatActivity import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/activities/OptimizationPermissionContract.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/activities/OptimizationPermissionContract.kt similarity index 92% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/activities/OptimizationPermissionContract.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/activities/OptimizationPermissionContract.kt index 9a379dd8ac..e77ab9e735 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/activities/OptimizationPermissionContract.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/activities/OptimizationPermissionContract.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.activities +package app.aaps.plugins.configuration.activities import android.content.Context import android.content.Intent diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/activities/SingleFragmentActivity.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/activities/SingleFragmentActivity.kt similarity index 92% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/activities/SingleFragmentActivity.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/activities/SingleFragmentActivity.kt index 40a174d79f..0f2886ff0f 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/activities/SingleFragmentActivity.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/activities/SingleFragmentActivity.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.activities +package app.aaps.plugins.configuration.activities import android.content.Intent import android.os.Bundle @@ -6,11 +6,11 @@ import android.view.Menu import android.view.MenuInflater import android.view.MenuItem import androidx.core.view.MenuProvider -import app.aaps.configuration.R import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.plugin.PluginBase import app.aaps.core.interfaces.protection.ProtectionCheck import app.aaps.core.interfaces.ui.UiInteraction +import app.aaps.plugins.configuration.R import javax.inject.Inject class SingleFragmentActivity : DaggerAppCompatActivityWithResult() { @@ -52,7 +52,7 @@ class SingleFragmentActivity : DaggerAppCompatActivityWithResult() { R.id.nav_plugin_preferences -> { protectionCheck.queryProtection(this@SingleFragmentActivity, ProtectionCheck.Protection.PREFERENCES, { val i = Intent(this@SingleFragmentActivity, uiInteraction.preferencesActivity) - .setAction("app.aaps.configuration.activities.SingleFragmentActivity") + .setAction("app.aaps.plugins.configuration.activities.SingleFragmentActivity") .putExtra("id", plugin?.preferencesId) startActivity(i) }, null) diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderFragment.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/configBuilder/ConfigBuilderFragment.kt similarity index 97% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderFragment.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/configBuilder/ConfigBuilderFragment.kt index b98df264a3..471abec321 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderFragment.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/configBuilder/ConfigBuilderFragment.kt @@ -1,13 +1,9 @@ -package app.aaps.configuration.configBuilder +package app.aaps.plugins.configuration.configBuilder import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import app.aaps.configuration.R -import app.aaps.configuration.configBuilder.events.EventConfigBuilderUpdateGui -import app.aaps.configuration.databinding.ConfigbuilderFragmentBinding -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.configuration.ConfigBuilder import app.aaps.core.interfaces.extensions.toVisibility @@ -18,6 +14,10 @@ import app.aaps.core.interfaces.protection.ProtectionCheck.Protection.PREFERENCE import app.aaps.core.interfaces.rx.AapsSchedulers import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.ui.UiInteraction +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.plugins.configuration.R +import app.aaps.plugins.configuration.configBuilder.events.EventConfigBuilderUpdateGui +import app.aaps.plugins.configuration.databinding.ConfigbuilderFragmentBinding import dagger.android.support.DaggerFragment import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderPlugin.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/configBuilder/ConfigBuilderPlugin.kt similarity index 99% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderPlugin.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/configBuilder/ConfigBuilderPlugin.kt index 64a4be1670..3b719d5d5f 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderPlugin.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/configBuilder/ConfigBuilderPlugin.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.configBuilder +package app.aaps.plugins.configuration.configBuilder import android.content.Intent import android.view.LayoutInflater @@ -13,8 +13,6 @@ import androidx.annotation.StringRes import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity -import app.aaps.configuration.R -import app.aaps.configuration.configBuilder.events.EventConfigBuilderUpdateGui import app.aaps.core.interfaces.aps.APS import app.aaps.core.interfaces.aps.Sensitivity import app.aaps.core.interfaces.configuration.ConfigBuilder @@ -45,6 +43,8 @@ import app.aaps.core.ui.dialogs.OKDialog import app.aaps.database.entities.UserEntry.Action import app.aaps.database.entities.UserEntry.Sources import app.aaps.database.entities.ValueWithUnit +import app.aaps.plugins.configuration.R +import app.aaps.plugins.configuration.configBuilder.events.EventConfigBuilderUpdateGui import dagger.android.HasAndroidInjector import java.security.InvalidParameterException import javax.inject.Inject diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/RunningConfigurationImpl.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/configBuilder/RunningConfigurationImpl.kt similarity index 98% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/RunningConfigurationImpl.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/configBuilder/RunningConfigurationImpl.kt index fb7d9f7d8e..ce7f5d9988 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/RunningConfigurationImpl.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/configBuilder/RunningConfigurationImpl.kt @@ -1,6 +1,5 @@ -package app.aaps.configuration.configBuilder +package app.aaps.plugins.configuration.configBuilder -import app.aaps.configuration.R import app.aaps.core.interfaces.aps.Sensitivity import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.configuration.ConfigBuilder @@ -20,6 +19,7 @@ import app.aaps.core.interfaces.smoothing.Smoothing import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.nssdk.interfaces.RunningConfiguration import app.aaps.core.nssdk.localmodel.devicestatus.NSDeviceStatus +import app.aaps.plugins.configuration.R import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/events/EventConfigBuilderUpdateGui.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/configBuilder/events/EventConfigBuilderUpdateGui.kt similarity index 64% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/events/EventConfigBuilderUpdateGui.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/configBuilder/events/EventConfigBuilderUpdateGui.kt index 75119a4f37..69600c52a9 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/events/EventConfigBuilderUpdateGui.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/configBuilder/events/EventConfigBuilderUpdateGui.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.configBuilder.events +package app.aaps.plugins.configuration.configBuilder.events import app.aaps.core.interfaces.rx.events.EventUpdateGui diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/di/ConfigurationModule.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/di/ConfigurationModule.kt similarity index 69% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/di/ConfigurationModule.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/di/ConfigurationModule.kt index b320df72ae..8642502b5d 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/di/ConfigurationModule.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/di/ConfigurationModule.kt @@ -1,25 +1,25 @@ -package app.aaps.configuration.di +package app.aaps.plugins.configuration.di -import app.aaps.configuration.AndroidPermissionImpl -import app.aaps.configuration.activities.SingleFragmentActivity -import app.aaps.configuration.configBuilder.ConfigBuilderFragment -import app.aaps.configuration.configBuilder.ConfigBuilderPlugin -import app.aaps.configuration.configBuilder.RunningConfigurationImpl -import app.aaps.configuration.maintenance.ImportExportPrefsImpl -import app.aaps.configuration.maintenance.MaintenanceFragment -import app.aaps.configuration.maintenance.PrefFileListProviderImpl -import app.aaps.configuration.maintenance.activities.CustomWatchfaceImportListActivity -import app.aaps.configuration.maintenance.activities.LogSettingActivity -import app.aaps.configuration.maintenance.activities.PrefImportListActivity -import app.aaps.configuration.maintenance.formats.EncryptedPrefsFormat import app.aaps.core.interfaces.androidPermissions.AndroidPermission import app.aaps.core.interfaces.configuration.ConfigBuilder import app.aaps.core.interfaces.maintenance.ImportExportPrefs import app.aaps.core.interfaces.maintenance.PrefFileListProvider +import app.aaps.core.nssdk.interfaces.RunningConfiguration +import app.aaps.plugins.configuration.AndroidPermissionImpl +import app.aaps.plugins.configuration.activities.SingleFragmentActivity +import app.aaps.plugins.configuration.configBuilder.ConfigBuilderFragment +import app.aaps.plugins.configuration.configBuilder.ConfigBuilderPlugin +import app.aaps.plugins.configuration.configBuilder.RunningConfigurationImpl +import app.aaps.plugins.configuration.maintenance.ImportExportPrefsImpl +import app.aaps.plugins.configuration.maintenance.MaintenanceFragment +import app.aaps.plugins.configuration.maintenance.PrefFileListProviderImpl +import app.aaps.plugins.configuration.maintenance.activities.CustomWatchfaceImportListActivity +import app.aaps.plugins.configuration.maintenance.activities.LogSettingActivity +import app.aaps.plugins.configuration.maintenance.activities.PrefImportListActivity +import app.aaps.plugins.configuration.maintenance.formats.EncryptedPrefsFormat import dagger.Binds import dagger.Module import dagger.android.ContributesAndroidInjector -import app.aaps.core.nssdk.interfaces.RunningConfiguration @Module( includes = [ diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/di/SetupWizardModule.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/di/SetupWizardModule.kt similarity index 55% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/di/SetupWizardModule.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/di/SetupWizardModule.kt index b75ee642cd..254109d6c5 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/di/SetupWizardModule.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/di/SetupWizardModule.kt @@ -1,23 +1,23 @@ -package app.aaps.configuration.di +package app.aaps.plugins.configuration.di -import app.aaps.configuration.setupwizard.SWEventListener -import app.aaps.configuration.setupwizard.SWScreen -import app.aaps.configuration.setupwizard.SetupWizardActivity -import app.aaps.configuration.setupwizard.elements.SWBreak -import app.aaps.configuration.setupwizard.elements.SWButton -import app.aaps.configuration.setupwizard.elements.SWEditEncryptedPassword -import app.aaps.configuration.setupwizard.elements.SWEditIntNumber -import app.aaps.configuration.setupwizard.elements.SWEditNumber -import app.aaps.configuration.setupwizard.elements.SWEditNumberWithUnits -import app.aaps.configuration.setupwizard.elements.SWEditString -import app.aaps.configuration.setupwizard.elements.SWEditUrl -import app.aaps.configuration.setupwizard.elements.SWFragment -import app.aaps.configuration.setupwizard.elements.SWHtmlLink -import app.aaps.configuration.setupwizard.elements.SWInfoText -import app.aaps.configuration.setupwizard.elements.SWItem -import app.aaps.configuration.setupwizard.elements.SWPlugin -import app.aaps.configuration.setupwizard.elements.SWPreference -import app.aaps.configuration.setupwizard.elements.SWRadioButton +import app.aaps.plugins.configuration.setupwizard.SWEventListener +import app.aaps.plugins.configuration.setupwizard.SWScreen +import app.aaps.plugins.configuration.setupwizard.SetupWizardActivity +import app.aaps.plugins.configuration.setupwizard.elements.SWBreak +import app.aaps.plugins.configuration.setupwizard.elements.SWButton +import app.aaps.plugins.configuration.setupwizard.elements.SWEditEncryptedPassword +import app.aaps.plugins.configuration.setupwizard.elements.SWEditIntNumber +import app.aaps.plugins.configuration.setupwizard.elements.SWEditNumber +import app.aaps.plugins.configuration.setupwizard.elements.SWEditNumberWithUnits +import app.aaps.plugins.configuration.setupwizard.elements.SWEditString +import app.aaps.plugins.configuration.setupwizard.elements.SWEditUrl +import app.aaps.plugins.configuration.setupwizard.elements.SWFragment +import app.aaps.plugins.configuration.setupwizard.elements.SWHtmlLink +import app.aaps.plugins.configuration.setupwizard.elements.SWInfoText +import app.aaps.plugins.configuration.setupwizard.elements.SWItem +import app.aaps.plugins.configuration.setupwizard.elements.SWPlugin +import app.aaps.plugins.configuration.setupwizard.elements.SWPreference +import app.aaps.plugins.configuration.setupwizard.elements.SWRadioButton import dagger.Module import dagger.android.ContributesAndroidInjector diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/CustomWatchfaceFileContract.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/CustomWatchfaceFileContract.kt similarity index 77% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/CustomWatchfaceFileContract.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/CustomWatchfaceFileContract.kt index dbb4703d1b..916bf49b6b 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/CustomWatchfaceFileContract.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/CustomWatchfaceFileContract.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.maintenance +package app.aaps.plugins.configuration.maintenance import android.content.Context import android.content.Intent @@ -20,6 +20,6 @@ class CustomWatchfaceFileContract : ActivityResultContract() { } override fun createIntent(context: Context, input: Void?): Intent { - return Intent(context, app.aaps.configuration.maintenance.activities.CustomWatchfaceImportListActivity::class.java) + return Intent(context, app.aaps.plugins.configuration.maintenance.activities.CustomWatchfaceImportListActivity::class.java) } } \ No newline at end of file diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/ImportExportPrefsImpl.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/ImportExportPrefsImpl.kt similarity index 96% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/ImportExportPrefsImpl.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/ImportExportPrefsImpl.kt index 2ab11b3515..88b50cd70c 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/ImportExportPrefsImpl.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/ImportExportPrefsImpl.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.maintenance +package app.aaps.plugins.configuration.maintenance import android.Manifest import android.bluetooth.BluetoothManager @@ -18,15 +18,6 @@ import androidx.work.OneTimeWorkRequest import androidx.work.WorkManager import androidx.work.WorkerParameters import androidx.work.workDataOf -import app.aaps.configuration.R -import app.aaps.configuration.activities.DaggerAppCompatActivityWithResult -import app.aaps.configuration.maintenance.data.PrefFileNotFoundError -import app.aaps.configuration.maintenance.data.PrefIOError -import app.aaps.configuration.maintenance.data.Prefs -import app.aaps.configuration.maintenance.data.PrefsFormat -import app.aaps.configuration.maintenance.data.PrefsStatusImpl -import app.aaps.configuration.maintenance.dialogs.PrefImportSummaryDialog -import app.aaps.configuration.maintenance.formats.EncryptedPrefsFormat import app.aaps.core.interfaces.androidPermissions.AndroidPermission import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.db.PersistenceLayer @@ -61,6 +52,15 @@ import app.aaps.core.ui.toast.ToastUtils import app.aaps.database.entities.UserEntry import app.aaps.database.entities.UserEntry.Action import app.aaps.database.entities.UserEntry.Sources +import app.aaps.plugins.configuration.R +import app.aaps.plugins.configuration.activities.DaggerAppCompatActivityWithResult +import app.aaps.plugins.configuration.maintenance.data.PrefFileNotFoundError +import app.aaps.plugins.configuration.maintenance.data.PrefIOError +import app.aaps.plugins.configuration.maintenance.data.Prefs +import app.aaps.plugins.configuration.maintenance.data.PrefsFormat +import app.aaps.plugins.configuration.maintenance.data.PrefsStatusImpl +import app.aaps.plugins.configuration.maintenance.dialogs.PrefImportSummaryDialog +import app.aaps.plugins.configuration.maintenance.formats.EncryptedPrefsFormat import dagger.android.HasAndroidInjector import kotlinx.coroutines.Dispatchers import java.io.File diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenanceFragment.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/MaintenanceFragment.kt similarity index 97% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenanceFragment.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/MaintenanceFragment.kt index c86042b276..06c7369772 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenanceFragment.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/MaintenanceFragment.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.maintenance +package app.aaps.plugins.configuration.maintenance import android.content.Intent import android.os.Bundle @@ -6,9 +6,6 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.core.text.toSpanned -import app.aaps.configuration.R -import app.aaps.configuration.databinding.MaintenanceFragmentBinding -import app.aaps.configuration.maintenance.activities.LogSettingActivity import app.aaps.core.interfaces.db.PersistenceLayer import app.aaps.core.interfaces.extensions.runOnUiThread import app.aaps.core.interfaces.extensions.toVisibility @@ -34,6 +31,9 @@ import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.utils.HtmlHelper import app.aaps.database.entities.UserEntry.Action import app.aaps.database.entities.UserEntry.Sources +import app.aaps.plugins.configuration.R +import app.aaps.plugins.configuration.databinding.MaintenanceFragmentBinding +import app.aaps.plugins.configuration.maintenance.activities.LogSettingActivity import dagger.android.support.DaggerFragment import io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenancePlugin.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/MaintenancePlugin.kt similarity index 99% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenancePlugin.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/MaintenancePlugin.kt index 6e2a406429..9b373f07d3 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenancePlugin.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/MaintenancePlugin.kt @@ -1,10 +1,9 @@ -package app.aaps.configuration.maintenance +package app.aaps.plugins.configuration.maintenance import android.content.Context import android.content.Intent import android.net.Uri import androidx.core.content.FileProvider -import app.aaps.configuration.R import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LoggerUtils @@ -15,6 +14,7 @@ import app.aaps.core.interfaces.plugin.PluginDescription import app.aaps.core.interfaces.plugin.PluginType import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.plugins.configuration.R import dagger.android.HasAndroidInjector import java.io.BufferedInputStream import java.io.BufferedOutputStream diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefFileListProviderImpl.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/PrefFileListProviderImpl.kt similarity index 97% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefFileListProviderImpl.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/PrefFileListProviderImpl.kt index 4945d7b8c3..a903ec8973 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefFileListProviderImpl.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/PrefFileListProviderImpl.kt @@ -1,12 +1,8 @@ -package app.aaps.configuration.maintenance +package app.aaps.plugins.configuration.maintenance import android.content.Context import android.os.Environment import app.aaps.annotations.OpenForTesting -import app.aaps.configuration.R -import app.aaps.configuration.maintenance.data.PrefMetadataMap -import app.aaps.configuration.maintenance.data.PrefsStatusImpl -import app.aaps.configuration.maintenance.formats.EncryptedPrefsFormat import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.maintenance.PrefFileListProvider import app.aaps.core.interfaces.maintenance.PrefMetadata @@ -21,6 +17,10 @@ import app.aaps.core.interfaces.rx.weardata.ZipWatchfaceFormat import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.storage.Storage import app.aaps.core.interfaces.versionChecker.VersionCheckerUtils +import app.aaps.plugins.configuration.R +import app.aaps.plugins.configuration.maintenance.data.PrefMetadataMap +import app.aaps.plugins.configuration.maintenance.data.PrefsStatusImpl +import app.aaps.plugins.configuration.maintenance.formats.EncryptedPrefsFormat import dagger.Lazy import dagger.Reusable import org.joda.time.DateTime diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefsFileContract.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/PrefsFileContract.kt similarity index 86% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefsFileContract.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/PrefsFileContract.kt index 7875727f92..c0271dc050 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefsFileContract.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/PrefsFileContract.kt @@ -1,12 +1,12 @@ -package app.aaps.configuration.maintenance +package app.aaps.plugins.configuration.maintenance import android.content.Context import android.content.Intent import androidx.activity.result.contract.ActivityResultContract import androidx.fragment.app.FragmentActivity -import app.aaps.configuration.maintenance.activities.PrefImportListActivity import app.aaps.core.interfaces.maintenance.PrefsFile import app.aaps.core.utils.extensions.safeGetParcelableExtra +import app.aaps.plugins.configuration.maintenance.activities.PrefImportListActivity class PrefsFileContract : ActivityResultContract() { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefsMetadataKeyImpl.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/PrefsMetadataKeyImpl.kt similarity index 92% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefsMetadataKeyImpl.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/PrefsMetadataKeyImpl.kt index c08e822e99..1ce2601e2e 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefsMetadataKeyImpl.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/PrefsMetadataKeyImpl.kt @@ -1,11 +1,11 @@ -package app.aaps.configuration.maintenance +package app.aaps.plugins.configuration.maintenance import android.content.Context import androidx.annotation.DrawableRes import androidx.annotation.StringRes -import app.aaps.configuration.R -import app.aaps.configuration.maintenance.data.PrefsFormat import app.aaps.core.interfaces.maintenance.PrefsMetadataKey +import app.aaps.plugins.configuration.R +import app.aaps.plugins.configuration.maintenance.data.PrefsFormat enum class PrefsMetadataKeyImpl(override val key: String, @DrawableRes override val icon: Int, @StringRes override val label: Int) : PrefsMetadataKey { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/CustomWatchfaceImportListActivity.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/activities/CustomWatchfaceImportListActivity.kt similarity index 96% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/CustomWatchfaceImportListActivity.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/activities/CustomWatchfaceImportListActivity.kt index 5e3a2fb277..f03eead2f7 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/CustomWatchfaceImportListActivity.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/activities/CustomWatchfaceImportListActivity.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.maintenance.activities +package app.aaps.plugins.configuration.maintenance.activities import android.content.Intent import android.os.Bundle @@ -7,9 +7,6 @@ import android.view.ViewGroup import androidx.fragment.app.FragmentActivity import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import app.aaps.configuration.R -import app.aaps.configuration.databinding.CustomWatchfaceImportListActivityBinding -import app.aaps.configuration.databinding.CustomWatchfaceImportListItemBinding import app.aaps.core.interfaces.extensions.toVisibility import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.maintenance.PrefFileListProvider @@ -31,6 +28,9 @@ import app.aaps.core.interfaces.rx.weardata.ZipWatchfaceFormat import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.versionChecker.VersionCheckerUtils import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity +import app.aaps.plugins.configuration.R +import app.aaps.plugins.configuration.databinding.CustomWatchfaceImportListActivityBinding +import app.aaps.plugins.configuration.databinding.CustomWatchfaceImportListItemBinding import javax.inject.Inject class CustomWatchfaceImportListActivity : TranslatedDaggerAppCompatActivity() { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/LogSettingActivity.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/activities/LogSettingActivity.kt similarity index 91% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/LogSettingActivity.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/activities/LogSettingActivity.kt index e4a6199445..b4d35e8884 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/LogSettingActivity.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/activities/LogSettingActivity.kt @@ -1,16 +1,16 @@ -package app.aaps.configuration.maintenance.activities +package app.aaps.plugins.configuration.maintenance.activities import android.os.Bundle import android.view.View import android.widget.CheckBox import android.widget.LinearLayout import android.widget.TextView -import app.aaps.configuration.R -import app.aaps.configuration.databinding.ActivityLogsettingBinding import app.aaps.core.interfaces.logging.L import app.aaps.core.interfaces.logging.LogElement import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity +import app.aaps.plugins.configuration.R +import app.aaps.plugins.configuration.databinding.ActivityLogsettingBinding import javax.inject.Inject class LogSettingActivity : TranslatedDaggerAppCompatActivity() { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/PrefImportListActivity.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/activities/PrefImportListActivity.kt similarity index 90% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/PrefImportListActivity.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/activities/PrefImportListActivity.kt index 312ddcb4b2..6e5149203d 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/PrefImportListActivity.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/activities/PrefImportListActivity.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.maintenance.activities +package app.aaps.plugins.configuration.maintenance.activities import android.content.Intent import android.os.Bundle @@ -8,16 +8,16 @@ import android.view.ViewGroup import androidx.fragment.app.FragmentActivity import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import app.aaps.configuration.R -import app.aaps.configuration.databinding.MaintenanceImportListActivityBinding -import app.aaps.configuration.databinding.MaintenanceImportListItemBinding -import app.aaps.configuration.maintenance.PrefsFileContract -import app.aaps.configuration.maintenance.PrefsMetadataKeyImpl -import app.aaps.configuration.maintenance.data.PrefsStatusImpl import app.aaps.core.interfaces.maintenance.PrefFileListProvider import app.aaps.core.interfaces.maintenance.PrefsFile import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity +import app.aaps.plugins.configuration.R +import app.aaps.plugins.configuration.databinding.MaintenanceImportListActivityBinding +import app.aaps.plugins.configuration.databinding.MaintenanceImportListItemBinding +import app.aaps.plugins.configuration.maintenance.PrefsFileContract +import app.aaps.plugins.configuration.maintenance.PrefsMetadataKeyImpl +import app.aaps.plugins.configuration.maintenance.data.PrefsStatusImpl import javax.inject.Inject class PrefImportListActivity : TranslatedDaggerAppCompatActivity() { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/data/PrefsFormat.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/data/PrefsFormat.kt similarity index 93% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/data/PrefsFormat.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/data/PrefsFormat.kt index dfc9eb0b23..ab19c86665 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/data/PrefsFormat.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/data/PrefsFormat.kt @@ -1,10 +1,10 @@ -package app.aaps.configuration.maintenance.data +package app.aaps.plugins.configuration.maintenance.data import androidx.annotation.DrawableRes -import app.aaps.configuration.R import app.aaps.core.interfaces.maintenance.PrefMetadata import app.aaps.core.interfaces.maintenance.PrefsMetadataKey import app.aaps.core.interfaces.maintenance.PrefsStatus +import app.aaps.plugins.configuration.R import kotlinx.parcelize.Parcelize import java.io.File diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/dialogs/PrefImportSummaryDialog.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/dialogs/PrefImportSummaryDialog.kt similarity index 96% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/dialogs/PrefImportSummaryDialog.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/dialogs/PrefImportSummaryDialog.kt index cbdf7e0b6e..8012929956 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/dialogs/PrefImportSummaryDialog.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/dialogs/PrefImportSummaryDialog.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.maintenance.dialogs +package app.aaps.plugins.configuration.maintenance.dialogs import android.annotation.SuppressLint import android.content.Context @@ -16,12 +16,12 @@ import androidx.annotation.DrawableRes import androidx.annotation.StringRes import androidx.annotation.StyleRes import androidx.appcompat.view.ContextThemeWrapper -import app.aaps.configuration.R -import app.aaps.configuration.maintenance.data.Prefs -import app.aaps.configuration.maintenance.data.PrefsStatusImpl import app.aaps.core.interfaces.extensions.runOnUiThread -import com.google.android.material.dialog.MaterialAlertDialogBuilder import app.aaps.core.ui.toast.ToastUtils +import app.aaps.plugins.configuration.R +import app.aaps.plugins.configuration.maintenance.data.Prefs +import app.aaps.plugins.configuration.maintenance.data.PrefsStatusImpl +import com.google.android.material.dialog.MaterialAlertDialogBuilder import java.util.LinkedList object PrefImportSummaryDialog { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/formats/EncryptedPrefsFormat.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/formats/EncryptedPrefsFormat.kt similarity index 94% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/formats/EncryptedPrefsFormat.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/formats/EncryptedPrefsFormat.kt index 349c66851e..b24e7fe503 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/formats/EncryptedPrefsFormat.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/maintenance/formats/EncryptedPrefsFormat.kt @@ -1,14 +1,5 @@ -package app.aaps.configuration.maintenance.formats +package app.aaps.plugins.configuration.maintenance.formats -import app.aaps.configuration.R -import app.aaps.configuration.maintenance.PrefsMetadataKeyImpl -import app.aaps.configuration.maintenance.data.PrefFileNotFoundError -import app.aaps.configuration.maintenance.data.PrefFormatError -import app.aaps.configuration.maintenance.data.PrefIOError -import app.aaps.configuration.maintenance.data.PrefMetadataMap -import app.aaps.configuration.maintenance.data.Prefs -import app.aaps.configuration.maintenance.data.PrefsFormat -import app.aaps.configuration.maintenance.data.PrefsStatusImpl import app.aaps.core.interfaces.maintenance.PrefMetadata import app.aaps.core.interfaces.maintenance.PrefsMetadataKey import app.aaps.core.interfaces.maintenance.PrefsStatus @@ -17,6 +8,15 @@ import app.aaps.core.interfaces.storage.Storage import app.aaps.core.main.utils.CryptoUtil import app.aaps.core.utils.hexStringToByteArray import app.aaps.core.utils.toHex +import app.aaps.plugins.configuration.R +import app.aaps.plugins.configuration.maintenance.PrefsMetadataKeyImpl +import app.aaps.plugins.configuration.maintenance.data.PrefFileNotFoundError +import app.aaps.plugins.configuration.maintenance.data.PrefFormatError +import app.aaps.plugins.configuration.maintenance.data.PrefIOError +import app.aaps.plugins.configuration.maintenance.data.PrefMetadataMap +import app.aaps.plugins.configuration.maintenance.data.Prefs +import app.aaps.plugins.configuration.maintenance.data.PrefsFormat +import app.aaps.plugins.configuration.maintenance.data.PrefsStatusImpl import org.json.JSONException import org.json.JSONObject import java.io.File diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWDefinition.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/SWDefinition.kt similarity index 95% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWDefinition.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/SWDefinition.kt index 30a527c051..59893a6672 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWDefinition.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/SWDefinition.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.setupwizard +package app.aaps.plugins.configuration.setupwizard import android.Manifest import android.content.Context @@ -6,20 +6,6 @@ import android.content.Intent import android.net.Uri import android.provider.Settings import androidx.appcompat.app.AppCompatActivity -import app.aaps.configuration.R -import app.aaps.configuration.setupwizard.elements.SWBreak -import app.aaps.configuration.setupwizard.elements.SWButton -import app.aaps.configuration.setupwizard.elements.SWEditEncryptedPassword -import app.aaps.configuration.setupwizard.elements.SWEditIntNumber -import app.aaps.configuration.setupwizard.elements.SWEditNumber -import app.aaps.configuration.setupwizard.elements.SWEditNumberWithUnits -import app.aaps.configuration.setupwizard.elements.SWEditString -import app.aaps.configuration.setupwizard.elements.SWFragment -import app.aaps.configuration.setupwizard.elements.SWHtmlLink -import app.aaps.configuration.setupwizard.elements.SWInfoText -import app.aaps.configuration.setupwizard.elements.SWPlugin -import app.aaps.configuration.setupwizard.elements.SWPreference -import app.aaps.configuration.setupwizard.elements.SWRadioButton import app.aaps.core.interfaces.androidPermissions.AndroidPermission import app.aaps.core.interfaces.aps.Loop import app.aaps.core.interfaces.configuration.Config @@ -47,6 +33,20 @@ import app.aaps.core.interfaces.utils.HardLimits import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.main.utils.CryptoUtil import app.aaps.core.utils.isRunningTest +import app.aaps.plugins.configuration.R +import app.aaps.plugins.configuration.setupwizard.elements.SWBreak +import app.aaps.plugins.configuration.setupwizard.elements.SWButton +import app.aaps.plugins.configuration.setupwizard.elements.SWEditEncryptedPassword +import app.aaps.plugins.configuration.setupwizard.elements.SWEditIntNumber +import app.aaps.plugins.configuration.setupwizard.elements.SWEditNumber +import app.aaps.plugins.configuration.setupwizard.elements.SWEditNumberWithUnits +import app.aaps.plugins.configuration.setupwizard.elements.SWEditString +import app.aaps.plugins.configuration.setupwizard.elements.SWFragment +import app.aaps.plugins.configuration.setupwizard.elements.SWHtmlLink +import app.aaps.plugins.configuration.setupwizard.elements.SWInfoText +import app.aaps.plugins.configuration.setupwizard.elements.SWPlugin +import app.aaps.plugins.configuration.setupwizard.elements.SWPreference +import app.aaps.plugins.configuration.setupwizard.elements.SWRadioButton import dagger.android.HasAndroidInjector import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWEventListener.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/SWEventListener.kt similarity index 94% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWEventListener.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/SWEventListener.kt index a98614d6a8..79c0d3ee54 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWEventListener.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/SWEventListener.kt @@ -1,13 +1,13 @@ -package app.aaps.configuration.setupwizard +package app.aaps.plugins.configuration.setupwizard import android.annotation.SuppressLint import android.content.Context import android.view.View import android.widget.LinearLayout import android.widget.TextView -import app.aaps.configuration.setupwizard.elements.SWItem import app.aaps.core.interfaces.rx.AapsSchedulers import app.aaps.core.interfaces.rx.events.EventStatus +import app.aaps.plugins.configuration.setupwizard.elements.SWItem import dagger.android.HasAndroidInjector import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWScreen.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/SWScreen.kt similarity index 90% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWScreen.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/SWScreen.kt index be32f6afec..de8497856f 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWScreen.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/SWScreen.kt @@ -1,7 +1,7 @@ -package app.aaps.configuration.setupwizard +package app.aaps.plugins.configuration.setupwizard -import app.aaps.configuration.setupwizard.elements.SWItem import app.aaps.core.interfaces.resources.ResourceHelper +import app.aaps.plugins.configuration.setupwizard.elements.SWItem import dagger.android.HasAndroidInjector import javax.inject.Inject diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SetupWizardActivity.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/SetupWizardActivity.kt similarity index 93% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SetupWizardActivity.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/SetupWizardActivity.kt index a1097b756e..39aff3bd55 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SetupWizardActivity.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/SetupWizardActivity.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.setupwizard +package app.aaps.plugins.configuration.setupwizard import android.content.Intent import android.os.Bundle @@ -9,11 +9,6 @@ import android.view.View import android.widget.TextView import androidx.activity.OnBackPressedCallback import androidx.core.view.MenuProvider -import app.aaps.configuration.R -import app.aaps.configuration.activities.DaggerAppCompatActivityWithResult -import app.aaps.configuration.databinding.ActivitySetupwizardBinding -import app.aaps.configuration.setupwizard.elements.SWItem -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.rx.AapsSchedulers import app.aaps.core.interfaces.rx.events.EventProfileStoreChanged import app.aaps.core.interfaces.rx.events.EventProfileSwitchChanged @@ -23,9 +18,14 @@ import app.aaps.core.interfaces.rx.events.EventSWSyncStatus import app.aaps.core.interfaces.rx.events.EventSWUpdate import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.ui.UiInteraction -import dagger.android.HasAndroidInjector +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.locale.LocaleHelper.update +import app.aaps.plugins.configuration.R +import app.aaps.plugins.configuration.activities.DaggerAppCompatActivityWithResult +import app.aaps.plugins.configuration.databinding.ActivitySetupwizardBinding +import app.aaps.plugins.configuration.setupwizard.elements.SWItem +import dagger.android.HasAndroidInjector import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject @@ -166,7 +166,7 @@ class SetupWizardActivity : DaggerAppCompatActivityWithResult() { @Suppress("UNUSED_PARAMETER") fun showNextPage(view: View?) { finish() - val intent = Intent(this, SetupWizardActivity::class.java).setAction("app.aaps.configuration.setupwizard.SetupWizardActivity") + val intent = Intent(this, SetupWizardActivity::class.java).setAction("app.aaps.plugins.configuration.setupwizard.SetupWizardActivity") intent.putExtra(intentMessage, nextPage(null)) startActivity(intent) } @@ -174,7 +174,7 @@ class SetupWizardActivity : DaggerAppCompatActivityWithResult() { @Suppress("UNUSED_PARAMETER") fun showPreviousPage(view: View?) { finish() - val intent = Intent(this, SetupWizardActivity::class.java).setAction("app.aaps.configuration.setupwizard.SetupWizardActivity") + val intent = Intent(this, SetupWizardActivity::class.java).setAction("app.aaps.plugins.configuration.setupwizard.SetupWizardActivity") intent.putExtra(intentMessage, previousPage(null)) startActivity(intent) } @@ -183,7 +183,7 @@ class SetupWizardActivity : DaggerAppCompatActivityWithResult() { @Suppress("UNUSED_PARAMETER") fun finishSetupWizard(view: View?) { sp.putBoolean(R.string.key_setupwizard_processed, true) - val intent = Intent(this, uiInteraction.mainActivity).setAction("app.aaps.configuration.setupwizard.SetupWizardActivity") + val intent = Intent(this, uiInteraction.mainActivity).setAction("app.aaps.plugins.configuration.setupwizard.SetupWizardActivity") intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) startActivity(intent) finish() diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWBreak.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWBreak.kt similarity index 93% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWBreak.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWBreak.kt index abcac25a95..43a9507aa6 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWBreak.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWBreak.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.setupwizard.elements +package app.aaps.plugins.configuration.setupwizard.elements import android.view.View import android.widget.LinearLayout diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWButton.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWButton.kt similarity index 95% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWButton.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWButton.kt index 0b54ef0339..0c757ba0f0 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWButton.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWButton.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.setupwizard.elements +package app.aaps.plugins.configuration.setupwizard.elements import android.view.View import android.widget.Button diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditEncryptedPassword.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditEncryptedPassword.kt similarity index 98% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditEncryptedPassword.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditEncryptedPassword.kt index f6833f7487..81ebb93e8e 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditEncryptedPassword.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditEncryptedPassword.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.setupwizard.elements +package app.aaps.plugins.configuration.setupwizard.elements import android.graphics.Typeface import android.text.Editable @@ -9,8 +9,8 @@ import android.widget.Button import android.widget.EditText import android.widget.LinearLayout import android.widget.TextView -import app.aaps.core.main.utils.CryptoUtil import app.aaps.core.interfaces.extensions.toVisibility +import app.aaps.core.main.utils.CryptoUtil import dagger.android.HasAndroidInjector class SWEditEncryptedPassword(injector: HasAndroidInjector, private val cryptoUtil: CryptoUtil) : SWItem(injector, Type.STRING) { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditIntNumber.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditIntNumber.kt similarity index 97% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditIntNumber.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditIntNumber.kt index 35efaa0638..05394004a3 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditIntNumber.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditIntNumber.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.setupwizard.elements +package app.aaps.plugins.configuration.setupwizard.elements import android.graphics.Typeface import android.text.Editable @@ -7,8 +7,8 @@ import android.view.View import android.widget.LinearLayout import android.widget.TextView import app.aaps.core.interfaces.utils.SafeParse -import dagger.android.HasAndroidInjector import app.aaps.core.ui.elements.NumberPicker +import dagger.android.HasAndroidInjector import java.text.DecimalFormat class SWEditIntNumber(injector: HasAndroidInjector, private val init: Int, private val min: Int, private val max: Int) : SWItem(injector, Type.NUMBER) { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditNumber.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditNumber.kt similarity index 97% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditNumber.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditNumber.kt index 85b7d58a37..4e2b203b9a 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditNumber.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditNumber.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.setupwizard.elements +package app.aaps.plugins.configuration.setupwizard.elements import android.graphics.Typeface import android.text.Editable @@ -7,8 +7,8 @@ import android.view.View import android.widget.LinearLayout import android.widget.TextView import app.aaps.core.interfaces.utils.SafeParse -import dagger.android.HasAndroidInjector import app.aaps.core.ui.elements.NumberPicker +import dagger.android.HasAndroidInjector import java.text.DecimalFormat class SWEditNumber(injector: HasAndroidInjector, private val init: Double, private val min: Double, private val max: Double) : SWItem(injector, Type.DECIMAL_NUMBER) { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditNumberWithUnits.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditNumberWithUnits.kt similarity index 97% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditNumberWithUnits.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditNumberWithUnits.kt index 4a1a832e00..ed43812cda 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditNumberWithUnits.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditNumberWithUnits.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.setupwizard.elements +package app.aaps.plugins.configuration.setupwizard.elements import android.graphics.Typeface import android.text.Editable @@ -10,8 +10,8 @@ import app.aaps.core.interfaces.configuration.Constants import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.profile.ProfileUtil import app.aaps.core.interfaces.utils.SafeParse -import dagger.android.HasAndroidInjector import app.aaps.core.ui.elements.NumberPicker +import dagger.android.HasAndroidInjector import java.text.DecimalFormat import javax.inject.Inject diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditString.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditString.kt similarity index 97% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditString.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditString.kt index 28e935afe6..6dc25beacc 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditString.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditString.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.setupwizard.elements +package app.aaps.plugins.configuration.setupwizard.elements import android.graphics.Typeface import android.text.Editable diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditUrl.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditUrl.kt similarity index 93% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditUrl.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditUrl.kt index f2f36c34f8..9a475a5200 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditUrl.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWEditUrl.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.setupwizard.elements +package app.aaps.plugins.configuration.setupwizard.elements import android.graphics.Typeface import android.text.Editable @@ -9,7 +9,7 @@ import android.view.View import android.widget.EditText import android.widget.LinearLayout import android.widget.TextView -import app.aaps.configuration.setupwizard.events.EventSWLabel +import app.aaps.plugins.configuration.setupwizard.events.EventSWLabel import dagger.android.HasAndroidInjector class SWEditUrl(injector: HasAndroidInjector) : SWItem(injector, Type.URL) { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWFragment.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWFragment.kt similarity index 82% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWFragment.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWFragment.kt index 98390d042a..1794da541e 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWFragment.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWFragment.kt @@ -1,8 +1,8 @@ -package app.aaps.configuration.setupwizard.elements +package app.aaps.plugins.configuration.setupwizard.elements import android.widget.LinearLayout import androidx.fragment.app.Fragment -import app.aaps.configuration.setupwizard.SWDefinition +import app.aaps.plugins.configuration.setupwizard.SWDefinition import dagger.android.HasAndroidInjector class SWFragment(injector: HasAndroidInjector, private var definition: SWDefinition) : SWItem(injector, Type.FRAGMENT) { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWHtmlLink.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWHtmlLink.kt similarity index 95% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWHtmlLink.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWHtmlLink.kt index bb6aa587da..07603234eb 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWHtmlLink.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWHtmlLink.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.setupwizard.elements +package app.aaps.plugins.configuration.setupwizard.elements import android.text.util.Linkify import android.view.View diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWInfoText.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWInfoText.kt similarity index 94% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWInfoText.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWInfoText.kt index 13957e874f..bedcd41fc6 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWInfoText.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWInfoText.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.setupwizard.elements +package app.aaps.plugins.configuration.setupwizard.elements import android.view.View import android.widget.LinearLayout diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWItem.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWItem.kt similarity index 98% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWItem.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWItem.kt index 0462caa8f5..27dcbf9579 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWItem.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWItem.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.setupwizard.elements +package app.aaps.plugins.configuration.setupwizard.elements import android.content.Context import android.content.ContextWrapper diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWPlugin.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWPlugin.kt similarity index 91% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWPlugin.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWPlugin.kt index 1af96f14ba..05f6d514c5 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWPlugin.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWPlugin.kt @@ -1,15 +1,15 @@ -package app.aaps.configuration.setupwizard.elements +package app.aaps.plugins.configuration.setupwizard.elements import android.widget.LinearLayout import androidx.annotation.StringRes -import app.aaps.configuration.configBuilder.events.EventConfigBuilderUpdateGui -import app.aaps.configuration.setupwizard.SWDefinition -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.configuration.ConfigBuilder import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.plugin.PluginType import app.aaps.core.interfaces.rx.AapsSchedulers import app.aaps.core.interfaces.ui.UiInteraction +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.plugins.configuration.configBuilder.events.EventConfigBuilderUpdateGui +import app.aaps.plugins.configuration.setupwizard.SWDefinition import dagger.android.HasAndroidInjector import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWPreference.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWPreference.kt similarity index 90% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWPreference.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWPreference.kt index 6af378f6ee..d6e1b3f149 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWPreference.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWPreference.kt @@ -1,10 +1,10 @@ -package app.aaps.configuration.setupwizard.elements +package app.aaps.plugins.configuration.setupwizard.elements import android.os.Bundle import android.widget.LinearLayout import androidx.fragment.app.Fragment -import app.aaps.configuration.setupwizard.SWDefinition import app.aaps.core.interfaces.ui.UiInteraction +import app.aaps.plugins.configuration.setupwizard.SWDefinition import dagger.android.HasAndroidInjector import javax.inject.Inject diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWRadioButton.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWRadioButton.kt similarity index 97% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWRadioButton.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWRadioButton.kt index c4f909ae6e..ed70fe1c4b 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWRadioButton.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/elements/SWRadioButton.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.setupwizard.elements +package app.aaps.plugins.configuration.setupwizard.elements import android.view.View import android.view.ViewGroup diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/events/EventSWLabel.kt b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/events/EventSWLabel.kt similarity index 62% rename from plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/events/EventSWLabel.kt rename to plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/events/EventSWLabel.kt index 42a5673929..1007113a74 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/events/EventSWLabel.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/plugins/configuration/setupwizard/events/EventSWLabel.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.setupwizard.events +package app.aaps.plugins.configuration.setupwizard.events import app.aaps.core.interfaces.rx.events.Event diff --git a/plugins/configuration/src/test/kotlin/app/aaps/configuration/maintenance/formats/EncryptedPrefsFormatTest.kt b/plugins/configuration/src/test/kotlin/app/aaps/configuration/maintenance/formats/EncryptedPrefsFormatTest.kt index c23b43bd89..5527a0d48b 100644 --- a/plugins/configuration/src/test/kotlin/app/aaps/configuration/maintenance/formats/EncryptedPrefsFormatTest.kt +++ b/plugins/configuration/src/test/kotlin/app/aaps/configuration/maintenance/formats/EncryptedPrefsFormatTest.kt @@ -1,13 +1,13 @@ -package app.aaps.configuration.maintenance.formats +package app.aaps.plugins.configuration.maintenance.formats -import app.aaps.configuration.maintenance.PrefsMetadataKeyImpl -import app.aaps.configuration.maintenance.data.PrefFormatError -import app.aaps.configuration.maintenance.data.Prefs -import app.aaps.configuration.maintenance.data.PrefsFormat -import app.aaps.configuration.maintenance.data.PrefsStatusImpl -import app.aaps.core.main.utils.CryptoUtil import app.aaps.core.interfaces.maintenance.PrefMetadata import app.aaps.core.interfaces.resources.ResourceHelper +import app.aaps.core.main.utils.CryptoUtil +import app.aaps.plugins.configuration.maintenance.PrefsMetadataKeyImpl +import app.aaps.plugins.configuration.maintenance.data.PrefFormatError +import app.aaps.plugins.configuration.maintenance.data.Prefs +import app.aaps.plugins.configuration.maintenance.data.PrefsFormat +import app.aaps.plugins.configuration.maintenance.data.PrefsStatusImpl import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import com.google.common.truth.TruthJUnit.assume diff --git a/plugins/configuration/src/test/kotlin/app/aaps/configuration/maintenance/formats/SingleStringStorage.kt b/plugins/configuration/src/test/kotlin/app/aaps/configuration/maintenance/formats/SingleStringStorage.kt index 0af8015431..75db85e2a7 100644 --- a/plugins/configuration/src/test/kotlin/app/aaps/configuration/maintenance/formats/SingleStringStorage.kt +++ b/plugins/configuration/src/test/kotlin/app/aaps/configuration/maintenance/formats/SingleStringStorage.kt @@ -1,4 +1,4 @@ -package app.aaps.configuration.maintenance.formats +package app.aaps.plugins.configuration.maintenance.formats import app.aaps.core.interfaces.storage.Storage import java.io.File From 259f84f3fe25a3fd8303581ff1ca52c4186a04fb Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 26 Sep 2023 12:56:07 +0200 Subject: [PATCH 06/17] :plugins:constraints cleanup --- app/src/main/kotlin/app/aaps/MainActivity.kt | 2 +- .../aaps/activities/MyPreferenceFragment.kt | 2 +- .../main/kotlin/app/aaps/di/AppComponent.kt | 2 +- .../kotlin/app/aaps/di/PluginsListModule.kt | 17 ++++++---- .../objectives/objectives/SntpClient.kt | 2 -- .../constraints/ConstraintsCheckerImpl.kt | 2 +- .../bgQualityCheck/BgQualityCheckPlugin.kt | 2 +- .../constraints/di/ObjectivesModule.kt | 32 +++++++++---------- .../di/PluginsConstraintsModule.kt | 8 ++--- .../constraints/dstHelper/DstHelperPlugin.kt | 2 +- .../objectives/ObjectivesFragment.kt | 10 +++--- .../objectives/ObjectivesPlugin.kt | 26 +++++++-------- .../constraints/objectives/SntpClient.kt | 2 +- .../activities/ObjectivesExamDialog.kt | 10 +++--- .../objectives/dialogs/NtpProgressDialog.kt | 2 +- .../events/EventObjectivesUpdateGui.kt | 2 +- .../objectives/objectives/Objective.kt | 2 +- .../objectives/objectives/Objective0.kt | 2 +- .../objectives/objectives/Objective1.kt | 2 +- .../objectives/objectives/Objective10.kt | 2 +- .../objectives/objectives/Objective11.kt | 2 +- .../objectives/objectives/Objective2.kt | 2 +- .../objectives/objectives/Objective3.kt | 2 +- .../objectives/objectives/Objective4.kt | 2 +- .../objectives/objectives/Objective5.kt | 4 +-- .../objectives/objectives/Objective6.kt | 2 +- .../objectives/objectives/Objective7.kt | 2 +- .../objectives/objectives/Objective9.kt | 2 +- .../objectives/objectives/SntpClient.kt | 2 ++ .../phoneChecker/PhoneCheckerPlugin.kt | 2 +- .../constraints/safety/SafetyPlugin.kt | 2 +- .../SignatureVerifierPlugin.kt | 2 +- .../storage/StorageConstraintPlugin.kt | 2 +- .../versionChecker/AllowedVersions.kt | 2 +- .../versionChecker/VersionCheckerPlugin.kt | 2 +- .../versionChecker/VersionCheckerUtilsImpl.kt | 2 +- .../main/res/layout/dialog_ntp_progress.xml | 2 +- .../main/res/layout/objectives_fragment.xml | 2 +- .../constraints/ConstraintsCheckerImplTest.kt | 9 +++--- .../BgQualityCheckPluginTest.kt | 3 +- .../dstHelper/DstHelperPluginTest.kt | 3 +- .../objectives/ObjectivesPluginTest.kt | 5 +-- .../constraints/objectives/SntpClientTest.kt | 3 +- .../constraints/safety/SafetyPluginTest.kt | 3 +- .../SignatureVerifierPluginTest.kt | 2 +- .../VersionCheckerUtilsKtTest.kt | 6 ++-- .../storage/StorageConstraintPluginTest.kt | 3 +- .../versionChecker/AllowedVersionsTest.kt | 4 +-- 48 files changed, 110 insertions(+), 100 deletions(-) delete mode 100644 plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/SntpClient.kt rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/ConstraintsCheckerImpl.kt (99%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt (99%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/di/ObjectivesModule.kt (53%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/di/PluginsConstraintsModule.kt (73%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/dstHelper/DstHelperPlugin.kt (98%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/ObjectivesFragment.kt (97%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/ObjectivesPlugin.kt (87%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/SntpClient.kt (99%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt (93%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/dialogs/NtpProgressDialog.kt (98%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/events/EventObjectivesUpdateGui.kt (63%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/objectives/Objective.kt (99%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/objectives/Objective0.kt (98%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/objectives/Objective1.kt (97%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/objectives/Objective10.kt (87%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/objectives/Objective11.kt (87%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/objectives/Objective2.kt (99%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/objectives/Objective3.kt (95%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/objectives/Objective4.kt (95%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/objectives/Objective5.kt (89%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/objectives/Objective6.kt (94%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/objectives/Objective7.kt (87%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/objectives/Objective9.kt (87%) create mode 100644 plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/SntpClient.kt rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt (96%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/safety/SafetyPlugin.kt (99%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt (99%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/storage/StorageConstraintPlugin.kt (97%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/versionChecker/AllowedVersions.kt (96%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/versionChecker/VersionCheckerPlugin.kt (98%) rename plugins/constraints/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/versionChecker/VersionCheckerUtilsImpl.kt (99%) rename plugins/constraints/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/ConstraintsCheckerImplTest.kt (98%) rename plugins/constraints/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt (99%) rename plugins/constraints/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/dstHelper/DstHelperPluginTest.kt (96%) rename plugins/constraints/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/ObjectivesPluginTest.kt (94%) rename plugins/constraints/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/objectives/SntpClientTest.kt (89%) rename plugins/constraints/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/safety/SafetyPluginTest.kt (99%) rename plugins/constraints/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/signatureVerifier/SignatureVerifierPluginTest.kt (95%) rename plugins/constraints/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/signatureVerifier/VersionCheckerUtilsKtTest.kt (98%) rename plugins/constraints/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/storage/StorageConstraintPluginTest.kt (94%) rename plugins/constraints/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/constraints/versionChecker/AllowedVersionsTest.kt (96%) diff --git a/app/src/main/kotlin/app/aaps/MainActivity.kt b/app/src/main/kotlin/app/aaps/MainActivity.kt index 96744efb95..c9d420fe8a 100644 --- a/app/src/main/kotlin/app/aaps/MainActivity.kt +++ b/app/src/main/kotlin/app/aaps/MainActivity.kt @@ -70,7 +70,7 @@ import com.joanzapata.iconify.fonts.FontAwesomeModule import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.ActivityMainBinding -import info.nightscout.plugins.constraints.signatureVerifier.SignatureVerifierPlugin +import app.aaps.plugins.constraints.signatureVerifier.SignatureVerifierPlugin import info.nightscout.ui.activities.ProfileHelperActivity import info.nightscout.ui.activities.StatsActivity import info.nightscout.ui.activities.TreatmentsActivity diff --git a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt index c71b7eda1f..65517d989a 100644 --- a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt @@ -48,7 +48,7 @@ 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.insulin.InsulinOrefFreePeakPlugin -import info.nightscout.plugins.constraints.safety.SafetyPlugin +import app.aaps.plugins.constraints.safety.SafetyPlugin import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin import info.nightscout.plugins.general.wear.WearPlugin import info.nightscout.plugins.sync.nsclient.NSClientPlugin diff --git a/app/src/main/kotlin/app/aaps/di/AppComponent.kt b/app/src/main/kotlin/app/aaps/di/AppComponent.kt index 4971b924a5..527064379f 100644 --- a/app/src/main/kotlin/app/aaps/di/AppComponent.kt +++ b/app/src/main/kotlin/app/aaps/di/AppComponent.kt @@ -22,7 +22,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.di.OmnipodDashModule import info.nightscout.androidaps.plugins.pump.omnipod.eros.di.OmnipodErosModule import info.nightscout.database.impl.DatabaseModule import info.nightscout.insulin.di.InsulinModule -import info.nightscout.plugins.constraints.di.PluginsConstraintsModule +import app.aaps.plugins.constraints.di.PluginsConstraintsModule import info.nightscout.plugins.di.PluginsModule import info.nightscout.plugins.sync.di.OpenHumansModule import info.nightscout.plugins.sync.di.SyncModule diff --git a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt index a89810a1a5..f4bc792f53 100644 --- a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt +++ b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt @@ -25,10 +25,13 @@ import info.nightscout.insulin.InsulinLyumjevPlugin import info.nightscout.insulin.InsulinOrefFreePeakPlugin import info.nightscout.insulin.InsulinOrefRapidActingPlugin import info.nightscout.insulin.InsulinOrefUltraRapidActingPlugin -import info.nightscout.plugins.constraints.bgQualityCheck.BgQualityCheckPlugin -import info.nightscout.plugins.constraints.objectives.ObjectivesPlugin -import info.nightscout.plugins.constraints.safety.SafetyPlugin -import info.nightscout.plugins.constraints.signatureVerifier.SignatureVerifierPlugin +import app.aaps.plugins.constraints.bgQualityCheck.BgQualityCheckPlugin +import app.aaps.plugins.constraints.dstHelper.DstHelperPlugin +import app.aaps.plugins.constraints.objectives.ObjectivesPlugin +import app.aaps.plugins.constraints.safety.SafetyPlugin +import app.aaps.plugins.constraints.signatureVerifier.SignatureVerifierPlugin +import app.aaps.plugins.constraints.storage.StorageConstraintPlugin +import app.aaps.plugins.constraints.versionChecker.VersionCheckerPlugin import info.nightscout.plugins.general.actions.ActionsPlugin import info.nightscout.plugins.general.food.FoodPlugin import info.nightscout.plugins.general.overview.OverviewPlugin @@ -274,7 +277,7 @@ abstract class PluginsListModule { @NotNSClient @IntoMap @IntKey(270) - abstract fun bindVersionCheckerPlugin(plugin: info.nightscout.plugins.constraints.versionChecker.VersionCheckerPlugin): PluginBase + abstract fun bindVersionCheckerPlugin(plugin: VersionCheckerPlugin): PluginBase @Binds @NotNSClient @@ -286,7 +289,7 @@ abstract class PluginsListModule { @APS @IntoMap @IntKey(290) - abstract fun bindStorageConstraintPlugin(plugin: info.nightscout.plugins.constraints.storage.StorageConstraintPlugin): PluginBase + abstract fun bindStorageConstraintPlugin(plugin: StorageConstraintPlugin): PluginBase @Binds @APS @@ -358,7 +361,7 @@ abstract class PluginsListModule { @AllConfigs @IntoMap @IntKey(380) - abstract fun bindDstHelperPlugin(plugin: info.nightscout.plugins.constraints.dstHelper.DstHelperPlugin): PluginBase + abstract fun bindDstHelperPlugin(plugin: DstHelperPlugin): PluginBase @Binds @AllConfigs diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/SntpClient.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/SntpClient.kt deleted file mode 100644 index 635720be75..0000000000 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/SntpClient.kt +++ /dev/null @@ -1,2 +0,0 @@ -package info.nightscout.plugins.constraints.objectives.objectives - diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/ConstraintsCheckerImpl.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/ConstraintsCheckerImpl.kt similarity index 99% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/ConstraintsCheckerImpl.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/ConstraintsCheckerImpl.kt index 7e84b9b4d9..331c6812da 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/ConstraintsCheckerImpl.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/ConstraintsCheckerImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints +package app.aaps.plugins.constraints import app.aaps.core.main.constraints.ConstraintObject import app.aaps.core.interfaces.constraints.Constraint diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt similarity index 99% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt index 961de52165..bd77df8941 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.bgQualityCheck +package app.aaps.plugins.constraints.bgQualityCheck import androidx.annotation.DrawableRes import app.aaps.core.main.utils.fabric.FabricPrivacy diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/di/ObjectivesModule.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/di/ObjectivesModule.kt similarity index 53% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/di/ObjectivesModule.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/di/ObjectivesModule.kt index 898f8a5151..f44ca172e9 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/di/ObjectivesModule.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/di/ObjectivesModule.kt @@ -1,22 +1,22 @@ -package info.nightscout.plugins.constraints.di +package app.aaps.plugins.constraints.di import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.plugins.constraints.objectives.ObjectivesFragment -import info.nightscout.plugins.constraints.objectives.activities.ObjectivesExamDialog -import info.nightscout.plugins.constraints.objectives.dialogs.NtpProgressDialog -import info.nightscout.plugins.constraints.objectives.objectives.Objective -import info.nightscout.plugins.constraints.objectives.objectives.Objective0 -import info.nightscout.plugins.constraints.objectives.objectives.Objective1 -import info.nightscout.plugins.constraints.objectives.objectives.Objective10 -import info.nightscout.plugins.constraints.objectives.objectives.Objective11 -import info.nightscout.plugins.constraints.objectives.objectives.Objective2 -import info.nightscout.plugins.constraints.objectives.objectives.Objective3 -import info.nightscout.plugins.constraints.objectives.objectives.Objective4 -import info.nightscout.plugins.constraints.objectives.objectives.Objective5 -import info.nightscout.plugins.constraints.objectives.objectives.Objective6 -import info.nightscout.plugins.constraints.objectives.objectives.Objective7 -import info.nightscout.plugins.constraints.objectives.objectives.Objective9 +import app.aaps.plugins.constraints.objectives.ObjectivesFragment +import app.aaps.plugins.constraints.objectives.activities.ObjectivesExamDialog +import app.aaps.plugins.constraints.objectives.dialogs.NtpProgressDialog +import app.aaps.plugins.constraints.objectives.objectives.Objective +import app.aaps.plugins.constraints.objectives.objectives.Objective0 +import app.aaps.plugins.constraints.objectives.objectives.Objective1 +import app.aaps.plugins.constraints.objectives.objectives.Objective10 +import app.aaps.plugins.constraints.objectives.objectives.Objective11 +import app.aaps.plugins.constraints.objectives.objectives.Objective2 +import app.aaps.plugins.constraints.objectives.objectives.Objective3 +import app.aaps.plugins.constraints.objectives.objectives.Objective4 +import app.aaps.plugins.constraints.objectives.objectives.Objective5 +import app.aaps.plugins.constraints.objectives.objectives.Objective6 +import app.aaps.plugins.constraints.objectives.objectives.Objective7 +import app.aaps.plugins.constraints.objectives.objectives.Objective9 @Module @Suppress("unused") diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/di/PluginsConstraintsModule.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/di/PluginsConstraintsModule.kt similarity index 73% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/di/PluginsConstraintsModule.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/di/PluginsConstraintsModule.kt index 251f4a4464..2893e33526 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/di/PluginsConstraintsModule.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/di/PluginsConstraintsModule.kt @@ -1,13 +1,13 @@ -package info.nightscout.plugins.constraints.di +package app.aaps.plugins.constraints.di import app.aaps.core.interfaces.bgQualityCheck.BgQualityCheck import app.aaps.core.interfaces.constraints.ConstraintsChecker import app.aaps.core.interfaces.versionChecker.VersionCheckerUtils import dagger.Binds import dagger.Module -import info.nightscout.plugins.constraints.ConstraintsCheckerImpl -import info.nightscout.plugins.constraints.bgQualityCheck.BgQualityCheckPlugin -import info.nightscout.plugins.constraints.versionChecker.VersionCheckerUtilsImpl +import app.aaps.plugins.constraints.ConstraintsCheckerImpl +import app.aaps.plugins.constraints.bgQualityCheck.BgQualityCheckPlugin +import app.aaps.plugins.constraints.versionChecker.VersionCheckerUtilsImpl @Module( includes = [ diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/dstHelper/DstHelperPlugin.kt similarity index 98% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/dstHelper/DstHelperPlugin.kt index d502fc91c2..03f272b393 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/dstHelper/DstHelperPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.dstHelper +package app.aaps.plugins.constraints.dstHelper import app.aaps.core.interfaces.aps.Loop import app.aaps.core.interfaces.constraints.Constraint diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesFragment.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/ObjectivesFragment.kt similarity index 97% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesFragment.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/ObjectivesFragment.kt index 2ff18f015c..333e03528a 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesFragment.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/ObjectivesFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.objectives +package app.aaps.plugins.constraints.objectives import android.annotation.SuppressLint import android.graphics.Typeface @@ -36,10 +36,10 @@ import dagger.android.support.DaggerFragment import info.nightscout.plugins.constraints.R import info.nightscout.plugins.constraints.databinding.ObjectivesFragmentBinding import info.nightscout.plugins.constraints.databinding.ObjectivesItemBinding -import info.nightscout.plugins.constraints.objectives.activities.ObjectivesExamDialog -import info.nightscout.plugins.constraints.objectives.dialogs.NtpProgressDialog -import info.nightscout.plugins.constraints.objectives.events.EventObjectivesUpdateGui -import info.nightscout.plugins.constraints.objectives.objectives.Objective.ExamTask +import app.aaps.plugins.constraints.objectives.activities.ObjectivesExamDialog +import app.aaps.plugins.constraints.objectives.dialogs.NtpProgressDialog +import app.aaps.plugins.constraints.objectives.events.EventObjectivesUpdateGui +import app.aaps.plugins.constraints.objectives.objectives.Objective.ExamTask import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesPlugin.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/ObjectivesPlugin.kt similarity index 87% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesPlugin.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/ObjectivesPlugin.kt index 3e058cb88c..30865eb712 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesPlugin.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/ObjectivesPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.objectives +package app.aaps.plugins.constraints.objectives import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.constraints.Constraint @@ -20,18 +20,18 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector import info.nightscout.plugins.constraints.R -import info.nightscout.plugins.constraints.objectives.objectives.Objective -import info.nightscout.plugins.constraints.objectives.objectives.Objective0 -import info.nightscout.plugins.constraints.objectives.objectives.Objective1 -import info.nightscout.plugins.constraints.objectives.objectives.Objective10 -import info.nightscout.plugins.constraints.objectives.objectives.Objective11 -import info.nightscout.plugins.constraints.objectives.objectives.Objective2 -import info.nightscout.plugins.constraints.objectives.objectives.Objective3 -import info.nightscout.plugins.constraints.objectives.objectives.Objective4 -import info.nightscout.plugins.constraints.objectives.objectives.Objective5 -import info.nightscout.plugins.constraints.objectives.objectives.Objective6 -import info.nightscout.plugins.constraints.objectives.objectives.Objective7 -import info.nightscout.plugins.constraints.objectives.objectives.Objective9 +import app.aaps.plugins.constraints.objectives.objectives.Objective +import app.aaps.plugins.constraints.objectives.objectives.Objective0 +import app.aaps.plugins.constraints.objectives.objectives.Objective1 +import app.aaps.plugins.constraints.objectives.objectives.Objective10 +import app.aaps.plugins.constraints.objectives.objectives.Objective11 +import app.aaps.plugins.constraints.objectives.objectives.Objective2 +import app.aaps.plugins.constraints.objectives.objectives.Objective3 +import app.aaps.plugins.constraints.objectives.objectives.Objective4 +import app.aaps.plugins.constraints.objectives.objectives.Objective5 +import app.aaps.plugins.constraints.objectives.objectives.Objective6 +import app.aaps.plugins.constraints.objectives.objectives.Objective7 +import app.aaps.plugins.constraints.objectives.objectives.Objective9 import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/SntpClient.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/SntpClient.kt similarity index 99% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/SntpClient.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/SntpClient.kt index b8abcafb34..2b39f80d34 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/SntpClient.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/SntpClient.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.objectives +package app.aaps.plugins.constraints.objectives import android.os.SystemClock import app.aaps.core.interfaces.logging.AAPSLogger diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt similarity index 93% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt index 8e7c451e01..d8055d9908 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.objectives.activities +package app.aaps.plugins.constraints.objectives.activities import android.os.Bundle import android.view.LayoutInflater @@ -12,10 +12,10 @@ import dagger.android.support.DaggerDialogFragment import app.aaps.core.ui.toast.ToastUtils import info.nightscout.plugins.constraints.R import info.nightscout.plugins.constraints.databinding.ObjectivesExamFragmentBinding -import info.nightscout.plugins.constraints.objectives.events.EventObjectivesUpdateGui -import info.nightscout.plugins.constraints.objectives.objectives.Objective -import info.nightscout.plugins.constraints.objectives.objectives.Objective.ExamTask -import info.nightscout.plugins.constraints.objectives.objectives.Objective.Option +import app.aaps.plugins.constraints.objectives.events.EventObjectivesUpdateGui +import app.aaps.plugins.constraints.objectives.objectives.Objective +import app.aaps.plugins.constraints.objectives.objectives.Objective.ExamTask +import app.aaps.plugins.constraints.objectives.objectives.Objective.Option import javax.inject.Inject class ObjectivesExamDialog : DaggerDialogFragment() { diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/dialogs/NtpProgressDialog.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/dialogs/NtpProgressDialog.kt similarity index 98% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/dialogs/NtpProgressDialog.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/dialogs/NtpProgressDialog.kt index c86be2321a..37fd6367b6 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/dialogs/NtpProgressDialog.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/dialogs/NtpProgressDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.objectives.dialogs +package app.aaps.plugins.constraints.objectives.dialogs import android.os.Bundle import android.os.SystemClock diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/events/EventObjectivesUpdateGui.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/events/EventObjectivesUpdateGui.kt similarity index 63% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/events/EventObjectivesUpdateGui.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/events/EventObjectivesUpdateGui.kt index 4108467b05..df12cb05f3 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/events/EventObjectivesUpdateGui.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/events/EventObjectivesUpdateGui.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.objectives.events +package app.aaps.plugins.constraints.objectives.events import app.aaps.core.interfaces.rx.events.EventUpdateGui diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective.kt similarity index 99% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective.kt index 600d0f975a..0cfda1c065 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.objectives.objectives +package app.aaps.plugins.constraints.objectives.objectives import android.content.Context import android.text.util.Linkify diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective0.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective0.kt similarity index 98% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective0.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective0.kt index e487400646..3a0fdd1ee6 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective0.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective0.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.objectives.objectives +package app.aaps.plugins.constraints.objectives.objectives import app.aaps.core.interfaces.aps.Loop import app.aaps.core.interfaces.db.PersistenceLayer diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective1.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective1.kt similarity index 97% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective1.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective1.kt index def521e4a9..538ab68159 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective1.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective1.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.objectives.objectives +package app.aaps.plugins.constraints.objectives.objectives import app.aaps.core.interfaces.actions.Actions import app.aaps.core.interfaces.plugin.ActivePlugin diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective10.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective10.kt similarity index 87% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective10.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective10.kt index 3636ecbb55..351e892b2d 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective10.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective10.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.objectives.objectives +package app.aaps.plugins.constraints.objectives.objectives import app.aaps.core.interfaces.utils.T import dagger.android.HasAndroidInjector diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective11.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective11.kt similarity index 87% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective11.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective11.kt index c5f514506a..d4b69aa31c 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective11.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective11.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.objectives.objectives +package app.aaps.plugins.constraints.objectives.objectives import app.aaps.core.interfaces.utils.T import dagger.android.HasAndroidInjector diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective2.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective2.kt similarity index 99% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective2.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective2.kt index 634f5761f4..d2a4cc9b11 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective2.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective2.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.objectives.objectives +package app.aaps.plugins.constraints.objectives.objectives import dagger.android.HasAndroidInjector import info.nightscout.plugins.constraints.R diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective3.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective3.kt similarity index 95% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective3.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective3.kt index 33faedadfb..624ac67c9f 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective3.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective3.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.objectives.objectives +package app.aaps.plugins.constraints.objectives.objectives import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.utils.T diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective4.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective4.kt similarity index 95% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective4.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective4.kt index ad7bdf86aa..601c4b187f 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective4.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective4.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.objectives.objectives +package app.aaps.plugins.constraints.objectives.objectives import app.aaps.core.main.constraints.ConstraintObject import app.aaps.core.interfaces.constraints.PluginConstraints diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective5.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective5.kt similarity index 89% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective5.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective5.kt index 8e66cf7d04..5cf2bc827b 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective5.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective5.kt @@ -1,11 +1,11 @@ -package info.nightscout.plugins.constraints.objectives.objectives +package app.aaps.plugins.constraints.objectives.objectives import app.aaps.core.main.constraints.ConstraintObject import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.plugins.constraints.R -import info.nightscout.plugins.constraints.safety.SafetyPlugin +import app.aaps.plugins.constraints.safety.SafetyPlugin import javax.inject.Inject @Suppress("SpellCheckingInspection") diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective6.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective6.kt similarity index 94% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective6.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective6.kt index f69eed7f63..306cf0cd73 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective6.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective6.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.objectives.objectives +package app.aaps.plugins.constraints.objectives.objectives import app.aaps.core.interfaces.aps.ApsMode import app.aaps.core.interfaces.constraints.ConstraintsChecker diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective7.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective7.kt similarity index 87% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective7.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective7.kt index 6fcabafacb..455aff0d2c 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective7.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective7.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.objectives.objectives +package app.aaps.plugins.constraints.objectives.objectives import app.aaps.core.interfaces.utils.T import dagger.android.HasAndroidInjector diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective9.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective9.kt similarity index 87% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective9.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective9.kt index bfcaf443bb..5adcf3cbba 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective9.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective9.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.objectives.objectives +package app.aaps.plugins.constraints.objectives.objectives import app.aaps.core.interfaces.utils.T import dagger.android.HasAndroidInjector diff --git a/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/SntpClient.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/SntpClient.kt new file mode 100644 index 0000000000..e3e29b6b3f --- /dev/null +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/SntpClient.kt @@ -0,0 +1,2 @@ +package app.aaps.plugins.constraints.objectives.objectives + diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt similarity index 96% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt index ebcbb45d04..0e39c35e71 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.phoneChecker +package app.aaps.plugins.constraints.phoneChecker import android.content.Context import android.os.Build diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/safety/SafetyPlugin.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/safety/SafetyPlugin.kt similarity index 99% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/safety/SafetyPlugin.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/safety/SafetyPlugin.kt index aa2c3df943..4edd033796 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/safety/SafetyPlugin.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/safety/SafetyPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.safety +package app.aaps.plugins.constraints.safety import app.aaps.core.main.constraints.ConstraintObject import app.aaps.core.main.utils.extensions.putDouble diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt similarity index 99% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt index 416f007190..f5595de5cb 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.signatureVerifier +package app.aaps.plugins.constraints.signatureVerifier import android.content.Context import android.content.pm.PackageManager diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/storage/StorageConstraintPlugin.kt similarity index 97% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/storage/StorageConstraintPlugin.kt index 7a1bab0a5e..4f1814b42a 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/storage/StorageConstraintPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.storage +package app.aaps.plugins.constraints.storage import android.os.Environment import android.os.StatFs diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/versionChecker/AllowedVersions.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/versionChecker/AllowedVersions.kt similarity index 96% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/versionChecker/AllowedVersions.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/versionChecker/AllowedVersions.kt index 1491168093..de331c6bd5 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/versionChecker/AllowedVersions.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/versionChecker/AllowedVersions.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.versionChecker +package app.aaps.plugins.constraints.versionChecker import org.joda.time.LocalDate import org.json.JSONArray diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/versionChecker/VersionCheckerPlugin.kt similarity index 98% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/versionChecker/VersionCheckerPlugin.kt index da48a3e034..896021d51b 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/versionChecker/VersionCheckerPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.versionChecker +package app.aaps.plugins.constraints.versionChecker import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.constraints.Constraint diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerUtilsImpl.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/versionChecker/VersionCheckerUtilsImpl.kt similarity index 99% rename from plugins/constraints/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerUtilsImpl.kt rename to plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/versionChecker/VersionCheckerUtilsImpl.kt index 01155ce2db..c8a285338b 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerUtilsImpl.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/versionChecker/VersionCheckerUtilsImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.constraints.versionChecker +package app.aaps.plugins.constraints.versionChecker import android.os.Build import app.aaps.core.interfaces.configuration.Config diff --git a/plugins/constraints/src/main/res/layout/dialog_ntp_progress.xml b/plugins/constraints/src/main/res/layout/dialog_ntp_progress.xml index 34a8db1d5b..5341a85a72 100644 --- a/plugins/constraints/src/main/res/layout/dialog_ntp_progress.xml +++ b/plugins/constraints/src/main/res/layout/dialog_ntp_progress.xml @@ -4,7 +4,7 @@ style="@style/StyleDialog" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="info.nightscout.plugins.constraints.objectives.dialogs.NtpProgressDialog"> + tools:context="info.nightscout.plugins.constraints.app.aaps.plugins.constraints.objectives.dialogs.NtpProgressDialog"> + tools:context="info.nightscout.plugins.constraints.app.aaps.plugins.constraints.objectives.ObjectivesFragment"> Date: Tue, 26 Sep 2023 13:00:38 +0200 Subject: [PATCH 07/17] add objectives hint --- .../plugins/constraints/objectives/objectives/Objective2.kt | 3 +++ plugins/constraints/src/main/res/values/exam.xml | 1 + 2 files changed, 4 insertions(+) diff --git a/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective2.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective2.kt index d2a4cc9b11..b18ec6fa29 100644 --- a/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective2.kt +++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective2.kt @@ -227,18 +227,21 @@ class Objective2(injector: HasAndroidInjector) : Objective(injector, "exam", R.s .option(Option(R.string.cob_longer, true)) .option(Option(R.string.cob_shorter, false)) .option(Option(R.string.cob_no_effect, false)) + .hint(Hint(R.string.cob_hint1)) ) tasks.add( ExamTask(this, R.string.cob_label, R.string.cob2_question, "cob2") .option(Option(R.string.cob2_longer, false)) .option(Option(R.string.cob2_shorter, true)) .option(Option(R.string.cob2_no_effect, false)) + .hint(Hint(R.string.cob_hint1)) ) tasks.add( ExamTask(this, R.string.cob_label, R.string.cob3_question, "cob3") .option(Option(R.string.cob3_longer, false)) .option(Option(R.string.cob3_shorter, false)) .option(Option(R.string.cob3_no_effect, true)) + .hint(Hint(R.string.cob_hint1)) .learned(Learned(R.string.objectives_exam_learned_cob)) ) tasks.add( diff --git a/plugins/constraints/src/main/res/values/exam.xml b/plugins/constraints/src/main/res/values/exam.xml index 562e1415f3..c7ed0eca12 100644 --- a/plugins/constraints/src/main/res/values/exam.xml +++ b/plugins/constraints/src/main/res/values/exam.xml @@ -148,6 +148,7 @@ Setting profile to 150% will make the calculated carb absorption time longer Setting profile to 150% will make the calculated carb absorption time shorter Setting profile to 150% will not affect calculated carbs absorption + https://androidaps.readthedocs.io/en/latest/Usage/COB-calculation.html#how-does-aaps-calculate-the-cob-value IOB value is affected by issued temporary basals. High temp basal will not be given when your blood sugar is below target. Negative IOB for a substantial period in the absence of exercise suggests your profile is too strong and less insulin is needed in your settings. From 905916e1eb685e687db2410bcd52d4fcc51edc0b Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 26 Sep 2023 13:07:44 +0200 Subject: [PATCH 08/17] :plugins:insulin cleanup --- .../aaps/activities/MyPreferenceFragment.kt | 4 ++-- .../main/kotlin/app/aaps/di/AppComponent.kt | 4 ++-- .../kotlin/app/aaps/di/PluginsListModule.kt | 22 +++++++++---------- plugins/insulin/build.gradle | 2 +- .../aaps/plugins}/insulin/InsulinFragment.kt | 4 ++-- .../plugins}/insulin/InsulinLyumjevPlugin.kt | 2 +- .../plugins}/insulin/InsulinOrefBasePlugin.kt | 2 +- .../insulin/InsulinOrefFreePeakPlugin.kt | 6 ++--- .../insulin/InsulinOrefRapidActingPlugin.kt | 2 +- .../InsulinOrefUltraRapidActingPlugin.kt | 2 +- .../aaps/plugins}/insulin/di/InsulinModule.kt | 4 ++-- .../src/main/res/layout/insulin_fragment.xml | 2 +- .../insulin/InsulinLyumjevPluginTest.kt | 2 +- .../insulin/InsulinOrefBasePluginTest.kt | 2 +- .../insulin/InsulinOrefFreePeakPluginTest.kt | 2 +- .../InsulinOrefRapidActingPluginTest.kt | 2 +- .../InsulinOrefUltraRapidActingPluginTest.kt | 2 +- .../core/extensions/BolusExtensionKtTest.kt | 2 +- .../ExtendedBolusExtensionKtTest.kt | 2 +- .../TemporaryBasalExtensionKtTest.kt | 2 +- 20 files changed, 36 insertions(+), 36 deletions(-) rename plugins/insulin/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/insulin/InsulinFragment.kt (93%) rename plugins/insulin/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/insulin/InsulinLyumjevPlugin.kt (97%) rename plugins/insulin/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/insulin/InsulinOrefBasePlugin.kt (99%) rename plugins/insulin/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/insulin/InsulinOrefFreePeakPlugin.kt (98%) rename plugins/insulin/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/insulin/InsulinOrefRapidActingPlugin.kt (97%) rename plugins/insulin/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/insulin/InsulinOrefUltraRapidActingPlugin.kt (97%) rename plugins/insulin/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/insulin/di/InsulinModule.kt (72%) rename plugins/insulin/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/insulin/InsulinLyumjevPluginTest.kt (98%) rename plugins/insulin/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/insulin/InsulinOrefBasePluginTest.kt (99%) rename plugins/insulin/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/insulin/InsulinOrefFreePeakPluginTest.kt (98%) rename plugins/insulin/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/insulin/InsulinOrefRapidActingPluginTest.kt (98%) rename plugins/insulin/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/insulin/InsulinOrefUltraRapidActingPluginTest.kt (98%) diff --git a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt index 65517d989a..f0b06e98e3 100644 --- a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt @@ -39,6 +39,8 @@ import app.aaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin import app.aaps.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin import app.aaps.plugins.automation.AutomationPlugin import app.aaps.plugins.configuration.maintenance.MaintenancePlugin +import app.aaps.plugins.constraints.safety.SafetyPlugin +import app.aaps.plugins.insulin.InsulinOrefFreePeakPlugin import dagger.android.support.AndroidSupportInjection import info.nightscout.androidaps.R import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin @@ -47,8 +49,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.insulin.InsulinOrefFreePeakPlugin -import app.aaps.plugins.constraints.safety.SafetyPlugin import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin import info.nightscout.plugins.general.wear.WearPlugin import info.nightscout.plugins.sync.nsclient.NSClientPlugin diff --git a/app/src/main/kotlin/app/aaps/di/AppComponent.kt b/app/src/main/kotlin/app/aaps/di/AppComponent.kt index 527064379f..c3a290caff 100644 --- a/app/src/main/kotlin/app/aaps/di/AppComponent.kt +++ b/app/src/main/kotlin/app/aaps/di/AppComponent.kt @@ -7,6 +7,8 @@ import app.aaps.implementation.di.ImplementationModule import app.aaps.plugins.aps.di.ApsModule import app.aaps.plugins.automation.di.AutomationModule import app.aaps.plugins.configuration.di.ConfigurationModule +import app.aaps.plugins.constraints.di.PluginsConstraintsModule +import app.aaps.plugins.insulin.di.InsulinModule import app.aaps.shared.impl.di.SharedImplModule import dagger.BindsInstance import dagger.Component @@ -21,8 +23,6 @@ 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.database.impl.DatabaseModule -import info.nightscout.insulin.di.InsulinModule -import app.aaps.plugins.constraints.di.PluginsConstraintsModule import info.nightscout.plugins.di.PluginsModule import info.nightscout.plugins.sync.di.OpenHumansModule import info.nightscout.plugins.sync.di.SyncModule diff --git a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt index f4bc792f53..5d8281611c 100644 --- a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt +++ b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt @@ -9,6 +9,17 @@ import app.aaps.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin import app.aaps.plugins.automation.AutomationPlugin import app.aaps.plugins.configuration.configBuilder.ConfigBuilderPlugin import app.aaps.plugins.configuration.maintenance.MaintenancePlugin +import app.aaps.plugins.constraints.bgQualityCheck.BgQualityCheckPlugin +import app.aaps.plugins.constraints.dstHelper.DstHelperPlugin +import app.aaps.plugins.constraints.objectives.ObjectivesPlugin +import app.aaps.plugins.constraints.safety.SafetyPlugin +import app.aaps.plugins.constraints.signatureVerifier.SignatureVerifierPlugin +import app.aaps.plugins.constraints.storage.StorageConstraintPlugin +import app.aaps.plugins.constraints.versionChecker.VersionCheckerPlugin +import app.aaps.plugins.insulin.InsulinLyumjevPlugin +import app.aaps.plugins.insulin.InsulinOrefFreePeakPlugin +import app.aaps.plugins.insulin.InsulinOrefRapidActingPlugin +import app.aaps.plugins.insulin.InsulinOrefUltraRapidActingPlugin import dagger.Binds import dagger.Module import dagger.multibindings.IntKey @@ -21,17 +32,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.insulin.InsulinLyumjevPlugin -import info.nightscout.insulin.InsulinOrefFreePeakPlugin -import info.nightscout.insulin.InsulinOrefRapidActingPlugin -import info.nightscout.insulin.InsulinOrefUltraRapidActingPlugin -import app.aaps.plugins.constraints.bgQualityCheck.BgQualityCheckPlugin -import app.aaps.plugins.constraints.dstHelper.DstHelperPlugin -import app.aaps.plugins.constraints.objectives.ObjectivesPlugin -import app.aaps.plugins.constraints.safety.SafetyPlugin -import app.aaps.plugins.constraints.signatureVerifier.SignatureVerifierPlugin -import app.aaps.plugins.constraints.storage.StorageConstraintPlugin -import app.aaps.plugins.constraints.versionChecker.VersionCheckerPlugin import info.nightscout.plugins.general.actions.ActionsPlugin import info.nightscout.plugins.general.food.FoodPlugin import info.nightscout.plugins.general.overview.OverviewPlugin diff --git a/plugins/insulin/build.gradle b/plugins/insulin/build.gradle index e995e53cf9..e934f67d54 100644 --- a/plugins/insulin/build.gradle +++ b/plugins/insulin/build.gradle @@ -11,7 +11,7 @@ apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/main/test_dependencies.gradle" apply from: "${project.rootDir}/core/main/jacoco_global.gradle" android { - namespace 'info.nightscout.insulin' + namespace 'app.aaps.plugins.insulin' } diff --git a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinFragment.kt b/plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinFragment.kt similarity index 93% rename from plugins/insulin/src/main/java/info/nightscout/insulin/InsulinFragment.kt rename to plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinFragment.kt index e4c649181f..5579bc447a 100644 --- a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinFragment.kt +++ b/plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.insulin +package app.aaps.plugins.insulin import android.os.Bundle import android.view.LayoutInflater @@ -6,8 +6,8 @@ import android.view.View import android.view.ViewGroup import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.resources.ResourceHelper +import app.aaps.plugins.insulin.databinding.InsulinFragmentBinding import dagger.android.support.DaggerFragment -import info.nightscout.insulin.databinding.InsulinFragmentBinding import javax.inject.Inject class InsulinFragment : DaggerFragment() { diff --git a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinLyumjevPlugin.kt b/plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinLyumjevPlugin.kt similarity index 97% rename from plugins/insulin/src/main/java/info/nightscout/insulin/InsulinLyumjevPlugin.kt rename to plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinLyumjevPlugin.kt index 6abb4b9db4..8c10c7cbfa 100644 --- a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinLyumjevPlugin.kt +++ b/plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinLyumjevPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.insulin +package app.aaps.plugins.insulin import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.insulin.Insulin diff --git a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefBasePlugin.kt b/plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinOrefBasePlugin.kt similarity index 99% rename from plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefBasePlugin.kt rename to plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinOrefBasePlugin.kt index 776e9d5f66..a7ae6f264b 100644 --- a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefBasePlugin.kt +++ b/plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinOrefBasePlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.insulin +package app.aaps.plugins.insulin import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.insulin.Insulin diff --git a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefFreePeakPlugin.kt b/plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinOrefFreePeakPlugin.kt similarity index 98% rename from plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefFreePeakPlugin.kt rename to plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinOrefFreePeakPlugin.kt index 094d00d918..4875daa8b3 100644 --- a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefFreePeakPlugin.kt +++ b/plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinOrefFreePeakPlugin.kt @@ -1,7 +1,5 @@ -package info.nightscout.insulin +package app.aaps.plugins.insulin -import app.aaps.core.main.utils.extensions.putInt -import app.aaps.core.main.utils.extensions.storeInt import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.insulin.Insulin import app.aaps.core.interfaces.logging.AAPSLogger @@ -11,6 +9,8 @@ import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.HardLimits +import app.aaps.core.main.utils.extensions.putInt +import app.aaps.core.main.utils.extensions.storeInt import dagger.android.HasAndroidInjector import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefRapidActingPlugin.kt b/plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinOrefRapidActingPlugin.kt similarity index 97% rename from plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefRapidActingPlugin.kt rename to plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinOrefRapidActingPlugin.kt index 43d48e6666..c246bea4db 100644 --- a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefRapidActingPlugin.kt +++ b/plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinOrefRapidActingPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.insulin +package app.aaps.plugins.insulin import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.insulin.Insulin diff --git a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefUltraRapidActingPlugin.kt b/plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt similarity index 97% rename from plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefUltraRapidActingPlugin.kt rename to plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt index 0caf244cfb..98e59cb393 100644 --- a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefUltraRapidActingPlugin.kt +++ b/plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.insulin +package app.aaps.plugins.insulin import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.insulin.Insulin diff --git a/plugins/insulin/src/main/java/info/nightscout/insulin/di/InsulinModule.kt b/plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/di/InsulinModule.kt similarity index 72% rename from plugins/insulin/src/main/java/info/nightscout/insulin/di/InsulinModule.kt rename to plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/di/InsulinModule.kt index 0f0e3af34a..e7264d4134 100644 --- a/plugins/insulin/src/main/java/info/nightscout/insulin/di/InsulinModule.kt +++ b/plugins/insulin/src/main/kotlin/app/aaps/plugins/insulin/di/InsulinModule.kt @@ -1,8 +1,8 @@ -package info.nightscout.insulin.di +package app.aaps.plugins.insulin.di +import app.aaps.plugins.insulin.InsulinFragment import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.insulin.InsulinFragment @Module @Suppress("unused") diff --git a/plugins/insulin/src/main/res/layout/insulin_fragment.xml b/plugins/insulin/src/main/res/layout/insulin_fragment.xml index 7ee8581409..cd25ef1e21 100644 --- a/plugins/insulin/src/main/res/layout/insulin_fragment.xml +++ b/plugins/insulin/src/main/res/layout/insulin_fragment.xml @@ -2,7 +2,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="info.nightscout.insulin.InsulinFragment"> + tools:context=".InsulinFragment"> Date: Tue, 26 Sep 2023 13:33:11 +0200 Subject: [PATCH 09/17] fix tests --- .../plugins/automation/triggers/TriggerAutosensValueTest.kt | 4 ++-- .../aaps/plugins/automation/triggers/TriggerBTDeviceTest.kt | 4 ++-- .../app/aaps/plugins/automation/triggers/TriggerBgTest.kt | 4 ++-- .../aaps/plugins/automation/triggers/TriggerBolusAgoTest.kt | 4 ++-- .../app/aaps/plugins/automation/triggers/TriggerCOBTest.kt | 4 ++-- .../app/aaps/plugins/automation/triggers/TriggerDeltaTest.kt | 2 +- .../app/aaps/plugins/automation/triggers/TriggerIobTest.kt | 4 ++-- .../aaps/plugins/automation/triggers/TriggerLocationTest.kt | 4 ++-- .../plugins/automation/triggers/TriggerProfilePercentTest.kt | 4 ++-- .../automation/triggers/TriggerPumpLastConnectionTest.kt | 4 ++-- .../aaps/plugins/automation/triggers/TriggerTempTargetTest.kt | 4 ++-- .../plugins/automation/triggers/TriggerTempTargetValueTest.kt | 4 ++-- .../aaps/plugins/automation/triggers/TriggerTimeRangeTest.kt | 4 ++-- .../app/aaps/plugins/automation/triggers/TriggerTimeTest.kt | 4 ++-- .../aaps/plugins/automation/triggers/TriggerWifiSsidTest.kt | 4 ++-- 15 files changed, 29 insertions(+), 29 deletions(-) diff --git a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerAutosensValueTest.kt b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerAutosensValueTest.kt index 6e7703d30d..765e255d2d 100644 --- a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerAutosensValueTest.kt +++ b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerAutosensValueTest.kt @@ -2,7 +2,7 @@ package app.aaps.plugins.automation.triggers import app.aaps.plugins.automation.R import app.aaps.plugins.automation.elements.Comparator -import com.google.common.base.Optional +import com.google.common.truth.Truth.assertThat import info.nightscout.plugins.iob.iobCobCalculator.data.AutosensDataObject import org.json.JSONObject import org.junit.jupiter.api.Assertions @@ -100,7 +100,7 @@ class TriggerAutosensValueTest : TriggerTestBase() { } @Test fun iconTest() { - Assertions.assertEquals(Optional.of(R.drawable.ic_as), TriggerAutosensValue(injector).icon()) + assertThat(TriggerAutosensValue(injector).icon().get()).isEqualTo(R.drawable.ic_as) } private fun generateAutosensData(): AutosensDataObject { diff --git a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerBTDeviceTest.kt b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerBTDeviceTest.kt index 5904130b52..91b912d9ef 100644 --- a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerBTDeviceTest.kt +++ b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerBTDeviceTest.kt @@ -1,7 +1,7 @@ package app.aaps.plugins.automation.triggers import app.aaps.plugins.automation.elements.ComparatorConnect -import com.google.common.base.Optional +import com.google.common.truth.Truth.assertThat import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test @@ -31,7 +31,7 @@ class TriggerBTDeviceTest : TriggerTestBase() { @Test fun icon() { - Assertions.assertEquals(Optional.of(app.aaps.core.ui.R.drawable.ic_bluetooth_white_48dp), TriggerBTDevice(injector).icon()) + assertThat(TriggerBTDevice(injector).icon().get()).isEqualTo(app.aaps.core.ui.R.drawable.ic_bluetooth_white_48dp) } @Test fun duplicate() { diff --git a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerBgTest.kt b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerBgTest.kt index d953fe38d0..47bcb54ad3 100644 --- a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerBgTest.kt +++ b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerBgTest.kt @@ -4,7 +4,7 @@ import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.iob.InMemoryGlucoseValue import app.aaps.database.entities.GlucoseValue import app.aaps.plugins.automation.elements.Comparator -import com.google.common.base.Optional +import com.google.common.truth.Truth.assertThat import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach @@ -74,7 +74,7 @@ class TriggerBgTest : TriggerTestBase() { @Test fun iconTest() { - Assertions.assertEquals(Optional.of(app.aaps.core.main.R.drawable.ic_cp_bgcheck), TriggerBg(injector).icon()) + assertThat(TriggerBg(injector).icon().get()).isEqualTo(app.aaps.core.main.R.drawable.ic_cp_bgcheck) } private fun generateOneCurrentRecordBgData(): MutableList { diff --git a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerBolusAgoTest.kt b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerBolusAgoTest.kt index 7fdcfdb22e..8f53218183 100644 --- a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerBolusAgoTest.kt +++ b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerBolusAgoTest.kt @@ -3,7 +3,7 @@ package app.aaps.plugins.automation.triggers import app.aaps.database.ValueWrapper import app.aaps.database.entities.Bolus import app.aaps.plugins.automation.elements.Comparator -import com.google.common.base.Optional +import com.google.common.truth.Truth.assertThat import io.reactivex.rxjava3.core.Single import org.json.JSONException import org.json.JSONObject @@ -86,6 +86,6 @@ class TriggerBolusAgoTest : TriggerTestBase() { } @Test fun iconTest() { - Assertions.assertEquals(Optional.of(app.aaps.core.main.R.drawable.ic_bolus), TriggerBolusAgo(injector).icon()) + assertThat(TriggerBolusAgo(injector).icon().get()).isEqualTo(app.aaps.core.main.R.drawable.ic_bolus) } } \ No newline at end of file diff --git a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerCOBTest.kt b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerCOBTest.kt index 83af189bdb..83e0930252 100644 --- a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerCOBTest.kt +++ b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerCOBTest.kt @@ -2,7 +2,7 @@ package app.aaps.plugins.automation.triggers import app.aaps.core.interfaces.iob.CobInfo import app.aaps.plugins.automation.elements.Comparator -import com.google.common.base.Optional +import com.google.common.truth.Truth.assertThat import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach @@ -58,6 +58,6 @@ class TriggerCOBTest : TriggerTestBase() { } @Test fun iconTest() { - Assertions.assertEquals(Optional.of(app.aaps.core.main.R.drawable.ic_cp_bolus_carbs), TriggerCOB(injector).icon()) + assertThat(TriggerCOB(injector).icon().get()).isEqualTo(app.aaps.core.main.R.drawable.ic_cp_bolus_carbs) } } \ No newline at end of file diff --git a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerDeltaTest.kt b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerDeltaTest.kt index c28b196e2b..89eb07bd83 100644 --- a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerDeltaTest.kt +++ b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerDeltaTest.kt @@ -79,7 +79,7 @@ class TriggerDeltaTest : TriggerTestBase() { } @Test fun iconTest() { - assertThat(TriggerDelta(injector).icon()).hasValue(R.drawable.ic_auto_delta) + assertThat(TriggerDelta(injector).icon().get()).isEqualTo(R.drawable.ic_auto_delta) } @Test fun initializerTest() { diff --git a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerIobTest.kt b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerIobTest.kt index 9554e92409..e90b719e62 100644 --- a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerIobTest.kt +++ b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerIobTest.kt @@ -3,7 +3,7 @@ package app.aaps.plugins.automation.triggers import app.aaps.core.interfaces.iob.IobTotal import app.aaps.plugins.automation.R import app.aaps.plugins.automation.elements.Comparator -import com.google.common.base.Optional +import com.google.common.truth.Truth.assertThat import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach @@ -60,7 +60,7 @@ class TriggerIobTest : TriggerTestBase() { } @Test fun iconTest() { - Assertions.assertEquals(Optional.of(R.drawable.ic_keyboard_capslock), TriggerIob(injector).icon()) + assertThat(TriggerIob(injector).icon().get()).isEqualTo(R.drawable.ic_keyboard_capslock) } private fun generateIobRecordData(): IobTotal { diff --git a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerLocationTest.kt b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerLocationTest.kt index 5d4586b8ec..c6a7ab9dff 100644 --- a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerLocationTest.kt +++ b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerLocationTest.kt @@ -3,7 +3,7 @@ package app.aaps.plugins.automation.triggers import android.location.Location import app.aaps.plugins.automation.R import app.aaps.plugins.automation.elements.InputLocationMode -import com.google.common.base.Optional +import com.google.common.truth.Truth.assertThat import org.json.JSONException import org.json.JSONObject import org.junit.jupiter.api.Assertions @@ -92,7 +92,7 @@ class TriggerLocationTest : TriggerTestBase() { } @Test fun iconTest() { - Assertions.assertEquals(Optional.of(R.drawable.ic_location_on), TriggerLocation(injector).icon()) + assertThat(TriggerLocation(injector).icon().get()).isEqualTo(R.drawable.ic_location_on) } private fun mockedLocation(): Location { diff --git a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerProfilePercentTest.kt b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerProfilePercentTest.kt index e0acb777ae..fdaba24f13 100644 --- a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerProfilePercentTest.kt +++ b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerProfilePercentTest.kt @@ -2,7 +2,7 @@ package app.aaps.plugins.automation.triggers import app.aaps.plugins.automation.R import app.aaps.plugins.automation.elements.Comparator -import com.google.common.base.Optional +import com.google.common.truth.Truth.assertThat import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach @@ -57,7 +57,7 @@ class TriggerProfilePercentTest : TriggerTestBase() { } @Test fun iconTest() { - Assertions.assertEquals(Optional.of(app.aaps.core.ui.R.drawable.ic_actions_profileswitch), TriggerProfilePercent(injector).icon()) + assertThat(TriggerProfilePercent(injector).icon().get()).isEqualTo(app.aaps.core.ui.R.drawable.ic_actions_profileswitch) } @Test fun friendlyNameTest() { diff --git a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerPumpLastConnectionTest.kt b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerPumpLastConnectionTest.kt index 53ef8d2752..3189efd24c 100644 --- a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerPumpLastConnectionTest.kt +++ b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerPumpLastConnectionTest.kt @@ -2,7 +2,7 @@ package app.aaps.plugins.automation.triggers import app.aaps.plugins.automation.R import app.aaps.plugins.automation.elements.Comparator -import com.google.common.base.Optional +import com.google.common.truth.Truth.assertThat import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test @@ -53,7 +53,7 @@ class TriggerPumpLastConnectionTest : TriggerTestBase() { } @Test fun iconTest() { - Assertions.assertEquals(Optional.of(app.aaps.core.main.R.drawable.ic_remove), TriggerPumpLastConnection(injector).icon()) + assertThat(TriggerPumpLastConnection(injector).icon().get()).isEqualTo(app.aaps.core.main.R.drawable.ic_remove) } @Test fun friendlyNameTest() { diff --git a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerTempTargetTest.kt b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerTempTargetTest.kt index b5048045db..180f6fafbe 100644 --- a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerTempTargetTest.kt +++ b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerTempTargetTest.kt @@ -2,7 +2,7 @@ package app.aaps.plugins.automation.triggers import app.aaps.plugins.automation.R import app.aaps.plugins.automation.elements.ComparatorExists -import com.google.common.base.Optional +import com.google.common.truth.Truth.assertThat import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test @@ -43,6 +43,6 @@ class TriggerTempTargetTest : TriggerTestBase() { } @Test fun iconTest() { - Assertions.assertEquals(Optional.of(R.drawable.ic_keyboard_tab), TriggerTempTarget(injector).icon()) + assertThat(TriggerTempTarget(injector).icon().get()).isEqualTo(R.drawable.ic_keyboard_tab) } } \ No newline at end of file diff --git a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerTempTargetValueTest.kt b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerTempTargetValueTest.kt index a217f91419..ad599d9f32 100644 --- a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerTempTargetValueTest.kt +++ b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerTempTargetValueTest.kt @@ -5,7 +5,7 @@ import app.aaps.database.ValueWrapper import app.aaps.database.entities.TemporaryTarget import app.aaps.plugins.automation.R import app.aaps.plugins.automation.elements.Comparator -import com.google.common.base.Optional +import com.google.common.truth.Truth.assertThat import io.reactivex.rxjava3.core.Single import org.json.JSONObject import org.junit.jupiter.api.Assertions @@ -88,7 +88,7 @@ class TriggerTempTargetValueTest : TriggerTestBase() { @Test fun iconTest() { - Assertions.assertEquals(Optional.of(R.drawable.ic_keyboard_tab), TriggerTempTargetValue(injector).icon()) + assertThat(TriggerTempTargetValue(injector).icon().get()).isEqualTo(R.drawable.ic_keyboard_tab) } } diff --git a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerTimeRangeTest.kt b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerTimeRangeTest.kt index ac8ee9efce..a828c2035f 100644 --- a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerTimeRangeTest.kt +++ b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerTimeRangeTest.kt @@ -2,7 +2,7 @@ package app.aaps.plugins.automation.triggers import app.aaps.core.interfaces.utils.MidnightTime import app.aaps.plugins.automation.R -import com.google.common.base.Optional +import com.google.common.truth.Truth.assertThat import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach @@ -66,6 +66,6 @@ class TriggerTimeRangeTest : TriggerTestBase() { } @Test fun iconTest() { - Assertions.assertEquals(Optional.of(app.aaps.core.main.R.drawable.ic_access_alarm_24dp), TriggerTimeRange(injector).icon()) + assertThat(TriggerTimeRange(injector).icon().get()).isEqualTo(app.aaps.core.main.R.drawable.ic_access_alarm_24dp) } } \ No newline at end of file diff --git a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerTimeTest.kt b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerTimeTest.kt index 71b49d9039..75736e9784 100644 --- a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerTimeTest.kt +++ b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerTimeTest.kt @@ -2,7 +2,7 @@ package app.aaps.plugins.automation.triggers import app.aaps.core.interfaces.utils.T import app.aaps.plugins.automation.R -import com.google.common.base.Optional +import com.google.common.truth.Truth.assertThat import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test @@ -62,6 +62,6 @@ class TriggerTimeTest : TriggerTestBase() { @Test fun iconTest() { - Assertions.assertEquals(Optional.of(app.aaps.core.main.R.drawable.ic_access_alarm_24dp), TriggerTime(injector).icon()) + assertThat(TriggerTime(injector).icon().get()).isEqualTo(app.aaps.core.main.R.drawable.ic_access_alarm_24dp) } } \ No newline at end of file diff --git a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerWifiSsidTest.kt b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerWifiSsidTest.kt index 5001061c51..cd62a20eac 100644 --- a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerWifiSsidTest.kt +++ b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerWifiSsidTest.kt @@ -3,7 +3,7 @@ package app.aaps.plugins.automation.triggers import app.aaps.core.interfaces.rx.events.EventNetworkChange import app.aaps.plugins.automation.R import app.aaps.plugins.automation.elements.Comparator -import com.google.common.base.Optional +import com.google.common.truth.Truth.assertThat import org.json.JSONException import org.json.JSONObject import org.junit.jupiter.api.Assertions @@ -54,7 +54,7 @@ class TriggerWifiSsidTest : TriggerTestBase() { } @Test fun iconTest() { - Assertions.assertEquals(Optional.of(R.drawable.ic_network_wifi), TriggerWifiSsid(injector).icon()) + assertThat(TriggerWifiSsid(injector).icon().get()).isEqualTo(R.drawable.ic_network_wifi) } @Test fun friendlyNameTest() { From 2610815f966f313a02c79de8d1802e3b25d0920a Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 26 Sep 2023 14:14:28 +0200 Subject: [PATCH 10/17] update url --- plugins/constraints/src/main/res/values/exam.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/constraints/src/main/res/values/exam.xml b/plugins/constraints/src/main/res/values/exam.xml index c7ed0eca12..89b7792b5b 100644 --- a/plugins/constraints/src/main/res/values/exam.xml +++ b/plugins/constraints/src/main/res/values/exam.xml @@ -148,7 +148,7 @@ Setting profile to 150% will make the calculated carb absorption time longer Setting profile to 150% will make the calculated carb absorption time shorter Setting profile to 150% will not affect calculated carbs absorption - https://androidaps.readthedocs.io/en/latest/Usage/COB-calculation.html#how-does-aaps-calculate-the-cob-value + https://wiki.aaps.app/en/latest/Usage/COB-calculation.html#how-does-aaps-calculate-the-cob-value IOB value is affected by issued temporary basals. High temp basal will not be given when your blood sugar is below target. Negative IOB for a substantial period in the absence of exercise suggests your profile is too strong and less insulin is needed in your settings. From fb25d1b9d5339e99705a5c48e8557ba928450b1b Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 26 Sep 2023 14:44:52 +0200 Subject: [PATCH 11/17] :profile:main cleanup --- app/src/main/kotlin/app/aaps/MainActivity.kt | 14 ++++---- app/src/main/kotlin/app/aaps/MainApp.kt | 16 ++++----- .../aaps/activities/HistoryBrowseActivity.kt | 12 +++---- .../app/aaps/activities/HistoryBrowserData.kt | 2 +- .../aaps/activities/MyPreferenceFragment.kt | 10 +++--- .../main/kotlin/app/aaps/di/AppComponent.kt | 2 +- .../kotlin/app/aaps/di/PluginsListModule.kt | 18 +++++----- .../aaps/implementations/InstantiatorImpl.kt | 2 +- .../aaps/implementations/UiInteractionImpl.kt | 2 +- .../app/aaps/receivers/AutoStartReceiver.kt | 2 +- .../kotlin/app/aaps/receivers/DataReceiver.kt | 2 +- .../aaps/workflow/CalculationWorkflowImpl.kt | 2 +- app/src/main/res/xml/pref_general.xml | 2 +- .../triggers/TriggerAutosensValueTest.kt | 2 +- plugins/main/build.gradle | 2 +- plugins/main/src/main/AndroidManifest.xml | 6 ++-- .../IobCobCalculatorPlugin.kt | 6 ++-- .../data/AutosensDataObject.kt | 2 +- .../data/AutosensDataStoreObject.kt | 2 +- .../aaps/plugins/main}/di/ActionsModule.kt | 4 +-- .../app/aaps/plugins/main}/di/FoodModule.kt | 4 +-- .../aaps/plugins/main}/di/OverviewModule.kt | 12 +++---- .../aaps/plugins/main}/di/PluginsModule.kt | 12 +++---- .../aaps/plugins/main}/di/ProfileModule.kt | 6 ++-- .../plugins/main}/di/SMSCommunicatorModule.kt | 10 +++--- .../app/aaps/plugins/main}/di/SkinsModule.kt | 12 +++---- .../aaps/plugins/main}/di/SkinsUiModule.kt | 4 +-- .../app/aaps/plugins/main}/di/WearModule.kt | 6 ++-- .../main}/general/actions/ActionsFragment.kt | 10 +++--- .../main}/general/actions/ActionsPlugin.kt | 4 +-- .../main}/general/food/FoodFragment.kt | 8 ++--- .../plugins/main}/general/food/FoodPlugin.kt | 4 +-- .../general/overview/OverviewFragment.kt | 16 ++++----- .../general/overview/OverviewMenusImpl.kt | 6 ++-- .../main}/general/overview/OverviewPlugin.kt | 36 +++++++++---------- .../general/overview/graphData/GraphData.kt | 14 ++++---- .../DismissNotificationService.kt | 2 +- .../notifications/NotificationStore.kt | 8 ++--- .../notifications/NotificationWithAction.kt | 4 +-- .../events/EventUpdateOverviewNotification.kt | 2 +- .../general/overview/ui/StatusLightHandler.kt | 4 +-- .../persistentNotification/DummyService.kt | 4 +-- .../DummyServiceHelper.kt | 2 +- .../PersistentNotificationPlugin.kt | 12 +++---- .../general/smsCommunicator/AuthRequest.kt | 8 ++--- .../general/smsCommunicator/SmsAction.kt | 2 +- .../SmsCommunicatorFragment.kt | 6 ++-- .../smsCommunicator/SmsCommunicatorPlugin.kt | 8 ++--- .../activities/SmsCommunicatorOtpActivity.kt | 10 +++--- .../events/EventSmsCommunicatorUpdateGui.kt | 2 +- .../smsCommunicator/otp/OneTimePassword.kt | 4 +-- .../otp/OneTimePasswordValidationResult.kt | 2 +- .../general/themes/ThemeSwitcherPlugin.kt | 4 +-- .../main}/general/wear/WearFragment.kt | 12 +++---- .../plugins/main}/general/wear/WearPlugin.kt | 10 +++--- .../wear/activities/CwfInfosActivity.kt | 14 ++++---- .../wear/wearintegration/DataHandlerMobile.kt | 4 +-- .../DataLayerListenerServiceMobile.kt | 8 ++--- .../DataLayerListenerServiceMobileHelper.kt | 2 +- .../plugins/main}/profile/ProfileFragment.kt | 8 ++--- .../plugins/main}/profile/ProfilePlugin.kt | 4 +-- .../plugins/main}/profile/ui/TimeListEdit.kt | 21 +++++------ .../aaps/plugins/main}/skins/SkinButtonsOn.kt | 4 +-- .../aaps/plugins/main}/skins/SkinClassic.kt | 6 ++-- .../aaps/plugins/main}/skins/SkinInterface.kt | 8 ++--- .../plugins/main}/skins/SkinLargeDisplay.kt | 6 ++-- .../plugins/main}/skins/SkinListPreference.kt | 4 +-- .../aaps/plugins/main}/skins/SkinLowRes.kt | 8 ++--- .../aaps/plugins/main}/skins/SkinProvider.kt | 6 ++-- .../res/layout/actions_stats_fragment.xml | 2 +- .../main/res/layout/cwf_infos_activity.xml | 3 +- .../src/main/res/layout/profile_fragment.xml | 2 +- .../res/layout/smscommunicator_fragment.xml | 2 +- .../src/main/res/layout/wear_fragment.xml | 2 +- .../main}/extensions/BolusExtensionKtTest.kt | 2 +- .../ExtendedBolusExtensionKtTest.kt | 2 +- .../extensions/GlucoseValueExtensionKtTest.kt | 2 +- .../TemporaryBasalExtensionKtTest.kt | 2 +- .../TemporaryTargetExtensionKtTest.kt | 2 +- .../extensions/TherapyEventExtensionKtTest.kt | 2 +- .../smsCommunicator/AuthRequestTest.kt | 8 ++--- .../general/smsCommunicator/SmsActionTest.kt | 2 +- .../SmsCommunicatorPluginTest.kt | 8 ++--- .../main}/general/smsCommunicator/SmsTest.kt | 2 +- .../main}/iob/AutosensDataStoreTest.kt | 6 ++-- 85 files changed, 266 insertions(+), 266 deletions(-) rename plugins/main/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt (99%) rename plugins/main/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/iob/iobCobCalculator/data/AutosensDataObject.kt (98%) rename plugins/main/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/iob/iobCobCalculator/data/AutosensDataStoreObject.kt (99%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/di/ActionsModule.kt (69%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/di/FoodModule.kt (70%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/di/OverviewModule.kt (66%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/di/PluginsModule.kt (74%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/di/ProfileModule.kt (75%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/di/SMSCommunicatorModule.kt (61%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/di/SkinsModule.kt (73%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/di/SkinsUiModule.kt (71%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/di/WearModule.kt (63%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/actions/ActionsFragment.kt (98%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/actions/ActionsPlugin.kt (93%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/food/FoodFragment.kt (98%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/food/FoodPlugin.kt (91%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/overview/OverviewFragment.kt (99%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/overview/OverviewMenusImpl.kt (99%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/overview/OverviewPlugin.kt (97%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/overview/graphData/GraphData.kt (99%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/overview/notifications/DismissNotificationService.kt (89%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/overview/notifications/NotificationStore.kt (96%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/overview/notifications/NotificationWithAction.kt (96%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/overview/notifications/events/EventUpdateOverviewNotification.kt (62%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/overview/ui/StatusLightHandler.kt (99%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/persistentNotification/DummyService.kt (97%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/persistentNotification/DummyServiceHelper.kt (97%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/persistentNotification/PersistentNotificationPlugin.kt (99%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/smsCommunicator/AuthRequest.kt (91%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/smsCommunicator/SmsAction.kt (97%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/smsCommunicator/SmsCommunicatorFragment.kt (93%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/smsCommunicator/SmsCommunicatorPlugin.kt (99%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt (94%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/smsCommunicator/events/EventSmsCommunicatorUpdateGui.kt (66%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/smsCommunicator/otp/OneTimePassword.kt (97%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/smsCommunicator/otp/OneTimePasswordValidationResult.kt (66%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/themes/ThemeSwitcherPlugin.kt (96%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/wear/WearFragment.kt (95%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/wear/WearPlugin.kt (95%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/wear/activities/CwfInfosActivity.kt (96%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/wear/wearintegration/DataHandlerMobile.kt (99%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/wear/wearintegration/DataLayerListenerServiceMobile.kt (98%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/wear/wearintegration/DataLayerListenerServiceMobileHelper.kt (97%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/profile/ProfileFragment.kt (98%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/profile/ProfilePlugin.kt (99%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/profile/ui/TimeListEdit.kt (94%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/skins/SkinButtonsOn.kt (84%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/skins/SkinClassic.kt (84%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/skins/SkinInterface.kt (94%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/skins/SkinLargeDisplay.kt (84%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/skins/SkinListPreference.kt (93%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/skins/SkinLowRes.kt (93%) rename plugins/main/src/main/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/skins/SkinProvider.kt (87%) rename plugins/main/src/test/{java/info/nightscout/core => kotlin/app/aaps/plugins/main}/extensions/BolusExtensionKtTest.kt (97%) rename plugins/main/src/test/{java/info/nightscout/core => kotlin/app/aaps/plugins/main}/extensions/ExtendedBolusExtensionKtTest.kt (99%) rename plugins/main/src/test/{java/info/nightscout/core => kotlin/app/aaps/plugins/main}/extensions/GlucoseValueExtensionKtTest.kt (98%) rename plugins/main/src/test/{java/info/nightscout/core => kotlin/app/aaps/plugins/main}/extensions/TemporaryBasalExtensionKtTest.kt (98%) rename plugins/main/src/test/{java/info/nightscout/core => kotlin/app/aaps/plugins/main}/extensions/TemporaryTargetExtensionKtTest.kt (97%) rename plugins/main/src/test/{java/info/nightscout/core => kotlin/app/aaps/plugins/main}/extensions/TherapyEventExtensionKtTest.kt (97%) rename plugins/main/src/test/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/smsCommunicator/AuthRequestTest.kt (92%) rename plugins/main/src/test/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/smsCommunicator/SmsActionTest.kt (97%) rename plugins/main/src/test/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/smsCommunicator/SmsCommunicatorPluginTest.kt (99%) rename plugins/main/src/test/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/general/smsCommunicator/SmsTest.kt (96%) rename plugins/main/src/test/{java/info/nightscout/plugins => kotlin/app/aaps/plugins/main}/iob/AutosensDataStoreTest.kt (99%) diff --git a/app/src/main/kotlin/app/aaps/MainActivity.kt b/app/src/main/kotlin/app/aaps/MainActivity.kt index c9d420fe8a..7b68857b63 100644 --- a/app/src/main/kotlin/app/aaps/MainActivity.kt +++ b/app/src/main/kotlin/app/aaps/MainActivity.kt @@ -62,6 +62,7 @@ import app.aaps.database.entities.UserEntry.Sources import app.aaps.plugins.configuration.activities.DaggerAppCompatActivityWithResult import app.aaps.plugins.configuration.activities.SingleFragmentActivity import app.aaps.plugins.configuration.setupwizard.SetupWizardActivity +import app.aaps.plugins.constraints.signatureVerifier.SignatureVerifierPlugin import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.tabs.TabLayoutMediator import com.google.firebase.crashlytics.FirebaseCrashlytics @@ -70,7 +71,6 @@ import com.joanzapata.iconify.fonts.FontAwesomeModule import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.ActivityMainBinding -import app.aaps.plugins.constraints.signatureVerifier.SignatureVerifierPlugin import info.nightscout.ui.activities.ProfileHelperActivity import info.nightscout.ui.activities.StatsActivity import info.nightscout.ui.activities.TreatmentsActivity @@ -127,7 +127,7 @@ class MainActivity : DaggerAppCompatActivityWithResult() { } // initialize screen wake lock - processPreferenceChange(EventPreferenceChange(rh.gs(info.nightscout.plugins.R.string.key_keep_screen_on))) + processPreferenceChange(EventPreferenceChange(rh.gs(app.aaps.plugins.main.R.string.key_keep_screen_on))) binding.mainPager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() { override fun onPageScrollStateChanged(state: Int) {} override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {} @@ -209,7 +209,7 @@ class MainActivity : DaggerAppCompatActivityWithResult() { R.id.nav_about -> { var message = "Build: ${BuildConfig.BUILDVERSION}\n" message += "Flavor: ${BuildConfig.FLAVOR}${BuildConfig.BUILD_TYPE}\n" - message += "${rh.gs(app.aaps.plugins.configuration.R.string.configbuilder_nightscoutversion_label)} ${activePlugin.activeNsClient?.detectedNsVersion() ?: rh.gs(info.nightscout.plugins.R.string.not_available_full)}" + message += "${rh.gs(app.aaps.plugins.configuration.R.string.configbuilder_nightscoutversion_label)} ${activePlugin.activeNsClient?.detectedNsVersion() ?: rh.gs(app.aaps.plugins.main.R.string.not_available_full)}" if (config.isEngineeringMode()) message += "\n${rh.gs(app.aaps.plugins.configuration.R.string.engineering_mode_enabled)}" if (config.isUnfinishedMode()) message += "\nUnfinished mode enabled" if (!fabricPrivacy.fabricEnabled()) message += "\n${rh.gs(app.aaps.core.ui.R.string.fabric_upload_disabled)}" @@ -334,13 +334,13 @@ class MainActivity : DaggerAppCompatActivityWithResult() { } private fun setWakeLock() { - val keepScreenOn = sp.getBoolean(info.nightscout.plugins.R.string.key_keep_screen_on, false) + val keepScreenOn = sp.getBoolean(app.aaps.plugins.main.R.string.key_keep_screen_on, false) if (keepScreenOn) window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) else window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) } private fun processPreferenceChange(ev: EventPreferenceChange) { - if (ev.isChanged(rh.gs(info.nightscout.plugins.R.string.key_keep_screen_on))) setWakeLock() - if (ev.isChanged(rh.gs(info.nightscout.plugins.R.string.key_skin))) recreate() + if (ev.isChanged(rh.gs(app.aaps.plugins.main.R.string.key_keep_screen_on))) setWakeLock() + if (ev.isChanged(rh.gs(app.aaps.plugins.main.R.string.key_skin))) recreate() } private fun setupViews() { @@ -374,7 +374,7 @@ class MainActivity : DaggerAppCompatActivityWithResult() { checkPluginPreferences(binding.mainPager) // Tabs - if (sp.getBoolean(info.nightscout.plugins.R.string.key_short_tabtitles, false)) { + if (sp.getBoolean(app.aaps.plugins.main.R.string.key_short_tabtitles, false)) { binding.tabsNormal.visibility = View.GONE binding.tabsCompact.visibility = View.VISIBLE binding.toolbar.layoutParams = LinearLayout.LayoutParams(Toolbar.LayoutParams.MATCH_PARENT, resources.getDimension(app.aaps.core.ui.R.dimen.compact_height).toInt()) diff --git a/app/src/main/kotlin/app/aaps/MainApp.kt b/app/src/main/kotlin/app/aaps/MainApp.kt index 4eeb983dd0..a59d595b27 100644 --- a/app/src/main/kotlin/app/aaps/MainApp.kt +++ b/app/src/main/kotlin/app/aaps/MainApp.kt @@ -36,6 +36,8 @@ import app.aaps.implementation.lifecycle.ProcessLifecycleListener import app.aaps.implementation.plugin.PluginStore import app.aaps.implementation.receivers.NetworkChangeReceiver import app.aaps.plugins.aps.utils.StaticInjector +import app.aaps.plugins.main.general.overview.notifications.NotificationStore +import app.aaps.plugins.main.general.themes.ThemeSwitcherPlugin import app.aaps.receivers.BTReceiver import app.aaps.receivers.ChargingStateReceiver import app.aaps.receivers.KeepAliveWorker @@ -47,8 +49,6 @@ import info.nightscout.androidaps.R import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.database.impl.transactions.VersionChangeTransaction -import info.nightscout.plugins.general.overview.notifications.NotificationStore -import info.nightscout.plugins.general.themes.ThemeSwitcherPlugin import info.nightscout.ui.activityMonitor.ActivityMonitor import info.nightscout.ui.widget.Widget import io.reactivex.rxjava3.disposables.CompositeDisposable @@ -80,12 +80,12 @@ class MainApp : DaggerApplication() { @Inject lateinit var compatDBHelper: CompatDBHelper @Inject lateinit var repository: AppRepository @Inject lateinit var dateUtil: DateUtil - @Suppress("unused") @Inject lateinit var staticInjector: StaticInjector// TODO avoid , here fake only to initialize + @Suppress("unused") @Inject lateinit var staticInjector: StaticInjector// better avoid, here fake only to initialize @Inject lateinit var uel: UserEntryLogger @Inject lateinit var uiInteraction: UiInteraction @Inject lateinit var notificationStore: NotificationStore @Inject lateinit var processLifecycleListener: Provider - @Inject lateinit var profileSwitchPlugin: ThemeSwitcherPlugin + @Inject lateinit var themeSwitcherPlugin: ThemeSwitcherPlugin @Inject lateinit var localAlertUtils: LocalAlertUtils @Inject lateinit var rh: Provider @@ -110,7 +110,7 @@ class MainApp : DaggerApplication() { } disposable += compatDBHelper.dbChangeDisposable() registerActivityLifecycleCallbacks(activityMonitor) - runOnUiThread { profileSwitchPlugin.setThemeMode() } + runOnUiThread { themeSwitcherPlugin.setThemeMode() } aapsLogger.debug("Version: " + BuildConfig.VERSION_NAME) aapsLogger.debug("BuildVersion: " + BuildConfig.BUILDVERSION) aapsLogger.debug("Remote: " + BuildConfig.REMOTE) @@ -228,9 +228,9 @@ class MainApp : DaggerApplication() { if (sp.getString(app.aaps.plugins.configuration.R.string.key_maintenance_logs_email, "") == "logs@androidaps.org") sp.putString(app.aaps.plugins.configuration.R.string.key_maintenance_logs_email, "logs@aaps.app") // fix values for theme switching - sp.putString(info.nightscout.plugins.R.string.value_dark_theme, "dark") - sp.putString(info.nightscout.plugins.R.string.value_light_theme, "light") - sp.putString(info.nightscout.plugins.R.string.value_system_theme, "system") + sp.putString(app.aaps.plugins.main.R.string.value_dark_theme, "dark") + sp.putString(app.aaps.plugins.main.R.string.value_light_theme, "light") + sp.putString(app.aaps.plugins.main.R.string.value_system_theme, "system") } diff --git a/app/src/main/kotlin/app/aaps/activities/HistoryBrowseActivity.kt b/app/src/main/kotlin/app/aaps/activities/HistoryBrowseActivity.kt index af6874d304..aa64fe3aa8 100644 --- a/app/src/main/kotlin/app/aaps/activities/HistoryBrowseActivity.kt +++ b/app/src/main/kotlin/app/aaps/activities/HistoryBrowseActivity.kt @@ -8,9 +8,6 @@ import android.view.ViewGroup import android.widget.LinearLayout import android.widget.RelativeLayout import android.widget.TextView -import app.aaps.core.main.events.EventIobCalculationProgress -import app.aaps.core.main.utils.fabric.FabricPrivacy -import app.aaps.core.main.workflow.CalculationWorkflow import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.extensions.toVisibility import app.aaps.core.interfaces.extensions.toVisibilityKeepSpace @@ -29,12 +26,15 @@ import app.aaps.core.interfaces.rx.events.EventScale import app.aaps.core.interfaces.rx.events.EventUpdateOverviewGraph import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T +import app.aaps.core.main.events.EventIobCalculationProgress +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.core.main.workflow.CalculationWorkflow +import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity +import app.aaps.plugins.main.general.overview.graphData.GraphData import com.google.android.material.datepicker.MaterialDatePicker import com.jjoe64.graphview.GraphView import dagger.android.HasAndroidInjector import info.nightscout.androidaps.databinding.ActivityHistorybrowseBinding -import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.plugins.general.overview.graphData.GraphData import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.Calendar @@ -76,7 +76,7 @@ class HistoryBrowseActivity : TranslatedDaggerAppCompatActivity() { binding = ActivityHistorybrowseBinding.inflate(layoutInflater) setContentView(binding.root) - title = rh.gs(info.nightscout.plugins.R.string.nav_history_browser) + title = rh.gs(app.aaps.plugins.main.R.string.nav_history_browser) supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayShowHomeEnabled(true) diff --git a/app/src/main/kotlin/app/aaps/activities/HistoryBrowserData.kt b/app/src/main/kotlin/app/aaps/activities/HistoryBrowserData.kt index ff4ec88c38..e93f9e29a6 100644 --- a/app/src/main/kotlin/app/aaps/activities/HistoryBrowserData.kt +++ b/app/src/main/kotlin/app/aaps/activities/HistoryBrowserData.kt @@ -14,9 +14,9 @@ import app.aaps.core.main.graph.OverviewData import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.main.workflow.CalculationWorkflow import app.aaps.implementation.overview.OverviewDataImpl +import app.aaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt index f0b06e98e3..d3f951a28d 100644 --- a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt @@ -41,6 +41,8 @@ import app.aaps.plugins.automation.AutomationPlugin import app.aaps.plugins.configuration.maintenance.MaintenancePlugin import app.aaps.plugins.constraints.safety.SafetyPlugin import app.aaps.plugins.insulin.InsulinOrefFreePeakPlugin +import app.aaps.plugins.main.general.smsCommunicator.SmsCommunicatorPlugin +import app.aaps.plugins.main.general.wear.WearPlugin import dagger.android.support.AndroidSupportInjection import info.nightscout.androidaps.R import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin @@ -49,8 +51,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.plugins.general.smsCommunicator.SmsCommunicatorPlugin -import info.nightscout.plugins.general.wear.WearPlugin import info.nightscout.plugins.sync.nsclient.NSClientPlugin import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin import info.nightscout.plugins.sync.openhumans.OpenHumansUploaderPlugin @@ -186,7 +186,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang addPreferencesFromResource(pluginId, rootKey) } else { addPreferencesFromResource(R.xml.pref_general, rootKey) - addPreferencesFromResource(info.nightscout.plugins.R.xml.pref_overview, rootKey) + addPreferencesFromResource(app.aaps.plugins.main.R.xml.pref_overview, rootKey) addPreferencesFromResourceIfEnabled(safetyPlugin, rootKey) addPreferencesFromResourceIfEnabled(eversensePlugin, rootKey) addPreferencesFromResourceIfEnabled(dexcomPlugin, rootKey) @@ -243,7 +243,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang //recreate() does not update language so better close settings activity?.finish() } - if (key == rh.gs(info.nightscout.plugins.R.string.key_short_tabtitles)) { + if (key == rh.gs(app.aaps.plugins.main.R.string.key_short_tabtitles)) { rxBus.send(EventRebuildTabs()) } if (key == rh.gs(info.nightscout.core.utils.R.string.key_units)) { @@ -475,7 +475,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang true } // NSClient copy settings - rh.gs(info.nightscout.plugins.R.string.key_statuslights_copy_ns) -> { + rh.gs(app.aaps.plugins.main.R.string.key_statuslights_copy_ns) -> { nsSettingStatus.copyStatusLightsNsSettings(context) true } diff --git a/app/src/main/kotlin/app/aaps/di/AppComponent.kt b/app/src/main/kotlin/app/aaps/di/AppComponent.kt index c3a290caff..94ae6cc216 100644 --- a/app/src/main/kotlin/app/aaps/di/AppComponent.kt +++ b/app/src/main/kotlin/app/aaps/di/AppComponent.kt @@ -9,6 +9,7 @@ import app.aaps.plugins.automation.di.AutomationModule import app.aaps.plugins.configuration.di.ConfigurationModule import app.aaps.plugins.constraints.di.PluginsConstraintsModule import app.aaps.plugins.insulin.di.InsulinModule +import app.aaps.plugins.main.di.PluginsModule import app.aaps.shared.impl.di.SharedImplModule import dagger.BindsInstance import dagger.Component @@ -23,7 +24,6 @@ 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.database.impl.DatabaseModule -import info.nightscout.plugins.di.PluginsModule import info.nightscout.plugins.sync.di.OpenHumansModule import info.nightscout.plugins.sync.di.SyncModule import info.nightscout.pump.combo.di.ComboModule diff --git a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt index 5d8281611c..00d2180f77 100644 --- a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt +++ b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt @@ -20,6 +20,15 @@ import app.aaps.plugins.insulin.InsulinLyumjevPlugin import app.aaps.plugins.insulin.InsulinOrefFreePeakPlugin import app.aaps.plugins.insulin.InsulinOrefRapidActingPlugin import app.aaps.plugins.insulin.InsulinOrefUltraRapidActingPlugin +import app.aaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin +import app.aaps.plugins.main.general.actions.ActionsPlugin +import app.aaps.plugins.main.general.food.FoodPlugin +import app.aaps.plugins.main.general.overview.OverviewPlugin +import app.aaps.plugins.main.general.persistentNotification.PersistentNotificationPlugin +import app.aaps.plugins.main.general.smsCommunicator.SmsCommunicatorPlugin +import app.aaps.plugins.main.general.themes.ThemeSwitcherPlugin +import app.aaps.plugins.main.general.wear.WearPlugin +import app.aaps.plugins.main.profile.ProfilePlugin import dagger.Binds import dagger.Module import dagger.multibindings.IntKey @@ -32,15 +41,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.plugins.general.actions.ActionsPlugin -import info.nightscout.plugins.general.food.FoodPlugin -import info.nightscout.plugins.general.overview.OverviewPlugin -import info.nightscout.plugins.general.persistentNotification.PersistentNotificationPlugin -import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin -import info.nightscout.plugins.general.themes.ThemeSwitcherPlugin -import info.nightscout.plugins.general.wear.WearPlugin -import info.nightscout.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin -import info.nightscout.plugins.profile.ProfilePlugin import info.nightscout.plugins.sync.dataBroadcaster.DataBroadcastPlugin import info.nightscout.plugins.sync.nsclient.NSClientPlugin import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin diff --git a/app/src/main/kotlin/app/aaps/implementations/InstantiatorImpl.kt b/app/src/main/kotlin/app/aaps/implementations/InstantiatorImpl.kt index b4074501f7..b18aa83142 100644 --- a/app/src/main/kotlin/app/aaps/implementations/InstantiatorImpl.kt +++ b/app/src/main/kotlin/app/aaps/implementations/InstantiatorImpl.kt @@ -7,9 +7,9 @@ import app.aaps.core.interfaces.profile.ProfileStore import app.aaps.core.interfaces.utils.DateUtil import app.aaps.implementation.profile.ProfileStoreObject import app.aaps.plugins.aps.APSResultObject +import app.aaps.plugins.iob.iobCobCalculator.data.AutosensDataObject import dagger.Reusable import dagger.android.HasAndroidInjector -import info.nightscout.plugins.iob.iobCobCalculator.data.AutosensDataObject import org.json.JSONObject import javax.inject.Inject diff --git a/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt b/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt index b367e1aff0..2218d96113 100644 --- a/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt +++ b/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt @@ -17,9 +17,9 @@ import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.main.events.EventNewNotification import app.aaps.core.ui.toast.ToastUtils import app.aaps.plugins.configuration.activities.SingleFragmentActivity +import app.aaps.plugins.main.general.overview.notifications.NotificationWithAction import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.plugins.general.overview.notifications.NotificationWithAction import info.nightscout.ui.activities.BolusProgressHelperActivity import info.nightscout.ui.activities.ErrorHelperActivity import info.nightscout.ui.activities.QuickWizardListActivity diff --git a/app/src/main/kotlin/app/aaps/receivers/AutoStartReceiver.kt b/app/src/main/kotlin/app/aaps/receivers/AutoStartReceiver.kt index 24c45e74d4..f77791ac6a 100644 --- a/app/src/main/kotlin/app/aaps/receivers/AutoStartReceiver.kt +++ b/app/src/main/kotlin/app/aaps/receivers/AutoStartReceiver.kt @@ -2,8 +2,8 @@ package app.aaps.receivers import android.content.Context import android.content.Intent +import app.aaps.plugins.main.general.persistentNotification.DummyServiceHelper import dagger.android.DaggerBroadcastReceiver -import info.nightscout.plugins.general.persistentNotification.DummyServiceHelper import javax.inject.Inject class AutoStartReceiver : DaggerBroadcastReceiver() { diff --git a/app/src/main/kotlin/app/aaps/receivers/DataReceiver.kt b/app/src/main/kotlin/app/aaps/receivers/DataReceiver.kt index 815b507bac..1eb509ac49 100644 --- a/app/src/main/kotlin/app/aaps/receivers/DataReceiver.kt +++ b/app/src/main/kotlin/app/aaps/receivers/DataReceiver.kt @@ -12,8 +12,8 @@ import app.aaps.core.utils.extensions.copyDouble import app.aaps.core.utils.extensions.copyLong import app.aaps.core.utils.extensions.copyString import app.aaps.core.utils.receivers.DataWorkerStorage +import app.aaps.plugins.main.general.smsCommunicator.SmsCommunicatorPlugin import dagger.android.DaggerBroadcastReceiver -import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin import info.nightscout.source.AidexPlugin import info.nightscout.source.DexcomPlugin import info.nightscout.source.EversensePlugin diff --git a/app/src/main/kotlin/app/aaps/workflow/CalculationWorkflowImpl.kt b/app/src/main/kotlin/app/aaps/workflow/CalculationWorkflowImpl.kt index 46af8b740f..4013d433d8 100644 --- a/app/src/main/kotlin/app/aaps/workflow/CalculationWorkflowImpl.kt +++ b/app/src/main/kotlin/app/aaps/workflow/CalculationWorkflowImpl.kt @@ -29,8 +29,8 @@ import app.aaps.core.main.workflow.CalculationWorkflow.Companion.MAIN_CALCULATIO import app.aaps.core.main.workflow.CalculationWorkflow.Companion.PASS import app.aaps.core.utils.receivers.DataWorkerStorage import app.aaps.core.utils.worker.then +import app.aaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin import dagger.android.HasAndroidInjector -import info.nightscout.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin import info.nightscout.workflow.DummyWorker import info.nightscout.workflow.InvokeLoopWorker import info.nightscout.workflow.LoadBgDataWorker diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml index cb89831ba4..82ae91d083 100644 --- a/app/src/main/res/xml/pref_general.xml +++ b/app/src/main/res/xml/pref_general.xml @@ -97,7 +97,7 @@ - diff --git a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerAutosensValueTest.kt b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerAutosensValueTest.kt index 765e255d2d..93ca063187 100644 --- a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerAutosensValueTest.kt +++ b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/triggers/TriggerAutosensValueTest.kt @@ -2,8 +2,8 @@ package app.aaps.plugins.automation.triggers import app.aaps.plugins.automation.R import app.aaps.plugins.automation.elements.Comparator +import app.aaps.plugins.iob.iobCobCalculator.data.AutosensDataObject import com.google.common.truth.Truth.assertThat -import info.nightscout.plugins.iob.iobCobCalculator.data.AutosensDataObject import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test diff --git a/plugins/main/build.gradle b/plugins/main/build.gradle index efa697e097..42103017e3 100644 --- a/plugins/main/build.gradle +++ b/plugins/main/build.gradle @@ -11,7 +11,7 @@ apply from: "${project.rootDir}/core/main/test_dependencies.gradle" apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/main/jacoco_global.gradle" android { - namespace 'info.nightscout.plugins' + namespace 'app.aaps.plugins.main' } dependencies { diff --git a/plugins/main/src/main/AndroidManifest.xml b/plugins/main/src/main/AndroidManifest.xml index b830dd73bb..3b6b9488e3 100644 --- a/plugins/main/src/main/AndroidManifest.xml +++ b/plugins/main/src/main/AndroidManifest.xml @@ -17,7 +17,7 @@ android:exported="false" android:theme="@style/AppTheme"> - + @@ -28,10 +28,10 @@ android:exported="false" android:theme="@style/AppTheme" /> - + - llp.setMargins(0, 25, 0, 25) // llp.setMargins(left, top, right, bottom); + llp.setMargins(0, 25, 0, 25) llp.gravity = Gravity.CENTER } it.setOnClickListener { @@ -112,13 +113,13 @@ class TimeListEdit( private fun inflateRow(position: Int) { val resource = - if (data2 == null) info.nightscout.plugins.R.layout.timelistedit_element - else info.nightscout.plugins.R.layout.timelistedit_element_vertical + if (data2 == null) R.layout.timelistedit_element + else R.layout.timelistedit_element_vertical val childView = LayoutInflater.from(context).inflate(resource, layout, false).also { intervals[position] = it layout?.addView(it) } - childView.findViewById(info.nightscout.plugins.R.id.timelistedit_add).also { + childView.findViewById(R.id.timelistedit_add).also { addButtons[position] = it it.setOnClickListener { val seconds = secondFromMidnight(position) @@ -135,7 +136,7 @@ class TimeListEdit( fillView() } } - childView.findViewById(info.nightscout.plugins.R.id.timelistedit_remove).also { + childView.findViewById(R.id.timelistedit_remove).also { removeButtons[position] = it it.setOnClickListener { removeItem(position) @@ -144,7 +145,7 @@ class TimeListEdit( fillView() } } - SpinnerHelper(childView.findViewById(info.nightscout.plugins.R.id.timelistedit_time)).also { + SpinnerHelper(childView.findViewById(R.id.timelistedit_time)).also { spinners[position] = it it.setOnItemSelectedListener( object : AdapterView.OnItemSelectedListener { @@ -160,7 +161,7 @@ class TimeListEdit( } ) } - childView.findViewById(info.nightscout.plugins.R.id.timelistedit_edit1).also { + childView.findViewById(R.id.timelistedit_edit1).also { numberPickers1[position] = it it.setTextWatcher(object : TextWatcher { override fun afterTextChanged(s: Editable) { @@ -180,7 +181,7 @@ class TimeListEdit( }) it.tag = "$tagPrefix-1-$position" } - childView.findViewById(info.nightscout.plugins.R.id.timelistedit_edit2).also { + childView.findViewById(R.id.timelistedit_edit2).also { numberPickers2[position] = it it.setTextWatcher(object : TextWatcher { override fun afterTextChanged(s: Editable) { diff --git a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinButtonsOn.kt b/plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinButtonsOn.kt similarity index 84% rename from plugins/main/src/main/java/info/nightscout/plugins/skins/SkinButtonsOn.kt rename to plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinButtonsOn.kt index 3464cf41b4..ee46b5de4b 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinButtonsOn.kt +++ b/plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinButtonsOn.kt @@ -1,7 +1,7 @@ -package info.nightscout.plugins.skins +package app.aaps.plugins.main.skins import app.aaps.core.interfaces.configuration.Config -import info.nightscout.plugins.R +import app.aaps.plugins.main.R import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinClassic.kt b/plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinClassic.kt similarity index 84% rename from plugins/main/src/main/java/info/nightscout/plugins/skins/SkinClassic.kt rename to plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinClassic.kt index 044b18ea4c..653f0b3f8f 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinClassic.kt +++ b/plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinClassic.kt @@ -1,8 +1,8 @@ -package info.nightscout.plugins.skins +package app.aaps.plugins.main.skins import app.aaps.core.interfaces.configuration.Config -import info.nightscout.plugins.R -import info.nightscout.plugins.databinding.OverviewFragmentBinding +import app.aaps.plugins.main.R +import app.aaps.plugins.main.databinding.OverviewFragmentBinding import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinInterface.kt b/plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinInterface.kt similarity index 94% rename from plugins/main/src/main/java/info/nightscout/plugins/skins/SkinInterface.kt rename to plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinInterface.kt index 8c00941204..60b78be9fe 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinInterface.kt +++ b/plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinInterface.kt @@ -1,13 +1,13 @@ -package info.nightscout.plugins.skins +package app.aaps.plugins.main.skins import android.util.TypedValue.COMPLEX_UNIT_PX import android.view.View import android.widget.LinearLayout import androidx.annotation.StringRes import androidx.constraintlayout.widget.ConstraintLayout -import info.nightscout.plugins.R -import info.nightscout.plugins.databinding.ActionsFragmentBinding -import info.nightscout.plugins.databinding.OverviewFragmentBinding +import app.aaps.plugins.main.R +import app.aaps.plugins.main.databinding.ActionsFragmentBinding +import app.aaps.plugins.main.databinding.OverviewFragmentBinding interface SkinInterface { diff --git a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinLargeDisplay.kt b/plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinLargeDisplay.kt similarity index 84% rename from plugins/main/src/main/java/info/nightscout/plugins/skins/SkinLargeDisplay.kt rename to plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinLargeDisplay.kt index 8116e203f3..bc4750fd0b 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinLargeDisplay.kt +++ b/plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinLargeDisplay.kt @@ -1,8 +1,8 @@ -package info.nightscout.plugins.skins +package app.aaps.plugins.main.skins import app.aaps.core.interfaces.configuration.Config -import info.nightscout.plugins.R -import info.nightscout.plugins.databinding.OverviewFragmentBinding +import app.aaps.plugins.main.R +import app.aaps.plugins.main.databinding.OverviewFragmentBinding import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinListPreference.kt b/plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinListPreference.kt similarity index 93% rename from plugins/main/src/main/java/info/nightscout/plugins/skins/SkinListPreference.kt rename to plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinListPreference.kt index 137e5749d3..eff2589464 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinListPreference.kt +++ b/plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinListPreference.kt @@ -1,10 +1,10 @@ -package info.nightscout.plugins.skins +package app.aaps.plugins.main.skins import android.content.Context import android.util.AttributeSet import androidx.preference.ListPreference import dagger.android.HasAndroidInjector -import java.util.* +import java.util.Vector import javax.inject.Inject class SkinListPreference(context: Context, attrs: AttributeSet?) diff --git a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinLowRes.kt b/plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinLowRes.kt similarity index 93% rename from plugins/main/src/main/java/info/nightscout/plugins/skins/SkinLowRes.kt rename to plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinLowRes.kt index 2b691a3a40..6ec62360f9 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinLowRes.kt +++ b/plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinLowRes.kt @@ -1,11 +1,11 @@ -package info.nightscout.plugins.skins +package app.aaps.plugins.main.skins import android.view.View.GONE import android.view.ViewGroup import app.aaps.core.interfaces.configuration.Config -import info.nightscout.plugins.R -import info.nightscout.plugins.databinding.ActionsFragmentBinding -import info.nightscout.plugins.databinding.OverviewFragmentBinding +import app.aaps.plugins.main.R +import app.aaps.plugins.main.databinding.ActionsFragmentBinding +import app.aaps.plugins.main.databinding.OverviewFragmentBinding import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinProvider.kt b/plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinProvider.kt similarity index 87% rename from plugins/main/src/main/java/info/nightscout/plugins/skins/SkinProvider.kt rename to plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinProvider.kt index f85ff8788b..ffba114e27 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinProvider.kt +++ b/plugins/main/src/main/kotlin/app/aaps/plugins/main/skins/SkinProvider.kt @@ -1,8 +1,8 @@ -package info.nightscout.plugins.skins +package app.aaps.plugins.main.skins import app.aaps.core.interfaces.sharedPreferences.SP -import info.nightscout.plugins.R -import info.nightscout.plugins.di.SkinsModule +import app.aaps.plugins.main.R +import app.aaps.plugins.main.di.SkinsModule import java.util.Collections import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/main/src/main/res/layout/actions_stats_fragment.xml b/plugins/main/src/main/res/layout/actions_stats_fragment.xml index 92369d4d14..4822b44d5a 100644 --- a/plugins/main/src/main/res/layout/actions_stats_fragment.xml +++ b/plugins/main/src/main/res/layout/actions_stats_fragment.xml @@ -4,7 +4,7 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:stretchColumns="0,2,4" - tools:context="info.nightscout.plugins.general.actions.ActionsFragment"> + tools:context=".general.actions.ActionsFragment"> + tools:context=".general.wear.activities.CwfInfosActivity"> + tools:context=".profile.ProfileFragment"> + tools:context=".general.smsCommunicator.SmsCommunicatorFragment"> + tools:context=".general.wear.WearFragment"> Date: Tue, 26 Sep 2023 16:21:47 +0200 Subject: [PATCH 12/17] :plugins:sensitivity cleanup --- .../kotlin/app/aaps/activities/MyPreferenceFragment.kt | 8 ++++---- app/src/main/kotlin/app/aaps/di/PluginsListModule.kt | 6 +++--- plugins/sensitivity/build.gradle | 3 ++- .../plugins}/sensitivity/AbstractSensitivityPlugin.kt | 2 +- .../aaps/plugins}/sensitivity/SensitivityAAPSPlugin.kt | 6 +++--- .../aaps/plugins}/sensitivity/SensitivityOref1Plugin.kt | 6 +++--- .../sensitivity/SensitivityWeightedAveragePlugin.kt | 6 +++--- .../sensitivity/extensions/ProfileSwitchExtensions.kt | 2 +- .../sensitivity/extensions/TherapyEventExtensions.kt | 2 +- .../plugins}/sensitivity/AbstractSensitivityPluginTest.kt | 2 +- 10 files changed, 22 insertions(+), 21 deletions(-) rename plugins/sensitivity/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/sensitivity/AbstractSensitivityPlugin.kt (98%) rename plugins/sensitivity/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/sensitivity/SensitivityAAPSPlugin.kt (98%) rename plugins/sensitivity/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/sensitivity/SensitivityOref1Plugin.kt (98%) rename plugins/sensitivity/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/sensitivity/SensitivityWeightedAveragePlugin.kt (98%) rename plugins/sensitivity/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/sensitivity/extensions/ProfileSwitchExtensions.kt (91%) rename plugins/sensitivity/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/sensitivity/extensions/TherapyEventExtensions.kt (87%) rename plugins/sensitivity/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/sensitivity/AbstractSensitivityPluginTest.kt (98%) diff --git a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt index d3f951a28d..f9d602f986 100644 --- a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt @@ -43,6 +43,9 @@ import app.aaps.plugins.constraints.safety.SafetyPlugin import app.aaps.plugins.insulin.InsulinOrefFreePeakPlugin import app.aaps.plugins.main.general.smsCommunicator.SmsCommunicatorPlugin import app.aaps.plugins.main.general.wear.WearPlugin +import app.aaps.plugins.sensitivity.SensitivityAAPSPlugin +import app.aaps.plugins.sensitivity.SensitivityOref1Plugin +import app.aaps.plugins.sensitivity.SensitivityWeightedAveragePlugin import dagger.android.support.AndroidSupportInjection import info.nightscout.androidaps.R import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin @@ -61,9 +64,6 @@ import info.nightscout.pump.combov2.ComboV2Plugin import info.nightscout.pump.diaconn.DiaconnG8Plugin import info.nightscout.pump.medtrum.MedtrumPlugin import info.nightscout.pump.virtual.VirtualPumpPlugin -import info.nightscout.sensitivity.SensitivityAAPSPlugin -import info.nightscout.sensitivity.SensitivityOref1Plugin -import info.nightscout.sensitivity.SensitivityWeightedAveragePlugin import info.nightscout.source.AidexPlugin import info.nightscout.source.DexcomPlugin import info.nightscout.source.EversensePlugin @@ -475,7 +475,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang true } // NSClient copy settings - rh.gs(app.aaps.plugins.main.R.string.key_statuslights_copy_ns) -> { + rh.gs(app.aaps.plugins.main.R.string.key_statuslights_copy_ns) -> { nsSettingStatus.copyStatusLightsNsSettings(context) true } diff --git a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt index 00d2180f77..1b12a56e97 100644 --- a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt +++ b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt @@ -29,6 +29,9 @@ import app.aaps.plugins.main.general.smsCommunicator.SmsCommunicatorPlugin import app.aaps.plugins.main.general.themes.ThemeSwitcherPlugin import app.aaps.plugins.main.general.wear.WearPlugin import app.aaps.plugins.main.profile.ProfilePlugin +import app.aaps.plugins.sensitivity.SensitivityAAPSPlugin +import app.aaps.plugins.sensitivity.SensitivityOref1Plugin +import app.aaps.plugins.sensitivity.SensitivityWeightedAveragePlugin import dagger.Binds import dagger.Module import dagger.multibindings.IntKey @@ -52,9 +55,6 @@ import info.nightscout.pump.combov2.ComboV2Plugin import info.nightscout.pump.diaconn.DiaconnG8Plugin import info.nightscout.pump.medtrum.MedtrumPlugin import info.nightscout.pump.virtual.VirtualPumpPlugin -import info.nightscout.sensitivity.SensitivityAAPSPlugin -import info.nightscout.sensitivity.SensitivityOref1Plugin -import info.nightscout.sensitivity.SensitivityWeightedAveragePlugin import info.nightscout.smoothing.AvgSmoothingPlugin import info.nightscout.smoothing.ExponentialSmoothingPlugin import info.nightscout.smoothing.NoSmoothingPlugin diff --git a/plugins/sensitivity/build.gradle b/plugins/sensitivity/build.gradle index 143418c947..d33ef78ef0 100644 --- a/plugins/sensitivity/build.gradle +++ b/plugins/sensitivity/build.gradle @@ -10,8 +10,9 @@ apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/main/test_dependencies.gradle" apply from: "${project.rootDir}/core/main/jacoco_global.gradle" + android { - namespace 'info.nightscout.sensitivity' + namespace 'app.aaps.plugins.sensitivity' } diff --git a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/AbstractSensitivityPlugin.kt b/plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/AbstractSensitivityPlugin.kt similarity index 98% rename from plugins/sensitivity/src/main/java/info/nightscout/sensitivity/AbstractSensitivityPlugin.kt rename to plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/AbstractSensitivityPlugin.kt index ab191d1cac..6afb9962d4 100644 --- a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/AbstractSensitivityPlugin.kt +++ b/plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/AbstractSensitivityPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.sensitivity +package app.aaps.plugins.sensitivity import app.aaps.core.interfaces.aps.AutosensDataStore import app.aaps.core.interfaces.aps.AutosensResult diff --git a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityAAPSPlugin.kt b/plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/SensitivityAAPSPlugin.kt similarity index 98% rename from plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityAAPSPlugin.kt rename to plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/SensitivityAAPSPlugin.kt index 0dff696855..c7d5da2692 100644 --- a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityAAPSPlugin.kt +++ b/plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/SensitivityAAPSPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.sensitivity +package app.aaps.plugins.sensitivity import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.aps.AutosensDataStore @@ -16,10 +16,10 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.MidnightUtils import app.aaps.core.utils.Percentile import app.aaps.database.entities.TherapyEvent +import app.aaps.plugins.sensitivity.extensions.isPSEvent5minBack +import app.aaps.plugins.sensitivity.extensions.isTherapyEventEvent5minBack import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.sensitivity.extensions.isPSEvent5minBack -import info.nightscout.sensitivity.extensions.isTherapyEventEvent5minBack import org.json.JSONException import org.json.JSONObject import java.util.Arrays diff --git a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityOref1Plugin.kt b/plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/SensitivityOref1Plugin.kt similarity index 98% rename from plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityOref1Plugin.kt rename to plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/SensitivityOref1Plugin.kt index 640bc4976e..7b4887808d 100644 --- a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityOref1Plugin.kt +++ b/plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/SensitivityOref1Plugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.sensitivity +package app.aaps.plugins.sensitivity import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.aps.AutosensDataStore @@ -19,10 +19,10 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.MidnightUtils import app.aaps.core.utils.Percentile import app.aaps.database.entities.TherapyEvent +import app.aaps.plugins.sensitivity.extensions.isPSEvent5minBack +import app.aaps.plugins.sensitivity.extensions.isTherapyEventEvent5minBack import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.sensitivity.extensions.isPSEvent5minBack -import info.nightscout.sensitivity.extensions.isTherapyEventEvent5minBack import org.json.JSONException import org.json.JSONObject import java.util.Arrays diff --git a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityWeightedAveragePlugin.kt b/plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt similarity index 98% rename from plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityWeightedAveragePlugin.kt rename to plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt index 3f303056f6..c048c1c2fa 100644 --- a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityWeightedAveragePlugin.kt +++ b/plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.sensitivity +package app.aaps.plugins.sensitivity import androidx.collection.LongSparseArray import app.aaps.annotations.OpenForTesting @@ -16,10 +16,10 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.MidnightUtils import app.aaps.database.entities.TherapyEvent +import app.aaps.plugins.sensitivity.extensions.isPSEvent5minBack +import app.aaps.plugins.sensitivity.extensions.isTherapyEventEvent5minBack import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.sensitivity.extensions.isPSEvent5minBack -import info.nightscout.sensitivity.extensions.isTherapyEventEvent5minBack import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/ProfileSwitchExtensions.kt b/plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/extensions/ProfileSwitchExtensions.kt similarity index 91% rename from plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/ProfileSwitchExtensions.kt rename to plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/extensions/ProfileSwitchExtensions.kt index dddbf7b901..62acb233cc 100644 --- a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/ProfileSwitchExtensions.kt +++ b/plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/extensions/ProfileSwitchExtensions.kt @@ -1,4 +1,4 @@ -package info.nightscout.sensitivity.extensions +package app.aaps.plugins.sensitivity.extensions import app.aaps.core.interfaces.utils.T import app.aaps.database.entities.ProfileSwitch diff --git a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/TherapyEventExtensions.kt b/plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/extensions/TherapyEventExtensions.kt similarity index 87% rename from plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/TherapyEventExtensions.kt rename to plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/extensions/TherapyEventExtensions.kt index dc2af0a6b4..33aebee2fc 100644 --- a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/TherapyEventExtensions.kt +++ b/plugins/sensitivity/src/main/kotlin/app/aaps/plugins/sensitivity/extensions/TherapyEventExtensions.kt @@ -1,4 +1,4 @@ -package info.nightscout.sensitivity.extensions +package app.aaps.plugins.sensitivity.extensions import app.aaps.core.interfaces.utils.T import app.aaps.database.entities.TherapyEvent diff --git a/plugins/sensitivity/src/test/java/info/nightscout/sensitivity/AbstractSensitivityPluginTest.kt b/plugins/sensitivity/src/test/kotlin/app/aaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt similarity index 98% rename from plugins/sensitivity/src/test/java/info/nightscout/sensitivity/AbstractSensitivityPluginTest.kt rename to plugins/sensitivity/src/test/kotlin/app/aaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt index 9ed5f2e319..f514a3751f 100644 --- a/plugins/sensitivity/src/test/java/info/nightscout/sensitivity/AbstractSensitivityPluginTest.kt +++ b/plugins/sensitivity/src/test/kotlin/app/aaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt @@ -1,4 +1,4 @@ -package info.nightscout.sensitivity +package app.aaps.plugins.sensitivity import app.aaps.core.interfaces.aps.AutosensDataStore import app.aaps.core.interfaces.aps.AutosensResult From b79d653be283e706cb8b0d74bea29bd9b95a60ab Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 26 Sep 2023 16:24:49 +0200 Subject: [PATCH 13/17] :plugins:smoothing cleanup --- app/src/main/kotlin/app/aaps/di/PluginsListModule.kt | 6 +++--- plugins/smoothing/build.gradle | 3 ++- .../app/aaps/plugins}/smoothing/AvgSmoothingPlugin.kt | 2 +- .../aaps/plugins}/smoothing/ExponentialSmoothingPlugin.kt | 2 +- .../app/aaps/plugins}/smoothing/NoSmoothingPlugin.kt | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) rename plugins/smoothing/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/smoothing/AvgSmoothingPlugin.kt (98%) rename plugins/smoothing/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/smoothing/ExponentialSmoothingPlugin.kt (99%) rename plugins/smoothing/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/smoothing/NoSmoothingPlugin.kt (97%) diff --git a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt index 1b12a56e97..b2b9eab5cc 100644 --- a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt +++ b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt @@ -55,9 +55,9 @@ import info.nightscout.pump.combov2.ComboV2Plugin import info.nightscout.pump.diaconn.DiaconnG8Plugin import info.nightscout.pump.medtrum.MedtrumPlugin import info.nightscout.pump.virtual.VirtualPumpPlugin -import info.nightscout.smoothing.AvgSmoothingPlugin -import info.nightscout.smoothing.ExponentialSmoothingPlugin -import info.nightscout.smoothing.NoSmoothingPlugin +import app.aaps.plugins.smoothing.AvgSmoothingPlugin +import app.aaps.plugins.smoothing.ExponentialSmoothingPlugin +import app.aaps.plugins.smoothing.NoSmoothingPlugin import info.nightscout.source.AidexPlugin import info.nightscout.source.DexcomPlugin import info.nightscout.source.GlimpPlugin diff --git a/plugins/smoothing/build.gradle b/plugins/smoothing/build.gradle index aab84d1216..c910ef3dbd 100644 --- a/plugins/smoothing/build.gradle +++ b/plugins/smoothing/build.gradle @@ -10,8 +10,9 @@ apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/main/test_dependencies.gradle" apply from: "${project.rootDir}/core/main/jacoco_global.gradle" + android { - namespace 'info.nightscout.smoothing' + namespace 'app.aaps.plugins.smoothing' } diff --git a/plugins/smoothing/src/main/java/info/nightscout/smoothing/AvgSmoothingPlugin.kt b/plugins/smoothing/src/main/kotlin/app/aaps/plugins/smoothing/AvgSmoothingPlugin.kt similarity index 98% rename from plugins/smoothing/src/main/java/info/nightscout/smoothing/AvgSmoothingPlugin.kt rename to plugins/smoothing/src/main/kotlin/app/aaps/plugins/smoothing/AvgSmoothingPlugin.kt index 136ff5012c..2527edf1dc 100644 --- a/plugins/smoothing/src/main/java/info/nightscout/smoothing/AvgSmoothingPlugin.kt +++ b/plugins/smoothing/src/main/kotlin/app/aaps/plugins/smoothing/AvgSmoothingPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.smoothing +package app.aaps.plugins.smoothing import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.iob.InMemoryGlucoseValue diff --git a/plugins/smoothing/src/main/java/info/nightscout/smoothing/ExponentialSmoothingPlugin.kt b/plugins/smoothing/src/main/kotlin/app/aaps/plugins/smoothing/ExponentialSmoothingPlugin.kt similarity index 99% rename from plugins/smoothing/src/main/java/info/nightscout/smoothing/ExponentialSmoothingPlugin.kt rename to plugins/smoothing/src/main/kotlin/app/aaps/plugins/smoothing/ExponentialSmoothingPlugin.kt index 53aebb3394..4c083937d6 100644 --- a/plugins/smoothing/src/main/java/info/nightscout/smoothing/ExponentialSmoothingPlugin.kt +++ b/plugins/smoothing/src/main/kotlin/app/aaps/plugins/smoothing/ExponentialSmoothingPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.smoothing +package app.aaps.plugins.smoothing import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.iob.InMemoryGlucoseValue diff --git a/plugins/smoothing/src/main/java/info/nightscout/smoothing/NoSmoothingPlugin.kt b/plugins/smoothing/src/main/kotlin/app/aaps/plugins/smoothing/NoSmoothingPlugin.kt similarity index 97% rename from plugins/smoothing/src/main/java/info/nightscout/smoothing/NoSmoothingPlugin.kt rename to plugins/smoothing/src/main/kotlin/app/aaps/plugins/smoothing/NoSmoothingPlugin.kt index 6efcd8beda..f461b7ab9f 100644 --- a/plugins/smoothing/src/main/java/info/nightscout/smoothing/NoSmoothingPlugin.kt +++ b/plugins/smoothing/src/main/kotlin/app/aaps/plugins/smoothing/NoSmoothingPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.smoothing +package app.aaps.plugins.smoothing import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.iob.InMemoryGlucoseValue From 678c1adc9af2d51d446a3a31ea4954ec811b0f4b Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 26 Sep 2023 16:31:08 +0200 Subject: [PATCH 14/17] :plugins:source cleanup --- .../aaps/activities/MyPreferenceFragment.kt | 16 +++++------ .../main/kotlin/app/aaps/di/AppComponent.kt | 2 +- .../kotlin/app/aaps/di/PluginsListModule.kt | 28 +++++++++---------- .../kotlin/app/aaps/receivers/DataReceiver.kt | 16 +++++------ .../constraints/ConstraintsCheckerImplTest.kt | 9 +++--- .../constraints/safety/SafetyPluginTest.kt | 3 +- plugins/source/build.gradle | 3 +- plugins/source/src/main/AndroidManifest.xml | 2 +- .../app/aaps/plugins}/source/AidexPlugin.kt | 2 +- .../aaps/plugins}/source/BGSourceFragment.kt | 6 ++-- .../app/aaps/plugins}/source/DexcomPlugin.kt | 4 +-- .../aaps/plugins}/source/EversensePlugin.kt | 2 +- .../app/aaps/plugins}/source/GlimpPlugin.kt | 2 +- .../app/aaps/plugins}/source/GlunovoPlugin.kt | 2 +- .../aaps/plugins}/source/IntelligoPlugin.kt | 2 +- .../app/aaps/plugins}/source/MM640gPlugin.kt | 2 +- .../plugins}/source/NSClientSourcePlugin.kt | 2 +- .../app/aaps/plugins}/source/PoctechPlugin.kt | 2 +- .../aaps/plugins}/source/RandomBgPlugin.kt | 2 +- .../app/aaps/plugins}/source/TomatoPlugin.kt | 2 +- .../aaps/plugins}/source/XdripSourcePlugin.kt | 2 +- .../RequestDexcomPermissionActivity.kt | 4 +-- .../aaps/plugins}/source/di/SourceModule.kt | 24 ++++++++-------- .../aaps/plugins}/source/GlimpPluginTest.kt | 2 +- .../aaps/plugins}/source/MM640GPluginTest.kt | 2 +- .../plugins}/source/NSClientPluginTest.kt | 2 +- .../plugins}/source/XdripSourcePluginTest.kt | 2 +- 27 files changed, 73 insertions(+), 74 deletions(-) rename plugins/source/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/source/AidexPlugin.kt (99%) rename plugins/source/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/source/BGSourceFragment.kt (98%) rename plugins/source/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/source/DexcomPlugin.kt (99%) rename plugins/source/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/source/EversensePlugin.kt (99%) rename plugins/source/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/source/GlimpPlugin.kt (99%) rename plugins/source/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/source/GlunovoPlugin.kt (99%) rename plugins/source/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/source/IntelligoPlugin.kt (99%) rename plugins/source/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/source/MM640gPlugin.kt (99%) rename plugins/source/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/source/NSClientSourcePlugin.kt (98%) rename plugins/source/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/source/PoctechPlugin.kt (99%) rename plugins/source/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/source/RandomBgPlugin.kt (99%) rename plugins/source/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/source/TomatoPlugin.kt (99%) rename plugins/source/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/source/XdripSourcePlugin.kt (99%) rename plugins/source/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/source/activities/RequestDexcomPermissionActivity.kt (88%) rename plugins/source/src/main/{java/info/nightscout => kotlin/app/aaps/plugins}/source/di/SourceModule.kt (74%) rename plugins/source/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/source/GlimpPluginTest.kt (95%) rename plugins/source/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/source/MM640GPluginTest.kt (95%) rename plugins/source/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/source/NSClientPluginTest.kt (96%) rename plugins/source/src/test/{java/info/nightscout => kotlin/app/aaps/plugins}/source/XdripSourcePluginTest.kt (95%) diff --git a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt index f9d602f986..f48db9e168 100644 --- a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt @@ -46,6 +46,14 @@ import app.aaps.plugins.main.general.wear.WearPlugin import app.aaps.plugins.sensitivity.SensitivityAAPSPlugin import app.aaps.plugins.sensitivity.SensitivityOref1Plugin import app.aaps.plugins.sensitivity.SensitivityWeightedAveragePlugin +import app.aaps.plugins.source.AidexPlugin +import app.aaps.plugins.source.DexcomPlugin +import app.aaps.plugins.source.EversensePlugin +import app.aaps.plugins.source.GlimpPlugin +import app.aaps.plugins.source.GlunovoPlugin +import app.aaps.plugins.source.IntelligoPlugin +import app.aaps.plugins.source.PoctechPlugin +import app.aaps.plugins.source.TomatoPlugin import dagger.android.support.AndroidSupportInjection import info.nightscout.androidaps.R import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin @@ -64,14 +72,6 @@ import info.nightscout.pump.combov2.ComboV2Plugin import info.nightscout.pump.diaconn.DiaconnG8Plugin import info.nightscout.pump.medtrum.MedtrumPlugin import info.nightscout.pump.virtual.VirtualPumpPlugin -import info.nightscout.source.AidexPlugin -import info.nightscout.source.DexcomPlugin -import info.nightscout.source.EversensePlugin -import info.nightscout.source.GlimpPlugin -import info.nightscout.source.GlunovoPlugin -import info.nightscout.source.IntelligoPlugin -import info.nightscout.source.PoctechPlugin -import info.nightscout.source.TomatoPlugin import javax.inject.Inject class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeListener { diff --git a/app/src/main/kotlin/app/aaps/di/AppComponent.kt b/app/src/main/kotlin/app/aaps/di/AppComponent.kt index 94ae6cc216..d1d2ac89d9 100644 --- a/app/src/main/kotlin/app/aaps/di/AppComponent.kt +++ b/app/src/main/kotlin/app/aaps/di/AppComponent.kt @@ -10,6 +10,7 @@ import app.aaps.plugins.configuration.di.ConfigurationModule import app.aaps.plugins.constraints.di.PluginsConstraintsModule import app.aaps.plugins.insulin.di.InsulinModule import app.aaps.plugins.main.di.PluginsModule +import app.aaps.plugins.source.di.SourceModule import app.aaps.shared.impl.di.SharedImplModule import dagger.BindsInstance import dagger.Component @@ -35,7 +36,6 @@ import info.nightscout.pump.danars.di.DanaRSModule import info.nightscout.pump.diaconn.di.DiaconnG8Module import info.nightscout.pump.medtrum.di.MedtrumModule import info.nightscout.pump.virtual.di.VirtualPumpModule -import info.nightscout.source.di.SourceModule import info.nightscout.ui.di.UiModule import info.nightscout.workflow.di.WorkflowModule import javax.inject.Singleton diff --git a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt index b2b9eab5cc..6dbc709798 100644 --- a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt +++ b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt @@ -32,6 +32,20 @@ import app.aaps.plugins.main.profile.ProfilePlugin import app.aaps.plugins.sensitivity.SensitivityAAPSPlugin import app.aaps.plugins.sensitivity.SensitivityOref1Plugin import app.aaps.plugins.sensitivity.SensitivityWeightedAveragePlugin +import app.aaps.plugins.smoothing.AvgSmoothingPlugin +import app.aaps.plugins.smoothing.ExponentialSmoothingPlugin +import app.aaps.plugins.smoothing.NoSmoothingPlugin +import app.aaps.plugins.source.AidexPlugin +import app.aaps.plugins.source.DexcomPlugin +import app.aaps.plugins.source.GlimpPlugin +import app.aaps.plugins.source.GlunovoPlugin +import app.aaps.plugins.source.IntelligoPlugin +import app.aaps.plugins.source.MM640gPlugin +import app.aaps.plugins.source.NSClientSourcePlugin +import app.aaps.plugins.source.PoctechPlugin +import app.aaps.plugins.source.RandomBgPlugin +import app.aaps.plugins.source.TomatoPlugin +import app.aaps.plugins.source.XdripSourcePlugin import dagger.Binds import dagger.Module import dagger.multibindings.IntKey @@ -55,20 +69,6 @@ import info.nightscout.pump.combov2.ComboV2Plugin import info.nightscout.pump.diaconn.DiaconnG8Plugin import info.nightscout.pump.medtrum.MedtrumPlugin import info.nightscout.pump.virtual.VirtualPumpPlugin -import app.aaps.plugins.smoothing.AvgSmoothingPlugin -import app.aaps.plugins.smoothing.ExponentialSmoothingPlugin -import app.aaps.plugins.smoothing.NoSmoothingPlugin -import info.nightscout.source.AidexPlugin -import info.nightscout.source.DexcomPlugin -import info.nightscout.source.GlimpPlugin -import info.nightscout.source.GlunovoPlugin -import info.nightscout.source.IntelligoPlugin -import info.nightscout.source.MM640gPlugin -import info.nightscout.source.NSClientSourcePlugin -import info.nightscout.source.PoctechPlugin -import info.nightscout.source.RandomBgPlugin -import info.nightscout.source.TomatoPlugin -import info.nightscout.source.XdripSourcePlugin import javax.inject.Qualifier @Suppress("unused") diff --git a/app/src/main/kotlin/app/aaps/receivers/DataReceiver.kt b/app/src/main/kotlin/app/aaps/receivers/DataReceiver.kt index 1eb509ac49..87116cfa14 100644 --- a/app/src/main/kotlin/app/aaps/receivers/DataReceiver.kt +++ b/app/src/main/kotlin/app/aaps/receivers/DataReceiver.kt @@ -13,15 +13,15 @@ import app.aaps.core.utils.extensions.copyLong import app.aaps.core.utils.extensions.copyString import app.aaps.core.utils.receivers.DataWorkerStorage import app.aaps.plugins.main.general.smsCommunicator.SmsCommunicatorPlugin +import app.aaps.plugins.source.AidexPlugin +import app.aaps.plugins.source.DexcomPlugin +import app.aaps.plugins.source.EversensePlugin +import app.aaps.plugins.source.GlimpPlugin +import app.aaps.plugins.source.MM640gPlugin +import app.aaps.plugins.source.PoctechPlugin +import app.aaps.plugins.source.TomatoPlugin +import app.aaps.plugins.source.XdripSourcePlugin import dagger.android.DaggerBroadcastReceiver -import info.nightscout.source.AidexPlugin -import info.nightscout.source.DexcomPlugin -import info.nightscout.source.EversensePlugin -import info.nightscout.source.GlimpPlugin -import info.nightscout.source.MM640gPlugin -import info.nightscout.source.PoctechPlugin -import info.nightscout.source.TomatoPlugin -import info.nightscout.source.XdripSourcePlugin import javax.inject.Inject open class DataReceiver : DaggerBroadcastReceiver() { diff --git a/plugins/constraints/src/test/kotlin/app/aaps/plugins/constraints/ConstraintsCheckerImplTest.kt b/plugins/constraints/src/test/kotlin/app/aaps/plugins/constraints/ConstraintsCheckerImplTest.kt index c107e27f82..20a3b0aa64 100644 --- a/plugins/constraints/src/test/kotlin/app/aaps/plugins/constraints/ConstraintsCheckerImplTest.kt +++ b/plugins/constraints/src/test/kotlin/app/aaps/plugins/constraints/ConstraintsCheckerImplTest.kt @@ -21,7 +21,10 @@ import app.aaps.implementation.iob.GlucoseStatusProviderImpl 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.constraints.ConstraintsCheckerImpl +import app.aaps.plugins.constraints.objectives.ObjectivesPlugin +import app.aaps.plugins.constraints.objectives.objectives.Objective +import app.aaps.plugins.constraints.safety.SafetyPlugin +import app.aaps.plugins.source.GlimpPlugin import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector @@ -32,9 +35,6 @@ import info.nightscout.androidaps.insight.database.InsightDatabaseDao import info.nightscout.androidaps.insight.database.InsightDbHelper import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin import info.nightscout.database.impl.AppRepository -import app.aaps.plugins.constraints.objectives.ObjectivesPlugin -import app.aaps.plugins.constraints.objectives.objectives.Objective -import app.aaps.plugins.constraints.safety.SafetyPlugin import info.nightscout.pump.combo.ComboPlugin import info.nightscout.pump.combo.ruffyscripter.RuffyScripter import info.nightscout.pump.dana.DanaPump @@ -42,7 +42,6 @@ import info.nightscout.pump.dana.R import info.nightscout.pump.dana.database.DanaHistoryDatabase import info.nightscout.pump.danars.DanaRSPlugin import info.nightscout.pump.virtual.VirtualPumpPlugin -import info.nightscout.source.GlimpPlugin import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/constraints/src/test/kotlin/app/aaps/plugins/constraints/safety/SafetyPluginTest.kt b/plugins/constraints/src/test/kotlin/app/aaps/plugins/constraints/safety/SafetyPluginTest.kt index 9b1978f622..a854ecca1e 100644 --- a/plugins/constraints/src/test/kotlin/app/aaps/plugins/constraints/safety/SafetyPluginTest.kt +++ b/plugins/constraints/src/test/kotlin/app/aaps/plugins/constraints/safety/SafetyPluginTest.kt @@ -14,14 +14,13 @@ import app.aaps.core.interfaces.utils.HardLimits import app.aaps.core.main.constraints.ConstraintObject import app.aaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin import app.aaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin -import app.aaps.plugins.constraints.safety.SafetyPlugin +import app.aaps.plugins.source.GlimpPlugin import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository import info.nightscout.pump.virtual.VirtualPumpPlugin -import info.nightscout.source.GlimpPlugin import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/source/build.gradle b/plugins/source/build.gradle index ff926fa02d..95d4773913 100644 --- a/plugins/source/build.gradle +++ b/plugins/source/build.gradle @@ -10,8 +10,9 @@ apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/main/test_dependencies.gradle" apply from: "${project.rootDir}/core/main/jacoco_global.gradle" + android { - namespace 'info.nightscout.source' + namespace 'app.aaps.plugins.source' } diff --git a/plugins/source/src/main/AndroidManifest.xml b/plugins/source/src/main/AndroidManifest.xml index 8ab266755d..1770f079cb 100644 --- a/plugins/source/src/main/AndroidManifest.xml +++ b/plugins/source/src/main/AndroidManifest.xml @@ -4,7 +4,7 @@ diff --git a/plugins/source/src/main/java/info/nightscout/source/AidexPlugin.kt b/plugins/source/src/main/kotlin/app/aaps/plugins/source/AidexPlugin.kt similarity index 99% rename from plugins/source/src/main/java/info/nightscout/source/AidexPlugin.kt rename to plugins/source/src/main/kotlin/app/aaps/plugins/source/AidexPlugin.kt index 96bf398456..1c55e07707 100644 --- a/plugins/source/src/main/java/info/nightscout/source/AidexPlugin.kt +++ b/plugins/source/src/main/kotlin/app/aaps/plugins/source/AidexPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.source +package app.aaps.plugins.source import android.content.Context import androidx.work.WorkerParameters diff --git a/plugins/source/src/main/java/info/nightscout/source/BGSourceFragment.kt b/plugins/source/src/main/kotlin/app/aaps/plugins/source/BGSourceFragment.kt similarity index 98% rename from plugins/source/src/main/java/info/nightscout/source/BGSourceFragment.kt rename to plugins/source/src/main/kotlin/app/aaps/plugins/source/BGSourceFragment.kt index 4996c20ae8..6cc6236a26 100644 --- a/plugins/source/src/main/java/info/nightscout/source/BGSourceFragment.kt +++ b/plugins/source/src/main/kotlin/app/aaps/plugins/source/BGSourceFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.source +package app.aaps.plugins.source import android.os.Bundle import android.util.SparseArray @@ -36,11 +36,11 @@ import app.aaps.database.entities.GlucoseValue import app.aaps.database.entities.UserEntry.Action import app.aaps.database.entities.UserEntry.Sources import app.aaps.database.entities.ValueWithUnit +import app.aaps.plugins.source.databinding.SourceFragmentBinding +import app.aaps.plugins.source.databinding.SourceItemBinding import dagger.android.support.DaggerFragment import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateGlucoseValueTransaction -import info.nightscout.source.databinding.SourceFragmentBinding -import info.nightscout.source.databinding.SourceItemBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.concurrent.TimeUnit diff --git a/plugins/source/src/main/java/info/nightscout/source/DexcomPlugin.kt b/plugins/source/src/main/kotlin/app/aaps/plugins/source/DexcomPlugin.kt similarity index 99% rename from plugins/source/src/main/java/info/nightscout/source/DexcomPlugin.kt rename to plugins/source/src/main/kotlin/app/aaps/plugins/source/DexcomPlugin.kt index 18743f2071..c3f92e4cc9 100644 --- a/plugins/source/src/main/java/info/nightscout/source/DexcomPlugin.kt +++ b/plugins/source/src/main/kotlin/app/aaps/plugins/source/DexcomPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.source +package app.aaps.plugins.source import android.content.Context import android.content.Intent @@ -29,12 +29,12 @@ import app.aaps.database.entities.UserEntry.Action import app.aaps.database.entities.UserEntry.Sources import app.aaps.database.entities.ValueWithUnit import app.aaps.database.transactions.TransactionGlucoseValue +import app.aaps.plugins.source.activities.RequestDexcomPermissionActivity import app.aaps.shared.impl.extensions.safeGetInstalledPackages import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.database.impl.transactions.InvalidateGlucoseValueTransaction -import info.nightscout.source.activities.RequestDexcomPermissionActivity import kotlinx.coroutines.Dispatchers import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/source/src/main/java/info/nightscout/source/EversensePlugin.kt b/plugins/source/src/main/kotlin/app/aaps/plugins/source/EversensePlugin.kt similarity index 99% rename from plugins/source/src/main/java/info/nightscout/source/EversensePlugin.kt rename to plugins/source/src/main/kotlin/app/aaps/plugins/source/EversensePlugin.kt index 2533bba486..6a94fae92a 100644 --- a/plugins/source/src/main/java/info/nightscout/source/EversensePlugin.kt +++ b/plugins/source/src/main/kotlin/app/aaps/plugins/source/EversensePlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.source +package app.aaps.plugins.source import android.content.Context import androidx.work.WorkerParameters diff --git a/plugins/source/src/main/java/info/nightscout/source/GlimpPlugin.kt b/plugins/source/src/main/kotlin/app/aaps/plugins/source/GlimpPlugin.kt similarity index 99% rename from plugins/source/src/main/java/info/nightscout/source/GlimpPlugin.kt rename to plugins/source/src/main/kotlin/app/aaps/plugins/source/GlimpPlugin.kt index b483243991..31374b0029 100644 --- a/plugins/source/src/main/java/info/nightscout/source/GlimpPlugin.kt +++ b/plugins/source/src/main/kotlin/app/aaps/plugins/source/GlimpPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.source +package app.aaps.plugins.source import android.content.Context import androidx.work.WorkerParameters diff --git a/plugins/source/src/main/java/info/nightscout/source/GlunovoPlugin.kt b/plugins/source/src/main/kotlin/app/aaps/plugins/source/GlunovoPlugin.kt similarity index 99% rename from plugins/source/src/main/java/info/nightscout/source/GlunovoPlugin.kt rename to plugins/source/src/main/kotlin/app/aaps/plugins/source/GlunovoPlugin.kt index 55dfd52cc4..846facaf85 100644 --- a/plugins/source/src/main/java/info/nightscout/source/GlunovoPlugin.kt +++ b/plugins/source/src/main/kotlin/app/aaps/plugins/source/GlunovoPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.source +package app.aaps.plugins.source import android.content.Context import android.net.Uri diff --git a/plugins/source/src/main/java/info/nightscout/source/IntelligoPlugin.kt b/plugins/source/src/main/kotlin/app/aaps/plugins/source/IntelligoPlugin.kt similarity index 99% rename from plugins/source/src/main/java/info/nightscout/source/IntelligoPlugin.kt rename to plugins/source/src/main/kotlin/app/aaps/plugins/source/IntelligoPlugin.kt index ac84ef3f74..36b36582c5 100644 --- a/plugins/source/src/main/java/info/nightscout/source/IntelligoPlugin.kt +++ b/plugins/source/src/main/kotlin/app/aaps/plugins/source/IntelligoPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.source +package app.aaps.plugins.source import android.content.Context import android.content.pm.PackageManager diff --git a/plugins/source/src/main/java/info/nightscout/source/MM640gPlugin.kt b/plugins/source/src/main/kotlin/app/aaps/plugins/source/MM640gPlugin.kt similarity index 99% rename from plugins/source/src/main/java/info/nightscout/source/MM640gPlugin.kt rename to plugins/source/src/main/kotlin/app/aaps/plugins/source/MM640gPlugin.kt index d33baafc5e..24d090a364 100644 --- a/plugins/source/src/main/java/info/nightscout/source/MM640gPlugin.kt +++ b/plugins/source/src/main/kotlin/app/aaps/plugins/source/MM640gPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.source +package app.aaps.plugins.source import android.content.Context import androidx.work.WorkerParameters diff --git a/plugins/source/src/main/java/info/nightscout/source/NSClientSourcePlugin.kt b/plugins/source/src/main/kotlin/app/aaps/plugins/source/NSClientSourcePlugin.kt similarity index 98% rename from plugins/source/src/main/java/info/nightscout/source/NSClientSourcePlugin.kt rename to plugins/source/src/main/kotlin/app/aaps/plugins/source/NSClientSourcePlugin.kt index 84c8290063..6f1dcb9022 100644 --- a/plugins/source/src/main/java/info/nightscout/source/NSClientSourcePlugin.kt +++ b/plugins/source/src/main/kotlin/app/aaps/plugins/source/NSClientSourcePlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.source +package app.aaps.plugins.source import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.logging.AAPSLogger diff --git a/plugins/source/src/main/java/info/nightscout/source/PoctechPlugin.kt b/plugins/source/src/main/kotlin/app/aaps/plugins/source/PoctechPlugin.kt similarity index 99% rename from plugins/source/src/main/java/info/nightscout/source/PoctechPlugin.kt rename to plugins/source/src/main/kotlin/app/aaps/plugins/source/PoctechPlugin.kt index 49f18097fb..8d46aa5d98 100644 --- a/plugins/source/src/main/java/info/nightscout/source/PoctechPlugin.kt +++ b/plugins/source/src/main/kotlin/app/aaps/plugins/source/PoctechPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.source +package app.aaps.plugins.source import android.content.Context import androidx.work.WorkerParameters diff --git a/plugins/source/src/main/java/info/nightscout/source/RandomBgPlugin.kt b/plugins/source/src/main/kotlin/app/aaps/plugins/source/RandomBgPlugin.kt similarity index 99% rename from plugins/source/src/main/java/info/nightscout/source/RandomBgPlugin.kt rename to plugins/source/src/main/kotlin/app/aaps/plugins/source/RandomBgPlugin.kt index 2611862eef..bf6bc0e3ac 100644 --- a/plugins/source/src/main/java/info/nightscout/source/RandomBgPlugin.kt +++ b/plugins/source/src/main/kotlin/app/aaps/plugins/source/RandomBgPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.source +package app.aaps.plugins.source import android.os.Handler import android.os.HandlerThread diff --git a/plugins/source/src/main/java/info/nightscout/source/TomatoPlugin.kt b/plugins/source/src/main/kotlin/app/aaps/plugins/source/TomatoPlugin.kt similarity index 99% rename from plugins/source/src/main/java/info/nightscout/source/TomatoPlugin.kt rename to plugins/source/src/main/kotlin/app/aaps/plugins/source/TomatoPlugin.kt index fadcaff381..2f920b7ef1 100644 --- a/plugins/source/src/main/java/info/nightscout/source/TomatoPlugin.kt +++ b/plugins/source/src/main/kotlin/app/aaps/plugins/source/TomatoPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.source +package app.aaps.plugins.source import android.content.Context import androidx.work.WorkerParameters diff --git a/plugins/source/src/main/java/info/nightscout/source/XdripSourcePlugin.kt b/plugins/source/src/main/kotlin/app/aaps/plugins/source/XdripSourcePlugin.kt similarity index 99% rename from plugins/source/src/main/java/info/nightscout/source/XdripSourcePlugin.kt rename to plugins/source/src/main/kotlin/app/aaps/plugins/source/XdripSourcePlugin.kt index 9e5a093c63..7f15daaebe 100644 --- a/plugins/source/src/main/java/info/nightscout/source/XdripSourcePlugin.kt +++ b/plugins/source/src/main/kotlin/app/aaps/plugins/source/XdripSourcePlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.source +package app.aaps.plugins.source import android.content.Context import androidx.work.WorkerParameters diff --git a/plugins/source/src/main/java/info/nightscout/source/activities/RequestDexcomPermissionActivity.kt b/plugins/source/src/main/kotlin/app/aaps/plugins/source/activities/RequestDexcomPermissionActivity.kt similarity index 88% rename from plugins/source/src/main/java/info/nightscout/source/activities/RequestDexcomPermissionActivity.kt rename to plugins/source/src/main/kotlin/app/aaps/plugins/source/activities/RequestDexcomPermissionActivity.kt index eef10403b2..801576e4ac 100644 --- a/plugins/source/src/main/java/info/nightscout/source/activities/RequestDexcomPermissionActivity.kt +++ b/plugins/source/src/main/kotlin/app/aaps/plugins/source/activities/RequestDexcomPermissionActivity.kt @@ -1,8 +1,8 @@ -package info.nightscout.source.activities +package app.aaps.plugins.source.activities import android.os.Bundle import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.source.DexcomPlugin +import app.aaps.plugins.source.DexcomPlugin class RequestDexcomPermissionActivity : TranslatedDaggerAppCompatActivity() { diff --git a/plugins/source/src/main/java/info/nightscout/source/di/SourceModule.kt b/plugins/source/src/main/kotlin/app/aaps/plugins/source/di/SourceModule.kt similarity index 74% rename from plugins/source/src/main/java/info/nightscout/source/di/SourceModule.kt rename to plugins/source/src/main/kotlin/app/aaps/plugins/source/di/SourceModule.kt index cd9656711a..5ea000ccb3 100644 --- a/plugins/source/src/main/java/info/nightscout/source/di/SourceModule.kt +++ b/plugins/source/src/main/kotlin/app/aaps/plugins/source/di/SourceModule.kt @@ -1,22 +1,22 @@ -package info.nightscout.source.di +package app.aaps.plugins.source.di import app.aaps.core.interfaces.source.DexcomBoyda import app.aaps.core.interfaces.source.NSClientSource import app.aaps.core.interfaces.source.XDripSource +import app.aaps.plugins.source.AidexPlugin +import app.aaps.plugins.source.BGSourceFragment +import app.aaps.plugins.source.DexcomPlugin +import app.aaps.plugins.source.EversensePlugin +import app.aaps.plugins.source.GlimpPlugin +import app.aaps.plugins.source.MM640gPlugin +import app.aaps.plugins.source.NSClientSourcePlugin +import app.aaps.plugins.source.PoctechPlugin +import app.aaps.plugins.source.TomatoPlugin +import app.aaps.plugins.source.XdripSourcePlugin +import app.aaps.plugins.source.activities.RequestDexcomPermissionActivity import dagger.Binds import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.source.AidexPlugin -import info.nightscout.source.BGSourceFragment -import info.nightscout.source.DexcomPlugin -import info.nightscout.source.EversensePlugin -import info.nightscout.source.GlimpPlugin -import info.nightscout.source.MM640gPlugin -import info.nightscout.source.NSClientSourcePlugin -import info.nightscout.source.PoctechPlugin -import info.nightscout.source.TomatoPlugin -import info.nightscout.source.XdripSourcePlugin -import info.nightscout.source.activities.RequestDexcomPermissionActivity @Module( includes = [ diff --git a/plugins/source/src/test/java/info/nightscout/source/GlimpPluginTest.kt b/plugins/source/src/test/kotlin/app/aaps/plugins/source/GlimpPluginTest.kt similarity index 95% rename from plugins/source/src/test/java/info/nightscout/source/GlimpPluginTest.kt rename to plugins/source/src/test/kotlin/app/aaps/plugins/source/GlimpPluginTest.kt index 0afa695030..1a8aaef660 100644 --- a/plugins/source/src/test/java/info/nightscout/source/GlimpPluginTest.kt +++ b/plugins/source/src/test/kotlin/app/aaps/plugins/source/GlimpPluginTest.kt @@ -1,4 +1,4 @@ -package info.nightscout.source +package app.aaps.plugins.source import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.shared.tests.TestBase diff --git a/plugins/source/src/test/java/info/nightscout/source/MM640GPluginTest.kt b/plugins/source/src/test/kotlin/app/aaps/plugins/source/MM640GPluginTest.kt similarity index 95% rename from plugins/source/src/test/java/info/nightscout/source/MM640GPluginTest.kt rename to plugins/source/src/test/kotlin/app/aaps/plugins/source/MM640GPluginTest.kt index 0d3ceb13c7..66ae9e8ed5 100644 --- a/plugins/source/src/test/java/info/nightscout/source/MM640GPluginTest.kt +++ b/plugins/source/src/test/kotlin/app/aaps/plugins/source/MM640GPluginTest.kt @@ -1,4 +1,4 @@ -package info.nightscout.source +package app.aaps.plugins.source import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.shared.tests.TestBase diff --git a/plugins/source/src/test/java/info/nightscout/source/NSClientPluginTest.kt b/plugins/source/src/test/kotlin/app/aaps/plugins/source/NSClientPluginTest.kt similarity index 96% rename from plugins/source/src/test/java/info/nightscout/source/NSClientPluginTest.kt rename to plugins/source/src/test/kotlin/app/aaps/plugins/source/NSClientPluginTest.kt index 017b2b507e..f41dfa2cff 100644 --- a/plugins/source/src/test/java/info/nightscout/source/NSClientPluginTest.kt +++ b/plugins/source/src/test/kotlin/app/aaps/plugins/source/NSClientPluginTest.kt @@ -1,4 +1,4 @@ -package info.nightscout.source +package app.aaps.plugins.source import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.resources.ResourceHelper diff --git a/plugins/source/src/test/java/info/nightscout/source/XdripSourcePluginTest.kt b/plugins/source/src/test/kotlin/app/aaps/plugins/source/XdripSourcePluginTest.kt similarity index 95% rename from plugins/source/src/test/java/info/nightscout/source/XdripSourcePluginTest.kt rename to plugins/source/src/test/kotlin/app/aaps/plugins/source/XdripSourcePluginTest.kt index c8607b6ae5..3e645fb3e9 100644 --- a/plugins/source/src/test/java/info/nightscout/source/XdripSourcePluginTest.kt +++ b/plugins/source/src/test/kotlin/app/aaps/plugins/source/XdripSourcePluginTest.kt @@ -1,4 +1,4 @@ -package info.nightscout.source +package app.aaps.plugins.source import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.shared.tests.TestBase From d6281a545294953e81625f18e5183f2785a8fd88 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 26 Sep 2023 16:52:44 +0200 Subject: [PATCH 15/17] :plugins:sync cleanup --- app/src/main/kotlin/app/aaps/MainApp.kt | 22 +++---- .../aaps/activities/MyPreferenceFragment.kt | 16 +++-- .../main/kotlin/app/aaps/di/AppComponent.kt | 4 +- .../kotlin/app/aaps/di/PluginsListModule.kt | 12 ++-- plugins/sync/build.gradle | 3 +- .../plugins/sync/nsclient/data/AlarmAck.java | 11 ---- .../dataBroadcaster/DataBroadcastPlugin.kt | 12 ++-- .../app/aaps}/plugins/sync/di/Helpers.kt | 3 +- .../aaps}/plugins/sync/di/OpenHumansModule.kt | 12 ++-- .../app/aaps}/plugins/sync/di/SyncModule.kt | 46 +++++++------- .../aaps}/plugins/sync/nsShared/NSAlarm.kt | 2 +- .../plugins/sync/nsShared/NSClientFragment.kt | 14 ++--- .../app/aaps}/plugins/sync/nsShared/NSSgv.kt | 2 +- .../sync/nsShared/NsIncomingDataProcessor.kt | 30 ++++----- .../sync/nsShared/StoreDataForDbImpl.kt | 4 +- .../events/EventConnectivityOptionChanged.kt | 2 +- .../nsShared/events/EventNSClientStatus.kt | 2 +- .../events/EventNSClientUpdateGuiData.kt | 2 +- .../events/EventNSClientUpdateGuiQueue.kt | 2 +- .../events/EventNSClientUpdateGuiStatus.kt | 2 +- .../sync/nsclient/DataSyncSelectorV1.kt | 8 +-- .../plugins/sync/nsclient/NSClientPlugin.kt | 22 +++---- .../plugins/sync/nsclient/ReceiverDelegate.kt | 8 +-- .../plugins/sync/nsclient/acks/NSAddAck.kt | 6 +- .../plugins/sync/nsclient/acks/NSAuthAck.kt | 2 +- .../plugins/sync/nsclient/acks/NSUpdateAck.kt | 6 +- .../plugins/sync/nsclient/data/AlarmAck.kt | 11 ++++ .../nsclient/data/NSDeviceStatusHandler.kt | 2 +- .../aaps}/plugins/sync/nsclient/data/NSMbg.kt | 2 +- .../nsclient/data/NSSettingsStatusImpl.kt | 4 +- .../data/ProcessedDeviceStatusDataImpl.kt | 4 +- .../BolusCalculatorResultExtension.kt | 2 +- .../nsclient/extensions/BolusExtension.kt | 2 +- .../nsclient/extensions/CarbsExtension.kt | 2 +- .../extensions/DeviceStatusExtension.kt | 2 +- .../EffectiveProfileSwitchExtension.kt | 2 +- .../extensions/ExtendedBolusExtension.kt | 2 +- .../sync/nsclient/extensions/FoodExtension.kt | 2 +- .../extensions/OfflineEventExtension.kt | 2 +- .../extensions/ProfileSwitchExtension.kt | 2 +- .../extensions/TemporaryBasalExtension.kt | 2 +- .../extensions/TemporaryTargetExtension.kt | 2 +- .../extensions/TherapyEventExtension.kt | 4 +- .../sync/nsclient/services/NSClientService.kt | 32 +++++----- .../nsclient/workers/NSClientAddAckWorker.kt | 6 +- .../workers/NSClientAddUpdateWorker.kt | 12 ++-- .../nsclient/workers/NSClientMbgWorker.kt | 6 +- .../workers/NSClientUpdateRemoveAckWorker.kt | 4 +- .../sync/nsclientV3/DataSyncSelectorV3.kt | 8 +-- .../sync/nsclientV3/NSClientV3Plugin.kt | 62 +++++++++---------- .../BolusCalculatorResultExtension.kt | 2 +- .../nsclientV3/extensions/BolusExtension.kt | 2 +- .../nsclientV3/extensions/CarbsExtension.kt | 2 +- .../extensions/DeviceStatusExtension.kt | 2 +- .../EffectiveProfileSwitchExtension.kt | 4 +- .../extensions/ExtendedBolusExtension.kt | 2 +- .../nsclientV3/extensions/FoodExtension.kt | 2 +- .../extensions/GlucoseValueExtension.kt | 2 +- .../extensions/OfflineEventExtension.kt | 2 +- .../extensions/ProfileSwitchExtension.kt | 2 +- .../extensions/TemporaryBasalExtension.kt | 2 +- .../extensions/TemporaryTargetExtension.kt | 2 +- .../extensions/TherapyEventExtension.kt | 2 +- .../sync/nsclientV3/workers/DataSyncWorker.kt | 8 +-- .../sync/nsclientV3/workers/LoadBgWorker.kt | 8 +-- .../workers/LoadDeviceStatusWorker.kt | 6 +- .../nsclientV3/workers/LoadFoodsWorker.kt | 8 +-- .../workers/LoadLastModificationWorker.kt | 6 +- .../workers/LoadProfileStoreWorker.kt | 6 +- .../nsclientV3/workers/LoadStatusWorker.kt | 8 +-- .../workers/LoadTreatmentsWorker.kt | 8 +-- .../sync/openhumans/AllowedPreferenceKeys.kt | 4 +- .../plugins/sync/openhumans/OpenHumansAPI.kt | 55 +++++++++------- .../sync/openhumans/OpenHumansState.kt | 2 +- .../openhumans/OpenHumansUploaderPlugin.kt | 14 ++--- .../sync/openhumans/OpenHumansWorker.kt | 2 +- .../openhumans/delegates/OHAppIDDelegate.kt | 2 +- .../openhumans/delegates/OHCounterDelegate.kt | 2 +- .../openhumans/delegates/OHStateDelegate.kt | 4 +- .../plugins/sync/openhumans/ui/OHFragment.kt | 8 +-- .../sync/openhumans/ui/OHLoginActivity.kt | 12 ++-- .../sync/openhumans/ui/OHLoginViewModel.kt | 6 +- .../plugins/sync/tidepool/TidepoolFragment.kt | 16 ++--- .../plugins/sync/tidepool/TidepoolPlugin.kt | 22 +++---- .../sync/tidepool/comm/InfoInterceptor.kt | 2 +- .../plugins/sync/tidepool/comm/Session.kt | 6 +- .../sync/tidepool/comm/TidepoolApiService.kt | 24 +++---- .../sync/tidepool/comm/TidepoolCallback.kt | 4 +- .../sync/tidepool/comm/TidepoolUploader.kt | 18 +++--- .../plugins/sync/tidepool/comm/UploadChunk.kt | 22 +++---- .../sync/tidepool/elements/BasalElement.kt | 2 +- .../sync/tidepool/elements/BaseElement.kt | 2 +- .../tidepool/elements/BloodGlucoseElement.kt | 4 +- .../sync/tidepool/elements/BolusElement.kt | 2 +- .../sync/tidepool/elements/ProfileElement.kt | 4 +- .../tidepool/elements/SensorGlucoseElement.kt | 2 +- .../sync/tidepool/elements/WizardElement.kt | 2 +- .../tidepool/events/EventTidepoolDoUpload.kt | 2 +- .../tidepool/events/EventTidepoolResetData.kt | 2 +- .../tidepool/events/EventTidepoolStatus.kt | 2 +- .../tidepool/events/EventTidepoolUpdateGUI.kt | 2 +- .../tidepool/messages/AuthReplyMessage.kt | 6 +- .../tidepool/messages/AuthRequestMessage.kt | 4 +- .../sync/tidepool/messages/BaseMessage.kt | 5 +- .../messages/CloseDatasetRequestMessage.kt | 3 +- .../tidepool/messages/DatasetReplyMessage.kt | 4 +- .../messages/OpenDatasetRequestMessage.kt | 4 +- .../tidepool/messages/UploadReplyMessage.kt | 2 +- .../sync/tidepool/utils/GsonInstance.kt | 7 ++- .../plugins/sync/tidepool/utils/RateLimit.kt | 2 +- .../sync/xdrip/DataSyncSelectorXdripImpl.kt | 4 +- .../aaps}/plugins/sync/xdrip/XdripFragment.kt | 12 ++-- .../aaps}/plugins/sync/xdrip/XdripPlugin.kt | 12 ++-- .../sync/xdrip/events/EventXdripUpdateGUI.kt | 2 +- .../xdrip/extensions/GlucoseValueExtension.kt | 2 +- .../sync/xdrip/workers/XdripDataSyncWorker.kt | 8 +-- .../main/res/layout/ns_client_fragment.xml | 4 +- .../src/main/res/layout/tidepool_fragment.xml | 6 +- .../src/main/res/layout/xdrip_fragment.xml | 4 +- .../DataBroadcastPluginTest.kt | 2 +- .../sync/nsclient/ReceiverDelegateTest.kt | 6 +- .../sync/nsclientV3/NSClientV3PluginTest.kt | 12 ++-- .../BolusCalculatorResultExtensionKtTest.kt | 2 +- .../extensions/BolusExtensionKtTest.kt | 2 +- .../extensions/CarbsExtensionKtTest.kt | 2 +- .../extensions/DeviceStatusExtensionKtTest.kt | 6 +- .../EffectiveProfileSwitchExtensionKtTest.kt | 4 +- .../ExtendedBolusExtensionKtTest.kt | 2 +- .../extensions/FoodExtensionKtTest.kt | 2 +- .../extensions/GlucoseValueExtensionKtTest.kt | 2 +- .../extensions/OfflineEventExtensionKtTest.kt | 2 +- .../ProfileSwitchExtensionKtTest.kt | 2 +- .../TemporaryBasalExtensionKtTest.kt | 2 +- .../TemporaryTargetExtensionKtTest.kt | 2 +- .../extensions/TherapyEventExtensionKtTest.kt | 2 +- .../nsclientV3/workers/DataSyncWorkerTest.kt | 11 ++-- .../nsclientV3/workers/LoadBgWorkerTest.kt | 14 ++--- .../plugins/sync/tidepool/comm/SessionTest.kt | 6 +- 138 files changed, 487 insertions(+), 458 deletions(-) delete mode 100644 plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/AlarmAck.java rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/dataBroadcaster/DataBroadcastPlugin.kt (99%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/di/Helpers.kt (96%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/di/OpenHumansModule.kt (81%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/di/SyncModule.kt (66%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsShared/NSAlarm.kt (96%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsShared/NSClientFragment.kt (95%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsShared/NSSgv.kt (96%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsShared/NsIncomingDataProcessor.kt (92%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsShared/StoreDataForDbImpl.kt (99%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsShared/events/EventConnectivityOptionChanged.kt (70%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsShared/events/EventNSClientStatus.kt (79%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsShared/events/EventNSClientUpdateGuiData.kt (67%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsShared/events/EventNSClientUpdateGuiQueue.kt (67%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsShared/events/EventNSClientUpdateGuiStatus.kt (67%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/DataSyncSelectorV1.kt (99%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/NSClientPlugin.kt (95%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/ReceiverDelegate.kt (96%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/acks/NSAddAck.kt (91%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/acks/NSAuthAck.kt (91%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/acks/NSUpdateAck.kt (89%) create mode 100644 plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/AlarmAck.kt rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt (99%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/data/NSMbg.kt (88%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt (99%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt (99%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt (97%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/extensions/BolusExtension.kt (97%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/extensions/CarbsExtension.kt (97%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt (99%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt (98%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt (98%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/extensions/FoodExtension.kt (97%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/extensions/OfflineEventExtension.kt (98%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt (98%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt (98%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt (98%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/extensions/TherapyEventExtension.kt (96%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/services/NSClientService.kt (96%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt (98%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt (95%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/workers/NSClientMbgWorker.kt (89%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt (98%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/DataSyncSelectorV3.kt (99%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/NSClientV3Plugin.kt (95%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt (95%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/BolusExtension.kt (96%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/CarbsExtension.kt (95%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/DeviceStatusExtension.kt (99%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt (95%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt (97%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/FoodExtension.kt (94%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt (96%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt (96%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt (98%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt (96%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt (96%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt (97%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/workers/DataSyncWorker.kt (89%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/workers/LoadBgWorker.kt (96%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt (92%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/workers/LoadFoodsWorker.kt (92%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt (92%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/workers/LoadProfileStoreWorker.kt (95%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt (87%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt (96%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/openhumans/AllowedPreferenceKeys.kt (98%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/openhumans/OpenHumansAPI.kt (86%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/openhumans/OpenHumansState.kt (79%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt (98%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/openhumans/OpenHumansWorker.kt (95%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/openhumans/delegates/OHAppIDDelegate.kt (93%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/openhumans/delegates/OHCounterDelegate.kt (90%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/openhumans/delegates/OHStateDelegate.kt (94%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/openhumans/ui/OHFragment.kt (91%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/openhumans/ui/OHLoginActivity.kt (93%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/openhumans/ui/OHLoginViewModel.kt (93%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/TidepoolFragment.kt (90%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/TidepoolPlugin.kt (91%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/comm/InfoInterceptor.kt (93%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/comm/Session.kt (82%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/comm/TidepoolApiService.kt (70%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/comm/TidepoolCallback.kt (91%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/comm/TidepoolUploader.kt (95%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/comm/UploadChunk.kt (90%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/elements/BasalElement.kt (94%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/elements/BaseElement.kt (92%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/elements/BloodGlucoseElement.kt (92%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/elements/BolusElement.kt (91%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/elements/ProfileElement.kt (97%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/elements/SensorGlucoseElement.kt (94%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/elements/WizardElement.kt (97%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt (62%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/events/EventTidepoolResetData.kt (62%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/events/EventTidepoolStatus.kt (92%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt (62%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/messages/AuthReplyMessage.kt (91%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/messages/AuthRequestMessage.kt (84%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/messages/BaseMessage.kt (76%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt (72%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/messages/DatasetReplyMessage.kt (95%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt (92%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/messages/UploadReplyMessage.kt (57%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/utils/GsonInstance.kt (68%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/utils/RateLimit.kt (94%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/xdrip/DataSyncSelectorXdripImpl.kt (99%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/xdrip/XdripFragment.kt (94%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/xdrip/XdripPlugin.kt (98%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/xdrip/events/EventXdripUpdateGUI.kt (67%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/xdrip/extensions/GlucoseValueExtension.kt (85%) rename plugins/sync/src/main/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/xdrip/workers/XdripDataSyncWorker.kt (83%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/dataBroadcaster/DataBroadcastPluginTest.kt (99%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclient/ReceiverDelegateTest.kt (98%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/NSClientV3PluginTest.kt (98%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtensionKtTest.kt (97%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/BolusExtensionKtTest.kt (96%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/CarbsExtensionKtTest.kt (96%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/DeviceStatusExtensionKtTest.kt (96%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtensionKtTest.kt (95%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/ExtendedBolusExtensionKtTest.kt (97%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/FoodExtensionKtTest.kt (94%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/GlucoseValueExtensionKtTest.kt (94%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/OfflineEventExtensionKtTest.kt (97%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/ProfileSwitchExtensionKtTest.kt (98%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/TemporaryBasalExtensionKtTest.kt (97%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/TemporaryTargetExtensionKtTest.kt (97%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/extensions/TherapyEventExtensionKtTest.kt (98%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/workers/DataSyncWorkerTest.kt (91%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/nsclientV3/workers/LoadBgWorkerTest.kt (94%) rename plugins/sync/src/test/{java/info/nightscout => kotlin/app/aaps}/plugins/sync/tidepool/comm/SessionTest.kt (83%) diff --git a/app/src/main/kotlin/app/aaps/MainApp.kt b/app/src/main/kotlin/app/aaps/MainApp.kt index a59d595b27..997ad70478 100644 --- a/app/src/main/kotlin/app/aaps/MainApp.kt +++ b/app/src/main/kotlin/app/aaps/MainApp.kt @@ -132,7 +132,7 @@ class MainApp : DaggerApplication() { // log version disposable += repository.runTransaction(VersionChangeTransaction(BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE, gitRemote, commitHash)).subscribe() // log app start - if (sp.getBoolean(info.nightscout.plugins.sync.R.string.key_ns_log_app_started_event, config.APS)) + if (sp.getBoolean(app.aaps.plugins.sync.R.string.key_ns_log_app_started_event, config.APS)) disposable += repository .runTransaction( InsertIfNewByTimestampTherapyEventTransaction( @@ -205,26 +205,26 @@ class MainApp : DaggerApplication() { // 3.1.0 if (sp.contains("ns_wifionly")) { if (sp.getBoolean("ns_wifionly", false)) { - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_cellular, false) - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_wifi, true) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_cellular, false) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_wifi, true) } else { - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_cellular, true) - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_wifi, false) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_cellular, true) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_wifi, false) } sp.remove("ns_wifionly") } if (sp.contains("ns_charginonly")) { if (sp.getBoolean("ns_charginonly", false)) { - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_battery, false) - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_charging, true) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_battery, false) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_charging, true) } else { - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_battery, true) - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_charging, true) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_battery, true) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_charging, true) } sp.remove("ns_charginonly") } - if (!sp.contains(info.nightscout.plugins.sync.R.string.key_ns_log_app_started_event)) - sp.putBoolean(info.nightscout.plugins.sync.R.string.key_ns_log_app_started_event, config.APS) + if (!sp.contains(app.aaps.plugins.sync.R.string.key_ns_log_app_started_event)) + sp.putBoolean(app.aaps.plugins.sync.R.string.key_ns_log_app_started_event, config.APS) if (sp.getString(app.aaps.plugins.configuration.R.string.key_maintenance_logs_email, "") == "logs@androidaps.org") sp.putString(app.aaps.plugins.configuration.R.string.key_maintenance_logs_email, "logs@aaps.app") // fix values for theme switching diff --git a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt index f48db9e168..96cbbf2728 100644 --- a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt @@ -54,6 +54,11 @@ import app.aaps.plugins.source.GlunovoPlugin import app.aaps.plugins.source.IntelligoPlugin import app.aaps.plugins.source.PoctechPlugin import app.aaps.plugins.source.TomatoPlugin +import app.aaps.plugins.sync.nsclient.NSClientPlugin +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.plugins.sync.openhumans.OpenHumansUploaderPlugin +import app.aaps.plugins.sync.tidepool.TidepoolPlugin +import app.aaps.plugins.sync.xdrip.XdripPlugin import dagger.android.support.AndroidSupportInjection import info.nightscout.androidaps.R import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin @@ -62,11 +67,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.plugins.sync.nsclient.NSClientPlugin -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin -import info.nightscout.plugins.sync.openhumans.OpenHumansUploaderPlugin -import info.nightscout.plugins.sync.tidepool.TidepoolPlugin -import info.nightscout.plugins.sync.xdrip.XdripPlugin import info.nightscout.pump.combo.ComboPlugin import info.nightscout.pump.combov2.ComboV2Plugin import info.nightscout.pump.diaconn.DiaconnG8Plugin @@ -278,7 +278,11 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang activity?.let { val title = rh.gs(app.aaps.core.ui.R.string.unsecure_fallback_biometric) val message = - rh.gs(app.aaps.plugins.configuration.R.string.master_password_missing, rh.gs(app.aaps.plugins.configuration.R.string.configbuilder_general), rh.gs(app.aaps.plugins.configuration.R.string.protection)) + rh.gs( + app.aaps.plugins.configuration.R.string.master_password_missing, + rh.gs(app.aaps.plugins.configuration.R.string.configbuilder_general), + rh.gs(app.aaps.plugins.configuration.R.string.protection) + ) OKDialog.show(it, title = title, message = message) } } diff --git a/app/src/main/kotlin/app/aaps/di/AppComponent.kt b/app/src/main/kotlin/app/aaps/di/AppComponent.kt index d1d2ac89d9..1768733100 100644 --- a/app/src/main/kotlin/app/aaps/di/AppComponent.kt +++ b/app/src/main/kotlin/app/aaps/di/AppComponent.kt @@ -11,6 +11,8 @@ import app.aaps.plugins.constraints.di.PluginsConstraintsModule import app.aaps.plugins.insulin.di.InsulinModule import app.aaps.plugins.main.di.PluginsModule import app.aaps.plugins.source.di.SourceModule +import app.aaps.plugins.sync.di.OpenHumansModule +import app.aaps.plugins.sync.di.SyncModule import app.aaps.shared.impl.di.SharedImplModule import dagger.BindsInstance import dagger.Component @@ -25,8 +27,6 @@ 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.database.impl.DatabaseModule -import info.nightscout.plugins.sync.di.OpenHumansModule -import info.nightscout.plugins.sync.di.SyncModule import info.nightscout.pump.combo.di.ComboModule import info.nightscout.pump.combov2.di.ComboV2Module import info.nightscout.pump.common.di.PumpCommonModule diff --git a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt index 6dbc709798..e84d9a673a 100644 --- a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt +++ b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt @@ -46,6 +46,12 @@ import app.aaps.plugins.source.PoctechPlugin import app.aaps.plugins.source.RandomBgPlugin import app.aaps.plugins.source.TomatoPlugin import app.aaps.plugins.source.XdripSourcePlugin +import app.aaps.plugins.sync.dataBroadcaster.DataBroadcastPlugin +import app.aaps.plugins.sync.nsclient.NSClientPlugin +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.plugins.sync.openhumans.OpenHumansUploaderPlugin +import app.aaps.plugins.sync.tidepool.TidepoolPlugin +import app.aaps.plugins.sync.xdrip.XdripPlugin import dagger.Binds import dagger.Module import dagger.multibindings.IntKey @@ -58,12 +64,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.plugins.sync.dataBroadcaster.DataBroadcastPlugin -import info.nightscout.plugins.sync.nsclient.NSClientPlugin -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin -import info.nightscout.plugins.sync.openhumans.OpenHumansUploaderPlugin -import info.nightscout.plugins.sync.tidepool.TidepoolPlugin -import info.nightscout.plugins.sync.xdrip.XdripPlugin import info.nightscout.pump.combo.ComboPlugin import info.nightscout.pump.combov2.ComboV2Plugin import info.nightscout.pump.diaconn.DiaconnG8Plugin diff --git a/plugins/sync/build.gradle b/plugins/sync/build.gradle index 1cd5f62376..7fdb1dbd8f 100644 --- a/plugins/sync/build.gradle +++ b/plugins/sync/build.gradle @@ -10,8 +10,9 @@ apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/main/test_dependencies.gradle" apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/main/jacoco_global.gradle" + android { - namespace 'info.nightscout.plugins.sync' + namespace 'app.aaps.plugins.sync' } dependencies { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/AlarmAck.java b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/AlarmAck.java deleted file mode 100644 index b9fa6ced88..0000000000 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/AlarmAck.java +++ /dev/null @@ -1,11 +0,0 @@ -package info.nightscout.plugins.sync.nsclient.data; - -/** - * Created by mike on 11.06.2017. - */ - -public class AlarmAck { - public Integer level = null; - public String group = null; - public Long silenceTime = null; -} diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPlugin.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/dataBroadcaster/DataBroadcastPlugin.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPlugin.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/dataBroadcaster/DataBroadcastPlugin.kt index 53e512884f..dfc0fc9bdf 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPlugin.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/dataBroadcaster/DataBroadcastPlugin.kt @@ -1,13 +1,9 @@ -package info.nightscout.plugins.sync.dataBroadcaster +package app.aaps.plugins.sync.dataBroadcaster import android.content.Context import android.content.Intent import android.content.pm.ResolveInfo import android.os.Bundle -import app.aaps.core.main.extensions.durationInMinutes -import app.aaps.core.main.extensions.toStringFull -import app.aaps.core.main.iob.round -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.aps.Loop import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.iob.GlucoseStatusProvider @@ -32,9 +28,13 @@ import app.aaps.core.interfaces.rx.events.EventLoopUpdateGui import app.aaps.core.interfaces.rx.events.EventOverviewBolusProgress import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter +import app.aaps.core.main.extensions.durationInMinutes +import app.aaps.core.main.extensions.toStringFull +import app.aaps.core.main.iob.round +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.plugins.sync.R import app.aaps.shared.impl.extensions.safeQueryBroadcastReceivers import dagger.android.HasAndroidInjector -import info.nightscout.plugins.sync.R import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/di/Helpers.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/Helpers.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/di/Helpers.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/Helpers.kt index da14910a39..24a650e27a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/di/Helpers.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/Helpers.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.di +package app.aaps.plugins.sync.di import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider @@ -36,5 +36,6 @@ internal annotation class ViewModelKey(val value: KClass) class ViewModelFactory @Inject constructor( private val viewModels: MutableMap, @JvmSuppressWildcards Provider> ) : ViewModelProvider.Factory { + override fun create(modelClass: Class): T = viewModels[modelClass]?.get() as T } \ No newline at end of file diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/di/OpenHumansModule.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/OpenHumansModule.kt similarity index 81% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/di/OpenHumansModule.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/OpenHumansModule.kt index d55beeb8df..a7ab4876a7 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/di/OpenHumansModule.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/OpenHumansModule.kt @@ -1,16 +1,16 @@ -package info.nightscout.plugins.sync.di +package app.aaps.plugins.sync.di import androidx.lifecycle.ViewModel +import app.aaps.plugins.sync.openhumans.OpenHumansWorker +import app.aaps.plugins.sync.openhumans.delegates.OHStateDelegate +import app.aaps.plugins.sync.openhumans.ui.OHFragment +import app.aaps.plugins.sync.openhumans.ui.OHLoginActivity +import app.aaps.plugins.sync.openhumans.ui.OHLoginViewModel import dagger.Binds import dagger.Module import dagger.Provides import dagger.android.ContributesAndroidInjector import dagger.multibindings.IntoMap -import info.nightscout.plugins.sync.openhumans.OpenHumansWorker -import info.nightscout.plugins.sync.openhumans.delegates.OHStateDelegate -import info.nightscout.plugins.sync.openhumans.ui.OHFragment -import info.nightscout.plugins.sync.openhumans.ui.OHLoginActivity -import info.nightscout.plugins.sync.openhumans.ui.OHLoginViewModel @Module abstract class OpenHumansModule { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/di/SyncModule.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/SyncModule.kt similarity index 66% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/di/SyncModule.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/SyncModule.kt index d326e9b2ab..aa8fd81445 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/di/SyncModule.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/di/SyncModule.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.di +package app.aaps.plugins.sync.di import android.content.Context import androidx.work.WorkManager @@ -7,33 +7,33 @@ import app.aaps.core.interfaces.nsclient.ProcessedDeviceStatusData import app.aaps.core.interfaces.nsclient.StoreDataForDb import app.aaps.core.interfaces.sync.DataSyncSelectorXdrip import app.aaps.core.interfaces.sync.XDripBroadcast +import app.aaps.plugins.sync.nsShared.NSClientFragment +import app.aaps.plugins.sync.nsShared.StoreDataForDbImpl +import app.aaps.plugins.sync.nsclient.data.NSSettingsStatusImpl +import app.aaps.plugins.sync.nsclient.data.ProcessedDeviceStatusDataImpl +import app.aaps.plugins.sync.nsclient.services.NSClientService +import app.aaps.plugins.sync.nsclient.workers.NSClientAddAckWorker +import app.aaps.plugins.sync.nsclient.workers.NSClientAddUpdateWorker +import app.aaps.plugins.sync.nsclient.workers.NSClientMbgWorker +import app.aaps.plugins.sync.nsclient.workers.NSClientUpdateRemoveAckWorker +import app.aaps.plugins.sync.nsclientV3.workers.DataSyncWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadBgWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadDeviceStatusWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadFoodsWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadLastModificationWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadProfileStoreWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadStatusWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadTreatmentsWorker +import app.aaps.plugins.sync.tidepool.TidepoolFragment +import app.aaps.plugins.sync.xdrip.DataSyncSelectorXdripImpl +import app.aaps.plugins.sync.xdrip.XdripFragment +import app.aaps.plugins.sync.xdrip.XdripPlugin +import app.aaps.plugins.sync.xdrip.workers.XdripDataSyncWorker import dagger.Binds import dagger.Module import dagger.Provides import dagger.Reusable import dagger.android.ContributesAndroidInjector -import info.nightscout.plugins.sync.nsShared.NSClientFragment -import info.nightscout.plugins.sync.nsShared.StoreDataForDbImpl -import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatusImpl -import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusDataImpl -import info.nightscout.plugins.sync.nsclient.services.NSClientService -import info.nightscout.plugins.sync.nsclient.workers.NSClientAddAckWorker -import info.nightscout.plugins.sync.nsclient.workers.NSClientAddUpdateWorker -import info.nightscout.plugins.sync.nsclient.workers.NSClientMbgWorker -import info.nightscout.plugins.sync.nsclient.workers.NSClientUpdateRemoveAckWorker -import info.nightscout.plugins.sync.nsclientV3.workers.DataSyncWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadBgWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadDeviceStatusWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadFoodsWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadLastModificationWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadProfileStoreWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadStatusWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadTreatmentsWorker -import info.nightscout.plugins.sync.tidepool.TidepoolFragment -import info.nightscout.plugins.sync.xdrip.DataSyncSelectorXdripImpl -import info.nightscout.plugins.sync.xdrip.XdripFragment -import info.nightscout.plugins.sync.xdrip.XdripPlugin -import info.nightscout.plugins.sync.xdrip.workers.XdripDataSyncWorker @Module( includes = [ diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSAlarm.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSAlarm.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSAlarm.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSAlarm.kt index d3b214d240..d39e5e0388 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSAlarm.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSAlarm.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared +package app.aaps.plugins.sync.nsShared import app.aaps.core.interfaces.nsclient.NSAlarm import app.aaps.core.utils.JsonHelper diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSClientFragment.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSClientFragment.kt index 90aff1265f..9fdccfc397 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSClientFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared +package app.aaps.plugins.sync.nsShared import android.content.Context import android.os.Bundle @@ -34,13 +34,13 @@ import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.utils.HtmlHelper import app.aaps.database.entities.UserEntry +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.databinding.NsClientFragmentBinding +import app.aaps.plugins.sync.databinding.NsClientLogItemBinding +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiData +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiQueue +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus import dagger.android.support.DaggerFragment -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.databinding.NsClientFragmentBinding -import info.nightscout.plugins.sync.databinding.NsClientLogItemBinding -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiData -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiQueue -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus import io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSSgv.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSSgv.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSSgv.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSSgv.kt index 15cef228eb..31f5cd0c26 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSSgv.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NSSgv.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared +package app.aaps.plugins.sync.nsShared import app.aaps.core.interfaces.nsclient.NSSgv import app.aaps.core.utils.JsonHelper diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NsIncomingDataProcessor.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NsIncomingDataProcessor.kt similarity index 92% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NsIncomingDataProcessor.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NsIncomingDataProcessor.kt index e38bcbbbfe..837ea457f2 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NsIncomingDataProcessor.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/NsIncomingDataProcessor.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared +package app.aaps.plugins.sync.nsShared import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.configuration.Config @@ -34,20 +34,20 @@ import app.aaps.core.utils.JsonHelper import app.aaps.database.entities.Food import app.aaps.database.entities.GlucoseValue import app.aaps.database.transactions.TransactionGlucoseValue -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsclient.extensions.fromJson -import info.nightscout.plugins.sync.nsclientV3.extensions.toBolus -import info.nightscout.plugins.sync.nsclientV3.extensions.toBolusCalculatorResult -import info.nightscout.plugins.sync.nsclientV3.extensions.toCarbs -import info.nightscout.plugins.sync.nsclientV3.extensions.toEffectiveProfileSwitch -import info.nightscout.plugins.sync.nsclientV3.extensions.toExtendedBolus -import info.nightscout.plugins.sync.nsclientV3.extensions.toFood -import info.nightscout.plugins.sync.nsclientV3.extensions.toOfflineEvent -import info.nightscout.plugins.sync.nsclientV3.extensions.toProfileSwitch -import info.nightscout.plugins.sync.nsclientV3.extensions.toTemporaryBasal -import info.nightscout.plugins.sync.nsclientV3.extensions.toTemporaryTarget -import info.nightscout.plugins.sync.nsclientV3.extensions.toTherapyEvent -import info.nightscout.plugins.sync.nsclientV3.extensions.toTransactionGlucoseValue +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsclient.extensions.fromJson +import app.aaps.plugins.sync.nsclientV3.extensions.toBolus +import app.aaps.plugins.sync.nsclientV3.extensions.toBolusCalculatorResult +import app.aaps.plugins.sync.nsclientV3.extensions.toCarbs +import app.aaps.plugins.sync.nsclientV3.extensions.toEffectiveProfileSwitch +import app.aaps.plugins.sync.nsclientV3.extensions.toExtendedBolus +import app.aaps.plugins.sync.nsclientV3.extensions.toFood +import app.aaps.plugins.sync.nsclientV3.extensions.toOfflineEvent +import app.aaps.plugins.sync.nsclientV3.extensions.toProfileSwitch +import app.aaps.plugins.sync.nsclientV3.extensions.toTemporaryBasal +import app.aaps.plugins.sync.nsclientV3.extensions.toTemporaryTarget +import app.aaps.plugins.sync.nsclientV3.extensions.toTherapyEvent +import app.aaps.plugins.sync.nsclientV3.extensions.toTransactionGlucoseValue import org.json.JSONArray import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/StoreDataForDbImpl.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/StoreDataForDbImpl.kt index b96409c8fc..8b5310aff6 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/StoreDataForDbImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared +package app.aaps.plugins.sync.nsShared import android.os.SystemClock import app.aaps.core.interfaces.configuration.Config @@ -31,6 +31,7 @@ import app.aaps.database.entities.TherapyEvent import app.aaps.database.entities.UserEntry import app.aaps.database.entities.ValueWithUnit import app.aaps.database.transactions.TransactionGlucoseValue +import app.aaps.plugins.sync.R import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.database.impl.transactions.InvalidateBolusCalculatorResultTransaction @@ -68,7 +69,6 @@ import info.nightscout.database.impl.transactions.UpdateNsIdProfileSwitchTransac import info.nightscout.database.impl.transactions.UpdateNsIdTemporaryBasalTransaction import info.nightscout.database.impl.transactions.UpdateNsIdTemporaryTargetTransaction import info.nightscout.database.impl.transactions.UpdateNsIdTherapyEventTransaction -import info.nightscout.plugins.sync.R import java.util.concurrent.Executors import java.util.concurrent.ScheduledFuture import java.util.concurrent.TimeUnit diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventConnectivityOptionChanged.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventConnectivityOptionChanged.kt similarity index 70% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventConnectivityOptionChanged.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventConnectivityOptionChanged.kt index cefd342b4d..eabc9b4813 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventConnectivityOptionChanged.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventConnectivityOptionChanged.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared.events +package app.aaps.plugins.sync.nsShared.events import app.aaps.core.interfaces.rx.events.Event diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientStatus.kt similarity index 79% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientStatus.kt index 6b6617b8e3..34ea05993e 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientStatus.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared.events +package app.aaps.plugins.sync.nsShared.events import android.content.Context import app.aaps.core.interfaces.rx.events.EventStatus diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiData.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiData.kt similarity index 67% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiData.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiData.kt index 61fcf4a8be..e499731c68 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiData.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiData.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared.events +package app.aaps.plugins.sync.nsShared.events import app.aaps.core.interfaces.rx.events.EventUpdateGui diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiQueue.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiQueue.kt similarity index 67% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiQueue.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiQueue.kt index bf4b549597..2356b3ec3b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiQueue.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiQueue.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared.events +package app.aaps.plugins.sync.nsShared.events import app.aaps.core.interfaces.rx.events.EventUpdateGui diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiStatus.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiStatus.kt similarity index 67% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiStatus.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiStatus.kt index 216b558127..2b72b5c1a6 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiStatus.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsShared/events/EventNSClientUpdateGuiStatus.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsShared.events +package app.aaps.plugins.sync.nsShared.events import app.aaps.core.interfaces.rx.events.EventUpdateGui diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/DataSyncSelectorV1.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/DataSyncSelectorV1.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/DataSyncSelectorV1.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/DataSyncSelectorV1.kt index ee36211f0d..b2d3149377 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/DataSyncSelectorV1.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/DataSyncSelectorV1.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient +package app.aaps.plugins.sync.nsclient import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag @@ -12,10 +12,10 @@ import app.aaps.core.interfaces.sync.DataSyncSelector import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.JsonHelper import app.aaps.core.utils.waitMillis +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiQueue +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiQueue -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/NSClientPlugin.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/NSClientPlugin.kt index 0cd900515f..30442830b0 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/NSClientPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient +package app.aaps.plugins.sync.nsclient import android.content.ComponentName import android.content.Context @@ -8,8 +8,6 @@ import android.os.IBinder import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceScreen import androidx.preference.SwitchPreference -import app.aaps.core.main.extensions.toJson -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.configuration.Constants import app.aaps.core.interfaces.logging.AAPSLogger @@ -34,15 +32,17 @@ import app.aaps.core.interfaces.sync.NsClient import app.aaps.core.interfaces.sync.Sync import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter +import app.aaps.core.main.extensions.toJson +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsShared.NSClientFragment +import app.aaps.plugins.sync.nsShared.events.EventNSClientStatus +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiData +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus +import app.aaps.plugins.sync.nsclient.data.AlarmAck +import app.aaps.plugins.sync.nsclient.extensions.toJson +import app.aaps.plugins.sync.nsclient.services.NSClientService import dagger.android.HasAndroidInjector -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsShared.NSClientFragment -import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiData -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus -import info.nightscout.plugins.sync.nsclient.data.AlarmAck -import info.nightscout.plugins.sync.nsclient.extensions.toJson -import info.nightscout.plugins.sync.nsclient.services.NSClientService import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/ReceiverDelegate.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/ReceiverDelegate.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/ReceiverDelegate.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/ReceiverDelegate.kt index 072b6a493e..944e8e0ffd 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/ReceiverDelegate.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/ReceiverDelegate.kt @@ -1,7 +1,6 @@ -package info.nightscout.plugins.sync.nsclient +package app.aaps.plugins.sync.nsclient import app.aaps.annotations.OpenForTesting -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.receivers.ReceiverStatusStore import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.rx.AapsSchedulers @@ -10,8 +9,9 @@ import app.aaps.core.interfaces.rx.events.EventChargingState import app.aaps.core.interfaces.rx.events.EventNetworkChange import app.aaps.core.interfaces.rx.events.EventPreferenceChange import app.aaps.core.interfaces.sharedPreferences.SP -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsShared.events.EventConnectivityOptionChanged +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsShared.events.EventConnectivityOptionChanged import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAddAck.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSAddAck.kt similarity index 91% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAddAck.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSAddAck.kt index deb9425dc2..3449b184c9 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAddAck.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSAddAck.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.acks +package app.aaps.plugins.sync.nsclient.acks import androidx.work.OneTimeWorkRequest import app.aaps.core.interfaces.logging.AAPSLogger @@ -8,8 +8,8 @@ import app.aaps.core.interfaces.rx.events.Event import app.aaps.core.interfaces.rx.events.EventNSClientRestart import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.receivers.DataWorkerStorage -import info.nightscout.plugins.sync.nsclient.services.NSClientService -import info.nightscout.plugins.sync.nsclient.workers.NSClientAddAckWorker +import app.aaps.plugins.sync.nsclient.services.NSClientService +import app.aaps.plugins.sync.nsclient.workers.NSClientAddAckWorker import io.socket.client.Ack import org.json.JSONArray import org.json.JSONObject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAuthAck.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSAuthAck.kt similarity index 91% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAuthAck.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSAuthAck.kt index 8898b9da6e..bb8f01435b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAuthAck.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSAuthAck.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.acks +package app.aaps.plugins.sync.nsclient.acks import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.Event diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSUpdateAck.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSUpdateAck.kt similarity index 89% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSUpdateAck.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSUpdateAck.kt index 44991baaa4..e9c476d04e 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSUpdateAck.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/acks/NSUpdateAck.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.acks +package app.aaps.plugins.sync.nsclient.acks import androidx.work.OneTimeWorkRequest import app.aaps.core.interfaces.logging.AAPSLogger @@ -7,8 +7,8 @@ import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.Event import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.receivers.DataWorkerStorage -import info.nightscout.plugins.sync.nsclient.services.NSClientService -import info.nightscout.plugins.sync.nsclient.workers.NSClientUpdateRemoveAckWorker +import app.aaps.plugins.sync.nsclient.services.NSClientService +import app.aaps.plugins.sync.nsclient.workers.NSClientUpdateRemoveAckWorker import io.socket.client.Ack import org.json.JSONException import org.json.JSONObject diff --git a/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/AlarmAck.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/AlarmAck.kt new file mode 100644 index 0000000000..879f677dee --- /dev/null +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/AlarmAck.kt @@ -0,0 +1,11 @@ +package app.aaps.plugins.sync.nsclient.data + +/** + * Created by mike on 11.06.2017. + */ +class AlarmAck { + + var level: Int? = null + var group: String? = null + var silenceTime: Long? = null +} diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt index 358eee0d99..eeb3dea744 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.data +package app.aaps.plugins.sync.nsclient.data import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.configuration.Config diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSMbg.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSMbg.kt similarity index 88% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSMbg.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSMbg.kt index bbff33822f..b6a010649a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSMbg.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSMbg.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.data +package app.aaps.plugins.sync.nsclient.data import app.aaps.core.utils.JsonHelper import org.json.JSONObject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt index e0d047fd97..ec08c0c1e4 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt @@ -1,6 +1,6 @@ @file:Suppress("SpellCheckingInspection") -package info.nightscout.plugins.sync.nsclient.data +package app.aaps.plugins.sync.nsclient.data import android.content.Context import app.aaps.annotations.OpenForTesting @@ -20,7 +20,7 @@ import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.utils.JsonHelper import app.aaps.database.entities.UserEntry import app.aaps.database.entities.UserEntry.Action -import info.nightscout.plugins.sync.R +import app.aaps.plugins.sync.R import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt index df580a65b2..2fea300f15 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.data +package app.aaps.plugins.sync.nsclient.data import android.text.Spanned import app.aaps.core.interfaces.aps.APSResult @@ -12,8 +12,8 @@ import app.aaps.core.interfaces.utils.Round import app.aaps.core.interfaces.utils.T import app.aaps.core.utils.HtmlHelper import app.aaps.core.utils.JsonHelper +import app.aaps.plugins.sync.R import dagger.android.HasAndroidInjector -import info.nightscout.plugins.sync.R import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt similarity index 97% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt index df10cfdd55..1c25df1b22 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.profile.ProfileUtil import app.aaps.core.interfaces.utils.DateUtil diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/BolusExtension.kt similarity index 97% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/BolusExtension.kt index 598d88909c..58c548a9ca 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/BolusExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.JsonHelper diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/CarbsExtension.kt similarity index 97% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/CarbsExtension.kt index b1ef4b2784..7bc796dbfa 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/CarbsExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.JsonHelper diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt index ec08658c0e..9944063bf9 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.utils.DateUtil import app.aaps.database.entities.DeviceStatus diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt index 60bdbec5d1..00252b33ea 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.utils.DateUtil diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt index 6a2b3bb383..be6d6c8892 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.utils.DateUtil diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/FoodExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/FoodExtension.kt similarity index 97% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/FoodExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/FoodExtension.kt index ddbd71fa3a..84d8c3f5a0 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/FoodExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/FoodExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.utils.JsonHelper import app.aaps.database.entities.Food diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/OfflineEventExtension.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/OfflineEventExtension.kt index d30cedc088..ef07a2e872 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/OfflineEventExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt index a66fb92dc4..b992be6e02 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.utils.DateUtil diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt index 68b71b9169..35a786ebde 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.utils.DateUtil diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt index 2bb851ff0f..07c8189335 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.configuration.Constants import app.aaps.core.interfaces.db.GlucoseUnit diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TherapyEventExtension.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TherapyEventExtension.kt index 9bc2096318..b3f06b6d98 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/extensions/TherapyEventExtension.kt @@ -1,11 +1,11 @@ -package info.nightscout.plugins.sync.nsclient.extensions +package app.aaps.plugins.sync.nsclient.extensions import app.aaps.core.interfaces.db.GlucoseUnit import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.core.utils.JsonHelper import app.aaps.database.entities.TherapyEvent -import info.nightscout.plugins.sync.nsclient.data.NSMbg +import app.aaps.plugins.sync.nsclient.data.NSMbg import org.json.JSONObject fun TherapyEvent.GlucoseUnit.toMainUnit(): GlucoseUnit = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/services/NSClientService.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/services/NSClientService.kt index 774870152a..cf2544729e 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/services/NSClientService.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.services +package app.aaps.plugins.sync.nsclient.services import android.annotation.SuppressLint import android.content.Context @@ -30,6 +30,21 @@ import app.aaps.core.nssdk.localmodel.devicestatus.NSDeviceStatus import app.aaps.core.utils.JsonHelper.safeGetString import app.aaps.core.utils.JsonHelper.safeGetStringAllowNull import app.aaps.core.utils.receivers.DataWorkerStorage +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsShared.NSAlarmObject +import app.aaps.plugins.sync.nsShared.NsIncomingDataProcessor +import app.aaps.plugins.sync.nsShared.events.EventConnectivityOptionChanged +import app.aaps.plugins.sync.nsShared.events.EventNSClientStatus +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus +import app.aaps.plugins.sync.nsclient.DataSyncSelectorV1 +import app.aaps.plugins.sync.nsclient.NSClientPlugin +import app.aaps.plugins.sync.nsclient.acks.NSAddAck +import app.aaps.plugins.sync.nsclient.acks.NSAuthAck +import app.aaps.plugins.sync.nsclient.acks.NSUpdateAck +import app.aaps.plugins.sync.nsclient.data.AlarmAck +import app.aaps.plugins.sync.nsclient.data.NSDeviceStatusHandler +import app.aaps.plugins.sync.nsclient.workers.NSClientAddUpdateWorker +import app.aaps.plugins.sync.nsclient.workers.NSClientMbgWorker import com.google.common.base.Charsets import com.google.common.hash.Hashing import com.google.gson.GsonBuilder @@ -37,21 +52,6 @@ import com.google.gson.JsonDeserializer import dagger.android.DaggerService import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsShared.NSAlarmObject -import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor -import info.nightscout.plugins.sync.nsShared.events.EventConnectivityOptionChanged -import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus -import info.nightscout.plugins.sync.nsclient.DataSyncSelectorV1 -import info.nightscout.plugins.sync.nsclient.NSClientPlugin -import info.nightscout.plugins.sync.nsclient.acks.NSAddAck -import info.nightscout.plugins.sync.nsclient.acks.NSAuthAck -import info.nightscout.plugins.sync.nsclient.acks.NSUpdateAck -import info.nightscout.plugins.sync.nsclient.data.AlarmAck -import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler -import info.nightscout.plugins.sync.nsclient.workers.NSClientAddUpdateWorker -import info.nightscout.plugins.sync.nsclient.workers.NSClientMbgWorker import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import io.socket.client.IO diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt index ee54811609..14507b5a96 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.workers +package app.aaps.plugins.sync.nsclient.workers import android.content.Context import android.os.SystemClock @@ -26,9 +26,9 @@ import app.aaps.core.interfaces.sync.DataSyncSelector.PairTherapyEvent import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.utils.notifyAll import app.aaps.core.utils.receivers.DataWorkerStorage +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsclient.acks.NSAddAck import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsclient.acks.NSAddAck import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt index da7438370c..7a98561226 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.workers +package app.aaps.plugins.sync.nsclient.workers import android.content.Context import androidx.work.WorkerParameters @@ -25,12 +25,12 @@ import app.aaps.database.entities.ProfileSwitch import app.aaps.database.entities.TemporaryBasal import app.aaps.database.entities.TemporaryTarget import app.aaps.database.entities.TherapyEvent +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsclient.extensions.extendedBolusFromJson +import app.aaps.plugins.sync.nsclient.extensions.fromJson +import app.aaps.plugins.sync.nsclient.extensions.isEffectiveProfileSwitch +import app.aaps.plugins.sync.nsclient.extensions.temporaryBasalFromJson import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsclient.extensions.extendedBolusFromJson -import info.nightscout.plugins.sync.nsclient.extensions.fromJson -import info.nightscout.plugins.sync.nsclient.extensions.isEffectiveProfileSwitch -import info.nightscout.plugins.sync.nsclient.extensions.temporaryBasalFromJson import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientMbgWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientMbgWorker.kt similarity index 89% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientMbgWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientMbgWorker.kt index 448505d20b..33fdf30918 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientMbgWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientMbgWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.workers +package app.aaps.plugins.sync.nsclient.workers import android.content.Context import androidx.work.WorkerParameters @@ -8,8 +8,8 @@ import app.aaps.core.interfaces.nsclient.StoreDataForDb import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.utils.receivers.DataWorkerStorage -import info.nightscout.plugins.sync.nsclient.data.NSMbg -import info.nightscout.plugins.sync.nsclient.extensions.therapyEventFromNsMbg +import app.aaps.plugins.sync.nsclient.data.NSMbg +import app.aaps.plugins.sync.nsclient.extensions.therapyEventFromNsMbg import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt index 8267bcd0e1..2fd41ad41b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclient.workers +package app.aaps.plugins.sync.nsclient.workers import android.content.Context import androidx.work.WorkerParameters @@ -21,8 +21,8 @@ import app.aaps.core.interfaces.sync.DataSyncSelector.PairTherapyEvent import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.utils.notifyAll import app.aaps.core.utils.receivers.DataWorkerStorage +import app.aaps.plugins.sync.nsclient.acks.NSUpdateAck import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.nsclient.acks.NSUpdateAck import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/DataSyncSelectorV3.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/DataSyncSelectorV3.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/DataSyncSelectorV3.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/DataSyncSelectorV3.kt index 6ead37bac5..b99691b545 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/DataSyncSelectorV3.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/DataSyncSelectorV3.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3 +package app.aaps.plugins.sync.nsclientV3 import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.configuration.Config @@ -13,10 +13,10 @@ import app.aaps.core.interfaces.source.NSClientSource import app.aaps.core.interfaces.sync.DataSyncSelector import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.utils.JsonHelper +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiQueue +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiQueue -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/NSClientV3Plugin.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/NSClientV3Plugin.kt index 7524ebdd50..29629c0ed5 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/NSClientV3Plugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3 +package app.aaps.plugins.sync.nsclientV3 import android.content.Context import android.os.Handler @@ -57,40 +57,40 @@ import app.aaps.core.nssdk.mapper.toNSTreatment import app.aaps.core.nssdk.remotemodel.LastModified import app.aaps.database.ValueWrapper import app.aaps.database.entities.interfaces.TraceableDBEntry +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsShared.NSAlarmObject +import app.aaps.plugins.sync.nsShared.NSClientFragment +import app.aaps.plugins.sync.nsShared.NsIncomingDataProcessor +import app.aaps.plugins.sync.nsShared.events.EventConnectivityOptionChanged +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiData +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus +import app.aaps.plugins.sync.nsclient.ReceiverDelegate +import app.aaps.plugins.sync.nsclient.data.NSDeviceStatusHandler +import app.aaps.plugins.sync.nsclientV3.extensions.toNSBolus +import app.aaps.plugins.sync.nsclientV3.extensions.toNSBolusWizard +import app.aaps.plugins.sync.nsclientV3.extensions.toNSCarbs +import app.aaps.plugins.sync.nsclientV3.extensions.toNSDeviceStatus +import app.aaps.plugins.sync.nsclientV3.extensions.toNSEffectiveProfileSwitch +import app.aaps.plugins.sync.nsclientV3.extensions.toNSExtendedBolus +import app.aaps.plugins.sync.nsclientV3.extensions.toNSFood +import app.aaps.plugins.sync.nsclientV3.extensions.toNSOfflineEvent +import app.aaps.plugins.sync.nsclientV3.extensions.toNSProfileSwitch +import app.aaps.plugins.sync.nsclientV3.extensions.toNSSvgV3 +import app.aaps.plugins.sync.nsclientV3.extensions.toNSTemporaryBasal +import app.aaps.plugins.sync.nsclientV3.extensions.toNSTemporaryTarget +import app.aaps.plugins.sync.nsclientV3.extensions.toNSTherapyEvent +import app.aaps.plugins.sync.nsclientV3.workers.DataSyncWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadBgWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadDeviceStatusWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadFoodsWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadLastModificationWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadProfileStoreWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadStatusWorker +import app.aaps.plugins.sync.nsclientV3.workers.LoadTreatmentsWorker import com.google.gson.Gson import com.google.gson.GsonBuilder import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsShared.NSAlarmObject -import info.nightscout.plugins.sync.nsShared.NSClientFragment -import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor -import info.nightscout.plugins.sync.nsShared.events.EventConnectivityOptionChanged -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiData -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus -import info.nightscout.plugins.sync.nsclient.ReceiverDelegate -import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSBolus -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSBolusWizard -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSCarbs -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSDeviceStatus -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSEffectiveProfileSwitch -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSExtendedBolus -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSFood -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSOfflineEvent -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSProfileSwitch -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSSvgV3 -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSTemporaryBasal -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSTemporaryTarget -import info.nightscout.plugins.sync.nsclientV3.extensions.toNSTherapyEvent -import info.nightscout.plugins.sync.nsclientV3.workers.DataSyncWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadBgWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadDeviceStatusWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadFoodsWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadLastModificationWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadProfileStoreWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadStatusWorker -import info.nightscout.plugins.sync.nsclientV3.workers.LoadTreatmentsWorker import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import io.socket.client.Ack diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt index a77ad46a4a..9b26042375 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T import app.aaps.core.nssdk.localmodel.entry.NsUnits diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/BolusExtension.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/BolusExtension.kt index 3a5ac1ee72..7727289e47 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/BolusExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T import app.aaps.core.nssdk.localmodel.treatment.EventType diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/CarbsExtension.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/CarbsExtension.kt index ddb44c4d3f..25293f49ba 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/CarbsExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T import app.aaps.core.nssdk.localmodel.treatment.EventType diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/DeviceStatusExtension.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/DeviceStatusExtension.kt index 6584001b84..269b94e605 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/DeviceStatusExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.nssdk.localmodel.devicestatus.NSDeviceStatus import app.aaps.database.entities.DeviceStatus diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt index 3587d6c516..c351bd036b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T @@ -8,7 +8,7 @@ import app.aaps.core.nssdk.localmodel.treatment.EventType import app.aaps.core.nssdk.localmodel.treatment.NSEffectiveProfileSwitch import app.aaps.database.entities.EffectiveProfileSwitch import app.aaps.database.entities.embedments.InterfaceIDs -import info.nightscout.plugins.sync.nsclient.extensions.fromConstant +import app.aaps.plugins.sync.nsclient.extensions.fromConstant import java.security.InvalidParameterException fun NSEffectiveProfileSwitch.toEffectiveProfileSwitch(dateUtil: DateUtil): EffectiveProfileSwitch? { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt similarity index 97% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt index 4af49def32..c4d906ee16 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.utils.T diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/FoodExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/FoodExtension.kt similarity index 94% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/FoodExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/FoodExtension.kt index 1dcdf77506..88fbfc4169 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/FoodExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/FoodExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.nssdk.localmodel.food.NSFood import app.aaps.database.entities.Food diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt index 694e35907c..3d2c29850d 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T import app.aaps.core.nssdk.localmodel.entry.Direction diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt index 985f260735..26bf6642a7 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T import app.aaps.core.nssdk.localmodel.treatment.EventType diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt index 5989402b30..dfa70fa74d 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.utils.DateUtil diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt index af33bf2f0c..b1dbc8555a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.utils.T diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt index c973a09fa7..d218165af4 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T import app.aaps.core.nssdk.localmodel.entry.NsUnits diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt similarity index 97% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt index f1549b6369..e2da77eb1c 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.extensions +package app.aaps.plugins.sync.nsclientV3.extensions import app.aaps.core.interfaces.utils.T import app.aaps.core.nssdk.localmodel.entry.NsUnits diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/DataSyncWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/DataSyncWorker.kt similarity index 89% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/DataSyncWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/DataSyncWorker.kt index 348b901a15..b2d6059be5 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/DataSyncWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/DataSyncWorker.kt @@ -1,14 +1,14 @@ -package info.nightscout.plugins.sync.nsclientV3.workers +package app.aaps.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import app.aaps.annotations.OpenForTesting -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventNSClientNewLog -import info.nightscout.plugins.sync.nsclientV3.DataSyncSelectorV3 -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.core.main.utils.worker.LoggingWorker +import app.aaps.plugins.sync.nsclientV3.DataSyncSelectorV3 +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadBgWorker.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadBgWorker.kt index f618aa64b4..e462bdbe15 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadBgWorker.kt @@ -1,9 +1,8 @@ -package info.nightscout.plugins.sync.nsclientV3.workers +package app.aaps.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.nsclient.StoreDataForDb import app.aaps.core.interfaces.rx.bus.RxBus @@ -12,10 +11,11 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.source.NSClientSource import app.aaps.core.interfaces.sync.NsClient import app.aaps.core.interfaces.utils.DateUtil -import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.nssdk.interfaces.NSAndroidClient import app.aaps.core.nssdk.localmodel.entry.NSSgvV3 +import app.aaps.plugins.sync.nsShared.NsIncomingDataProcessor +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin import kotlinx.coroutines.Dispatchers import javax.inject.Inject import kotlin.math.max diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt similarity index 92% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt index 0eb2b6e13c..3e78618ecb 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.workers +package app.aaps.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters @@ -9,8 +9,8 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.utils.receivers.DataWorkerStorage -import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.plugins.sync.nsclient.data.NSDeviceStatusHandler +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadFoodsWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadFoodsWorker.kt similarity index 92% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadFoodsWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadFoodsWorker.kt index 74e488ab61..b902f0adbd 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadFoodsWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadFoodsWorker.kt @@ -1,17 +1,17 @@ -package info.nightscout.plugins.sync.nsclientV3.workers +package app.aaps.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.nsclient.StoreDataForDb import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventNSClientNewLog import app.aaps.core.interfaces.utils.DateUtil -import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.nssdk.localmodel.food.NSFood +import app.aaps.plugins.sync.nsShared.NsIncomingDataProcessor +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt similarity index 92% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt index f580769a93..0ce262cecc 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt @@ -1,13 +1,13 @@ -package info.nightscout.plugins.sync.nsclientV3.workers +package app.aaps.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventNSClientNewLog -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.core.main.utils.worker.LoggingWorker +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadProfileStoreWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadProfileStoreWorker.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadProfileStoreWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadProfileStoreWorker.kt index 59bfb4355b..1e4931f8a8 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadProfileStoreWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadProfileStoreWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.nsclientV3.workers +package app.aaps.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters @@ -12,8 +12,8 @@ import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.nssdk.interfaces.NSAndroidClient import app.aaps.core.utils.JsonHelper import app.aaps.core.utils.receivers.DataWorkerStorage -import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.plugins.sync.nsShared.NsIncomingDataProcessor +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin import kotlinx.coroutines.Dispatchers import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt similarity index 87% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt index be2c4153f1..e8460dedd5 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt @@ -1,14 +1,14 @@ -package info.nightscout.plugins.sync.nsclientV3.workers +package app.aaps.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventNSClientNewLog -import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.core.main.utils.worker.LoggingWorker +import app.aaps.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt similarity index 96% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt index 2758da2b5e..0b6e7f7840 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt @@ -1,19 +1,19 @@ -package info.nightscout.plugins.sync.nsclientV3.workers +package app.aaps.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.nsclient.StoreDataForDb import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventNSClientNewLog import app.aaps.core.interfaces.sync.NsClient import app.aaps.core.interfaces.utils.DateUtil -import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor -import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.nssdk.interfaces.NSAndroidClient import app.aaps.core.nssdk.localmodel.treatment.NSTreatment +import app.aaps.plugins.sync.nsShared.NsIncomingDataProcessor +import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin import kotlinx.coroutines.Dispatchers import javax.inject.Inject import kotlin.math.max diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/AllowedPreferenceKeys.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/AllowedPreferenceKeys.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/AllowedPreferenceKeys.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/AllowedPreferenceKeys.kt index e6b72e844c..d8cf424bd3 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/AllowedPreferenceKeys.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/AllowedPreferenceKeys.kt @@ -1,6 +1,6 @@ -package info.nightscout.plugins.sync.openhumans +package app.aaps.plugins.sync.openhumans -import java.util.* +import java.util.Locale internal fun String.isAllowedKey() = if (startsWith("ConfigBuilder_")) true else allowedKeys.contains(this.uppercase(Locale.ROOT)) diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansAPI.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansAPI.kt similarity index 86% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansAPI.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansAPI.kt index 21a81ba4dd..6b2ca8755a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansAPI.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansAPI.kt @@ -1,11 +1,11 @@ -package info.nightscout.plugins.sync.openhumans +package app.aaps.plugins.sync.openhumans import android.annotation.SuppressLint import android.util.Base64 -import info.nightscout.plugins.sync.di.BaseUrl -import info.nightscout.plugins.sync.di.ClientId -import info.nightscout.plugins.sync.di.ClientSecret -import info.nightscout.plugins.sync.di.RedirectUrl +import app.aaps.plugins.sync.di.BaseUrl +import app.aaps.plugins.sync.di.ClientId +import app.aaps.plugins.sync.di.ClientSecret +import app.aaps.plugins.sync.di.RedirectUrl import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.suspendCancellableCoroutine import okhttp3.* @@ -28,20 +28,25 @@ internal class OpenHumansAPI @Inject constructor( @RedirectUrl private val redirectUrl: String ) { + private val authHeader = "Basic " + Base64.encodeToString("$clientId:$clientSecret".toByteArray(), Base64.NO_WRAP) private val client = OkHttpClient() - suspend fun exchangeBearerToken(bearerToken: String) = sendTokenRequest(FormBody.Builder() - .add("grant_type", "authorization_code") - .add("redirect_uri", redirectUrl) - .add("code", bearerToken) - .build()) + suspend fun exchangeBearerToken(bearerToken: String) = sendTokenRequest( + FormBody.Builder() + .add("grant_type", "authorization_code") + .add("redirect_uri", redirectUrl) + .add("code", bearerToken) + .build() + ) - suspend fun refreshAccessToken(refreshToken: String) = sendTokenRequest(FormBody.Builder() - .add("grant_type", "refresh_token") - .add("redirect_uri", redirectUrl) - .add("refresh_token", refreshToken) - .build()) + suspend fun refreshAccessToken(refreshToken: String) = sendTokenRequest( + FormBody.Builder() + .add("grant_type", "refresh_token") + .add("redirect_uri", redirectUrl) + .add("refresh_token", refreshToken) + .build() + ) private suspend fun sendTokenRequest(body: FormBody): OAuthTokens { val timestamp = System.currentTimeMillis() @@ -74,10 +79,12 @@ internal class OpenHumansAPI @Inject constructor( suspend fun prepareFileUpload(accessToken: String, fileName: String, metadata: FileMetadata): PreparedUpload { val request = Request.Builder() .url("$baseUrl/api/direct-sharing/project/files/upload/direct/?access_token=$accessToken") - .post(FormBody.Builder() - .add("filename", fileName) - .add("metadata", metadata.toJSON().toString()) - .build()) + .post( + FormBody.Builder() + .add("filename", fileName) + .add("metadata", metadata.toJSON().toString()) + .build() + ) .build() val response = request.await() val json = response.body?.let { JSONObject(it.string()) } @@ -108,9 +115,11 @@ internal class OpenHumansAPI @Inject constructor( suspend fun completeFileUpload(accessToken: String, fileId: String) { val request = Request.Builder() .url("$baseUrl/api/direct-sharing/project/files/upload/complete/?access_token=$accessToken") - .post(FormBody.Builder() - .add("file_id", fileId) - .build()) + .post( + FormBody.Builder() + .add("file_id", fileId) + .build() + ) .build() val response = request.await() if (!response.isSuccessful) throw OHHttpException(response.code, response.message, null) @@ -170,6 +179,7 @@ internal class OpenHumansAPI @Inject constructor( val meaning: String, val detail: String? ) : RuntimeException() { + override val message: String get() = toString() } @@ -178,6 +188,7 @@ internal class OpenHumansAPI @Inject constructor( ) : RuntimeException() private companion object { + @SuppressLint("SimpleDateFormat") val iso8601DateFormatter = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX") } diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansState.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansState.kt similarity index 79% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansState.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansState.kt index 583ce8cf03..e49a99cb9b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansState.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansState.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.openhumans +package app.aaps.plugins.sync.openhumans internal data class OpenHumansState( val accessToken: String, diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt index 3c6f0f93e2..5974216c88 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.openhumans +package app.aaps.plugins.sync.openhumans import android.app.NotificationChannel import android.app.NotificationManager @@ -29,14 +29,14 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.sync.Sync import app.aaps.database.entities.data.Block import app.aaps.database.entities.interfaces.TraceableDBEntry +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.openhumans.delegates.OHAppIDDelegate +import app.aaps.plugins.sync.openhumans.delegates.OHCounterDelegate +import app.aaps.plugins.sync.openhumans.delegates.OHStateDelegate +import app.aaps.plugins.sync.openhumans.ui.OHFragment +import app.aaps.plugins.sync.openhumans.ui.OHLoginActivity import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.openhumans.delegates.OHAppIDDelegate -import info.nightscout.plugins.sync.openhumans.delegates.OHCounterDelegate -import info.nightscout.plugins.sync.openhumans.delegates.OHStateDelegate -import info.nightscout.plugins.sync.openhumans.ui.OHFragment -import info.nightscout.plugins.sync.openhumans.ui.OHLoginActivity import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import kotlinx.coroutines.Dispatchers diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansWorker.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansWorker.kt index 916bf6ead5..51ef5221af 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/OpenHumansWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.openhumans +package app.aaps.plugins.sync.openhumans import android.content.Context import androidx.work.CoroutineWorker diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHAppIDDelegate.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHAppIDDelegate.kt similarity index 93% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHAppIDDelegate.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHAppIDDelegate.kt index 1831a3e9fa..74a9918b19 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHAppIDDelegate.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHAppIDDelegate.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.openhumans.delegates +package app.aaps.plugins.sync.openhumans.delegates import app.aaps.core.interfaces.sharedPreferences.SP import java.util.UUID diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHCounterDelegate.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHCounterDelegate.kt similarity index 90% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHCounterDelegate.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHCounterDelegate.kt index 441d94987b..0b9e62d74a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHCounterDelegate.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHCounterDelegate.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.openhumans.delegates +package app.aaps.plugins.sync.openhumans.delegates import app.aaps.core.interfaces.sharedPreferences.SP import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHStateDelegate.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHStateDelegate.kt similarity index 94% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHStateDelegate.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHStateDelegate.kt index 2250ad0692..97ca99286c 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHStateDelegate.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/delegates/OHStateDelegate.kt @@ -1,9 +1,9 @@ -package info.nightscout.plugins.sync.openhumans.delegates +package app.aaps.plugins.sync.openhumans.delegates import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import app.aaps.core.interfaces.sharedPreferences.SP -import info.nightscout.plugins.sync.openhumans.OpenHumansState +import app.aaps.plugins.sync.openhumans.OpenHumansState import javax.inject.Inject import javax.inject.Singleton import kotlin.reflect.KProperty diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHFragment.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHFragment.kt similarity index 91% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHFragment.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHFragment.kt index e25d06fa63..11633f4744 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHFragment.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.openhumans.ui +package app.aaps.plugins.sync.openhumans.ui import android.content.Intent import android.os.Bundle @@ -8,11 +8,11 @@ import android.view.ViewGroup import android.widget.TextView import androidx.appcompat.view.ContextThemeWrapper import androidx.lifecycle.LiveData +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.openhumans.OpenHumansState +import app.aaps.plugins.sync.openhumans.OpenHumansUploaderPlugin import com.google.android.material.button.MaterialButton import dagger.android.support.DaggerFragment -import info.nightscout.plugins.sync.openhumans.OpenHumansState -import info.nightscout.plugins.sync.openhumans.OpenHumansUploaderPlugin -import info.nightscout.plugins.sync.R import javax.inject.Inject class OHFragment : DaggerFragment() { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHLoginActivity.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHLoginActivity.kt similarity index 93% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHLoginActivity.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHLoginActivity.kt index c420df08ad..f98bb91837 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHLoginActivity.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHLoginActivity.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.openhumans.ui +package app.aaps.plugins.sync.openhumans.ui import android.content.Intent import android.net.Uri @@ -13,12 +13,12 @@ import androidx.core.view.WindowCompat import androidx.core.view.WindowInsetsCompat import androidx.core.view.updatePadding import androidx.core.widget.NestedScrollView +import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.di.AuthUrl +import app.aaps.plugins.sync.di.ViewModelFactory import com.google.android.material.appbar.MaterialToolbar import com.google.android.material.button.MaterialButton -import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.di.AuthUrl -import info.nightscout.plugins.sync.di.ViewModelFactory import javax.inject.Inject class OHLoginActivity : TranslatedDaggerAppCompatActivity() { @@ -94,7 +94,7 @@ class OHLoginActivity : TranslatedDaggerAppCompatActivity() { if (code != null) { viewModel.submitBearerToken(code) } - onBackPressedDispatcher.addCallback(this, object: OnBackPressedCallback(true) { + onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) { override fun handleOnBackPressed() { if (!viewModel.goBack()) finish() } diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHLoginViewModel.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHLoginViewModel.kt similarity index 93% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHLoginViewModel.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHLoginViewModel.kt index 50b7d182ae..e62cfa89f0 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/ui/OHLoginViewModel.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/openhumans/ui/OHLoginViewModel.kt @@ -1,9 +1,9 @@ -package info.nightscout.plugins.sync.openhumans.ui +package app.aaps.plugins.sync.openhumans.ui import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel -import info.nightscout.plugins.sync.openhumans.OpenHumansUploaderPlugin +import app.aaps.plugins.sync.openhumans.OpenHumansUploaderPlugin import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.MainScope import kotlinx.coroutines.launch @@ -27,10 +27,12 @@ internal class OHLoginViewModel @Inject constructor( _state.value = State.WELCOME true } + State.CONFIRM -> { _state.value = State.CONSENT true } + else -> false } diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolFragment.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/TidepoolFragment.kt similarity index 90% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolFragment.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/TidepoolFragment.kt index 242a98979c..4b4629ec84 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolFragment.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/TidepoolFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool +package app.aaps.plugins.sync.tidepool import android.os.Bundle import android.view.LayoutInflater @@ -11,18 +11,18 @@ import android.widget.ScrollView import androidx.core.view.MenuCompat import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.rx.AapsSchedulers import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.core.main.utils.fabric.FabricPrivacy +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.databinding.TidepoolFragmentBinding +import app.aaps.plugins.sync.tidepool.comm.TidepoolUploader +import app.aaps.plugins.sync.tidepool.events.EventTidepoolDoUpload +import app.aaps.plugins.sync.tidepool.events.EventTidepoolResetData +import app.aaps.plugins.sync.tidepool.events.EventTidepoolUpdateGUI import dagger.android.support.DaggerFragment -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.databinding.TidepoolFragmentBinding -import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolDoUpload -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolResetData -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolUpdateGUI import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/TidepoolPlugin.kt similarity index 91% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/TidepoolPlugin.kt index a6cf2de08c..de99411edb 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/TidepoolPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool +package app.aaps.plugins.sync.tidepool import android.content.Context import android.text.Spanned @@ -24,17 +24,17 @@ import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.T import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.utils.HtmlHelper +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsShared.events.EventConnectivityOptionChanged +import app.aaps.plugins.sync.nsclient.ReceiverDelegate +import app.aaps.plugins.sync.tidepool.comm.TidepoolUploader +import app.aaps.plugins.sync.tidepool.comm.UploadChunk +import app.aaps.plugins.sync.tidepool.events.EventTidepoolDoUpload +import app.aaps.plugins.sync.tidepool.events.EventTidepoolResetData +import app.aaps.plugins.sync.tidepool.events.EventTidepoolStatus +import app.aaps.plugins.sync.tidepool.events.EventTidepoolUpdateGUI +import app.aaps.plugins.sync.tidepool.utils.RateLimit import dagger.android.HasAndroidInjector -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsShared.events.EventConnectivityOptionChanged -import info.nightscout.plugins.sync.nsclient.ReceiverDelegate -import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader -import info.nightscout.plugins.sync.tidepool.comm.UploadChunk -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolDoUpload -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolResetData -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolStatus -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolUpdateGUI -import info.nightscout.plugins.sync.tidepool.utils.RateLimit import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/InfoInterceptor.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/InfoInterceptor.kt similarity index 93% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/InfoInterceptor.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/InfoInterceptor.kt index 0e60756050..9c00d63c6a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/InfoInterceptor.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/InfoInterceptor.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.comm +package app.aaps.plugins.sync.tidepool.comm import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/Session.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/Session.kt similarity index 82% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/Session.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/Session.kt index 1d47adfd78..45c2655b81 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/Session.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/Session.kt @@ -1,7 +1,7 @@ -package info.nightscout.plugins.sync.tidepool.comm +package app.aaps.plugins.sync.tidepool.comm -import info.nightscout.plugins.sync.tidepool.messages.AuthReplyMessage -import info.nightscout.plugins.sync.tidepool.messages.DatasetReplyMessage +import app.aaps.plugins.sync.tidepool.messages.AuthReplyMessage +import app.aaps.plugins.sync.tidepool.messages.DatasetReplyMessage import okhttp3.Headers class Session( diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolApiService.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolApiService.kt similarity index 70% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolApiService.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolApiService.kt index 90c571b008..0dd4ccece7 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolApiService.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolApiService.kt @@ -1,8 +1,8 @@ -package info.nightscout.plugins.sync.tidepool.comm +package app.aaps.plugins.sync.tidepool.comm -import info.nightscout.plugins.sync.tidepool.messages.AuthReplyMessage -import info.nightscout.plugins.sync.tidepool.messages.DatasetReplyMessage -import info.nightscout.plugins.sync.tidepool.messages.UploadReplyMessage +import app.aaps.plugins.sync.tidepool.messages.AuthReplyMessage +import app.aaps.plugins.sync.tidepool.messages.DatasetReplyMessage +import app.aaps.plugins.sync.tidepool.messages.UploadReplyMessage import okhttp3.RequestBody import retrofit2.Call import retrofit2.http.Body @@ -20,9 +20,9 @@ const val SESSION_TOKEN_HEADER: String = "x-tidepool-session-token" interface TidepoolApiService { @Headers( - "User-Agent: AAPS- " + "1.0", - "X-Tidepool-Client-Name: info.nightscout.androidaps", - "X-Tidepool-Client-Version: 0.1.0" + "User-Agent: AAPS- " + "1.0", + "X-Tidepool-Client-Name: info.nightscout.androidaps", + "X-Tidepool-Client-Version: 0.1.0" ) @POST("/auth/login") @@ -35,10 +35,12 @@ interface TidepoolApiService { fun deleteDataSet(@Header(SESSION_TOKEN_HEADER) token: String, @Path("dataSetId") id: String): Call @GET("/v1/users/{userId}/data_sets") - fun getOpenDataSets(@Header(SESSION_TOKEN_HEADER) token: String, - @Path("userId") id: String, - @Query("client.name") clientName: String, - @Query("size") size: Int): Call> + fun getOpenDataSets( + @Header(SESSION_TOKEN_HEADER) token: String, + @Path("userId") id: String, + @Query("client.name") clientName: String, + @Query("size") size: Int + ): Call> @GET("/v1/datasets/{dataSetId}") fun getDataSet(@Header(SESSION_TOKEN_HEADER) token: String, @Path("dataSetId") id: String): Call diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolCallback.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolCallback.kt similarity index 91% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolCallback.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolCallback.kt index 9e81f73bd6..148dac6955 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolCallback.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolCallback.kt @@ -1,9 +1,9 @@ -package info.nightscout.plugins.sync.tidepool.comm +package app.aaps.plugins.sync.tidepool.comm import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.rx.bus.RxBus -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolStatus +import app.aaps.plugins.sync.tidepool.events.EventTidepoolStatus import retrofit2.Call import retrofit2.Callback import retrofit2.Response diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolUploader.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolUploader.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolUploader.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolUploader.kt index 6977beb937..295a0ad183 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolUploader.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/TidepoolUploader.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.comm +package app.aaps.plugins.sync.tidepool.comm import android.content.Context import android.os.PowerManager @@ -12,14 +12,14 @@ 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.ui.dialogs.OKDialog -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsclient.ReceiverDelegate -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolStatus -import info.nightscout.plugins.sync.tidepool.messages.AuthReplyMessage -import info.nightscout.plugins.sync.tidepool.messages.AuthRequestMessage -import info.nightscout.plugins.sync.tidepool.messages.DatasetReplyMessage -import info.nightscout.plugins.sync.tidepool.messages.OpenDatasetRequestMessage -import info.nightscout.plugins.sync.tidepool.messages.UploadReplyMessage +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsclient.ReceiverDelegate +import app.aaps.plugins.sync.tidepool.events.EventTidepoolStatus +import app.aaps.plugins.sync.tidepool.messages.AuthReplyMessage +import app.aaps.plugins.sync.tidepool.messages.AuthRequestMessage +import app.aaps.plugins.sync.tidepool.messages.DatasetReplyMessage +import app.aaps.plugins.sync.tidepool.messages.OpenDatasetRequestMessage +import app.aaps.plugins.sync.tidepool.messages.UploadReplyMessage import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.OkHttpClient import okhttp3.RequestBody.Companion.toRequestBody diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/UploadChunk.kt similarity index 90% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/UploadChunk.kt index 243db6e182..065a53f192 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/comm/UploadChunk.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.comm +package app.aaps.plugins.sync.tidepool.comm import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag @@ -11,17 +11,17 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.database.entities.EffectiveProfileSwitch import app.aaps.database.entities.TemporaryBasal +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.tidepool.elements.BasalElement +import app.aaps.plugins.sync.tidepool.elements.BaseElement +import app.aaps.plugins.sync.tidepool.elements.BloodGlucoseElement +import app.aaps.plugins.sync.tidepool.elements.BolusElement +import app.aaps.plugins.sync.tidepool.elements.ProfileElement +import app.aaps.plugins.sync.tidepool.elements.SensorGlucoseElement +import app.aaps.plugins.sync.tidepool.elements.WizardElement +import app.aaps.plugins.sync.tidepool.events.EventTidepoolStatus +import app.aaps.plugins.sync.tidepool.utils.GsonInstance import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.tidepool.elements.BasalElement -import info.nightscout.plugins.sync.tidepool.elements.BaseElement -import info.nightscout.plugins.sync.tidepool.elements.BloodGlucoseElement -import info.nightscout.plugins.sync.tidepool.elements.BolusElement -import info.nightscout.plugins.sync.tidepool.elements.ProfileElement -import info.nightscout.plugins.sync.tidepool.elements.SensorGlucoseElement -import info.nightscout.plugins.sync.tidepool.elements.WizardElement -import info.nightscout.plugins.sync.tidepool.events.EventTidepoolStatus -import info.nightscout.plugins.sync.tidepool.utils.GsonInstance import java.util.LinkedList import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BasalElement.kt similarity index 94% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BasalElement.kt index 50738eec2c..49e6a0e113 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BasalElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.elements +package app.aaps.plugins.sync.tidepool.elements import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.utils.DateUtil diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BaseElement.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BaseElement.kt similarity index 92% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BaseElement.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BaseElement.kt index 1c98f59b56..9dc31d8d25 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BaseElement.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BaseElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.elements +package app.aaps.plugins.sync.tidepool.elements import app.aaps.core.interfaces.utils.DateUtil import com.google.gson.annotations.Expose diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BloodGlucoseElement.kt similarity index 92% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BloodGlucoseElement.kt index 3069c5da98..8cf9838ae9 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BloodGlucoseElement.kt @@ -1,10 +1,10 @@ -package info.nightscout.plugins.sync.tidepool.elements +package app.aaps.plugins.sync.tidepool.elements import app.aaps.core.interfaces.profile.ProfileUtil import app.aaps.core.interfaces.utils.DateUtil import app.aaps.database.entities.TherapyEvent +import app.aaps.plugins.sync.nsclient.extensions.toMainUnit import com.google.gson.annotations.Expose -import info.nightscout.plugins.sync.nsclient.extensions.toMainUnit import java.util.LinkedList import java.util.UUID diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BolusElement.kt similarity index 91% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BolusElement.kt index 6d142c457d..8f201ad634 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/BolusElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.elements +package app.aaps.plugins.sync.tidepool.elements import app.aaps.core.interfaces.utils.DateUtil import app.aaps.database.entities.Bolus diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/ProfileElement.kt similarity index 97% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/ProfileElement.kt index c46b3513a5..db7171f2da 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/ProfileElement.kt @@ -1,12 +1,12 @@ -package info.nightscout.plugins.sync.tidepool.elements +package app.aaps.plugins.sync.tidepool.elements import app.aaps.core.interfaces.profile.Profile import app.aaps.core.interfaces.profile.ProfileUtil import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.main.profile.ProfileSealed import app.aaps.database.entities.EffectiveProfileSwitch +import app.aaps.plugins.sync.tidepool.comm.TidepoolUploader import com.google.gson.annotations.Expose -import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader import java.util.UUID class ProfileElement(ps: EffectiveProfileSwitch, serialNumber: String, dateUtil: DateUtil, profileUtil: ProfileUtil) : diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/SensorGlucoseElement.kt similarity index 94% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/SensorGlucoseElement.kt index 5fb5270eac..27286219aa 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/SensorGlucoseElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.elements +package app.aaps.plugins.sync.tidepool.elements import app.aaps.core.interfaces.utils.DateUtil import app.aaps.database.entities.GlucoseValue diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/WizardElement.kt similarity index 97% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/WizardElement.kt index 1e91e9d70c..ff2cb960cf 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/elements/WizardElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.elements +package app.aaps.plugins.sync.tidepool.elements import app.aaps.core.interfaces.utils.DateUtil import app.aaps.database.entities.Bolus diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt similarity index 62% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt index 787a7086f5..4968827cf0 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.events +package app.aaps.plugins.sync.tidepool.events import app.aaps.core.interfaces.rx.events.Event diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolResetData.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolResetData.kt similarity index 62% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolResetData.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolResetData.kt index 49dd9a9332..4e3b89c2fe 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolResetData.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolResetData.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.events +package app.aaps.plugins.sync.tidepool.events import app.aaps.core.interfaces.rx.events.Event diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolStatus.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolStatus.kt similarity index 92% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolStatus.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolStatus.kt index 4a91deb00a..672c010469 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolStatus.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolStatus.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.events +package app.aaps.plugins.sync.tidepool.events import app.aaps.core.interfaces.rx.events.Event import java.text.SimpleDateFormat diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt similarity index 62% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt index 9fbaf02f5e..95ea5a1076 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.events +package app.aaps.plugins.sync.tidepool.events import app.aaps.core.interfaces.rx.events.Event diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthReplyMessage.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/AuthReplyMessage.kt similarity index 91% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthReplyMessage.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/AuthReplyMessage.kt index 8713d91339..1115f67c0b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthReplyMessage.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/AuthReplyMessage.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.messages +package app.aaps.plugins.sync.tidepool.messages import com.google.gson.annotations.Expose import com.google.gson.annotations.SerializedName @@ -8,15 +8,19 @@ class AuthReplyMessage { @Expose @SerializedName("emailVerified") internal var emailVerified: Boolean? = null + @Expose @SerializedName("emails") internal var emailList: List? = null + @Expose @SerializedName("termsAccepted") internal var termsDate: String? = null + @Expose @SerializedName("userid") internal var userid: String? = null + @Expose @SerializedName("username") internal var username: String? = null diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthRequestMessage.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/AuthRequestMessage.kt similarity index 84% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthRequestMessage.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/AuthRequestMessage.kt index 4d9d3f8582..52ca2ddc96 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthRequestMessage.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/AuthRequestMessage.kt @@ -1,7 +1,7 @@ -package info.nightscout.plugins.sync.tidepool.messages +package app.aaps.plugins.sync.tidepool.messages import app.aaps.core.interfaces.sharedPreferences.SP -import info.nightscout.plugins.sync.R +import app.aaps.plugins.sync.R import okhttp3.Credentials object AuthRequestMessage : BaseMessage() { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/BaseMessage.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/BaseMessage.kt similarity index 76% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/BaseMessage.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/BaseMessage.kt index 2c1df65ba5..4961ee0617 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/BaseMessage.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/BaseMessage.kt @@ -1,11 +1,12 @@ -package info.nightscout.plugins.sync.tidepool.messages +package app.aaps.plugins.sync.tidepool.messages -import info.nightscout.plugins.sync.tidepool.utils.GsonInstance +import app.aaps.plugins.sync.tidepool.utils.GsonInstance import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.RequestBody import okhttp3.RequestBody.Companion.toRequestBody open class BaseMessage { + private fun toS(): String { return GsonInstance.defaultGsonInstance().toJson(this) ?: "null" } diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt similarity index 72% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt index 586f96c438..fc473e8c42 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt @@ -1,8 +1,9 @@ -package info.nightscout.plugins.sync.tidepool.messages +package app.aaps.plugins.sync.tidepool.messages import com.google.gson.annotations.Expose class CloseDatasetRequestMessage : BaseMessage() { + @Expose internal var dataState = "closed" } \ No newline at end of file diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/DatasetReplyMessage.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/DatasetReplyMessage.kt similarity index 95% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/DatasetReplyMessage.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/DatasetReplyMessage.kt index 7eed75c13a..32c4ce084f 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/DatasetReplyMessage.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/DatasetReplyMessage.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.messages +package app.aaps.plugins.sync.tidepool.messages class DatasetReplyMessage { @@ -9,6 +9,7 @@ class DatasetReplyMessage { internal var uploadId: String? = null inner class Data { + internal var createdTime: String? = null internal var deviceId: String? = null internal var id: String? = null @@ -30,6 +31,7 @@ class DatasetReplyMessage { } inner class Client { + internal var name: String? = null internal var version: String? = null diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt similarity index 92% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt index 50255719fd..eb0a28f1b7 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt @@ -1,10 +1,10 @@ -package info.nightscout.plugins.sync.tidepool.messages +package app.aaps.plugins.sync.tidepool.messages import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T +import app.aaps.plugins.sync.tidepool.comm.TidepoolUploader import com.google.gson.annotations.Expose -import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader import java.util.TimeZone class OpenDatasetRequestMessage(config: Config, dateUtil: DateUtil) : BaseMessage() { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/UploadReplyMessage.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/UploadReplyMessage.kt similarity index 57% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/UploadReplyMessage.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/UploadReplyMessage.kt index ac40f05e5a..23dda40281 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/UploadReplyMessage.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/messages/UploadReplyMessage.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.messages +package app.aaps.plugins.sync.tidepool.messages class UploadReplyMessage { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/utils/GsonInstance.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/utils/GsonInstance.kt similarity index 68% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/utils/GsonInstance.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/utils/GsonInstance.kt index 0801ece9dc..b9b3c7963f 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/utils/GsonInstance.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/utils/GsonInstance.kt @@ -1,16 +1,17 @@ -package info.nightscout.plugins.sync.tidepool.utils +package app.aaps.plugins.sync.tidepool.utils import com.google.gson.Gson import com.google.gson.GsonBuilder object GsonInstance { + private var gson_instance: Gson? = null fun defaultGsonInstance(): Gson { if (gson_instance == null) { gson_instance = GsonBuilder() - .excludeFieldsWithoutExposeAnnotation() - .create() + .excludeFieldsWithoutExposeAnnotation() + .create() } return gson_instance as Gson } diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/utils/RateLimit.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/utils/RateLimit.kt similarity index 94% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/utils/RateLimit.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/utils/RateLimit.kt index 12e6a27109..9fa6bebe8c 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/utils/RateLimit.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/tidepool/utils/RateLimit.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.tidepool.utils +package app.aaps.plugins.sync.tidepool.utils import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.utils.DateUtil diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/DataSyncSelectorXdripImpl.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/DataSyncSelectorXdripImpl.kt similarity index 99% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/DataSyncSelectorXdripImpl.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/DataSyncSelectorXdripImpl.kt index 8beeb3c5f0..460bc37e70 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/DataSyncSelectorXdripImpl.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/DataSyncSelectorXdripImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.xdrip +package app.aaps.plugins.sync.xdrip import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag @@ -11,9 +11,9 @@ import app.aaps.core.interfaces.sync.XDripBroadcast import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.T import app.aaps.core.utils.JsonHelper +import app.aaps.plugins.sync.R import dagger.Lazy import info.nightscout.database.impl.AppRepository -import info.nightscout.plugins.sync.R import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripFragment.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/XdripFragment.kt similarity index 94% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripFragment.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/XdripFragment.kt index 983c292d33..eb64020c88 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripFragment.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/XdripFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.xdrip +package app.aaps.plugins.sync.xdrip import android.os.Bundle import android.os.Handler @@ -12,7 +12,6 @@ import android.view.ViewGroup import androidx.core.view.MenuCompat import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle -import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.plugin.PluginBase @@ -21,11 +20,12 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.rx.AapsSchedulers import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.sharedPreferences.SP -import dagger.android.support.DaggerFragment +import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.dialogs.OKDialog -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.databinding.XdripFragmentBinding -import info.nightscout.plugins.sync.xdrip.events.EventXdripUpdateGUI +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.databinding.XdripFragmentBinding +import app.aaps.plugins.sync.xdrip.events.EventXdripUpdateGUI +import dagger.android.support.DaggerFragment import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripPlugin.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/XdripPlugin.kt similarity index 98% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripPlugin.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/XdripPlugin.kt index 2a72999611..8a572c6af5 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripPlugin.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/XdripPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.xdrip +package app.aaps.plugins.sync.xdrip import android.content.Context import android.content.Intent @@ -45,13 +45,13 @@ import app.aaps.core.main.iob.round import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.toast.ToastUtils import app.aaps.core.utils.HtmlHelper +import app.aaps.plugins.sync.R +import app.aaps.plugins.sync.nsclient.extensions.toJson +import app.aaps.plugins.sync.xdrip.events.EventXdripUpdateGUI +import app.aaps.plugins.sync.xdrip.extensions.toXdripJson +import app.aaps.plugins.sync.xdrip.workers.XdripDataSyncWorker import app.aaps.shared.impl.extensions.safeQueryBroadcastReceivers import dagger.android.HasAndroidInjector -import info.nightscout.plugins.sync.R -import info.nightscout.plugins.sync.nsclient.extensions.toJson -import info.nightscout.plugins.sync.xdrip.events.EventXdripUpdateGUI -import info.nightscout.plugins.sync.xdrip.extensions.toXdripJson -import info.nightscout.plugins.sync.xdrip.workers.XdripDataSyncWorker import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import kotlinx.coroutines.CoroutineScope diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/events/EventXdripUpdateGUI.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/events/EventXdripUpdateGUI.kt similarity index 67% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/events/EventXdripUpdateGUI.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/events/EventXdripUpdateGUI.kt index e7303788ea..e78e973133 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/events/EventXdripUpdateGUI.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/events/EventXdripUpdateGUI.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.xdrip.events +package app.aaps.plugins.sync.xdrip.events import app.aaps.core.interfaces.rx.events.EventUpdateGui diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/extensions/GlucoseValueExtension.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/extensions/GlucoseValueExtension.kt similarity index 85% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/extensions/GlucoseValueExtension.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/extensions/GlucoseValueExtension.kt index 5ddd00be89..0ad8e31f38 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/extensions/GlucoseValueExtension.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/extensions/GlucoseValueExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.plugins.sync.xdrip.extensions +package app.aaps.plugins.sync.xdrip.extensions import app.aaps.database.entities.GlucoseValue import org.json.JSONObject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/workers/XdripDataSyncWorker.kt b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/workers/XdripDataSyncWorker.kt similarity index 83% rename from plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/workers/XdripDataSyncWorker.kt rename to plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/workers/XdripDataSyncWorker.kt index 0dbbfcf991..b4e566fa0e 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/workers/XdripDataSyncWorker.kt +++ b/plugins/sync/src/main/kotlin/app/aaps/plugins/sync/xdrip/workers/XdripDataSyncWorker.kt @@ -1,14 +1,14 @@ -package info.nightscout.plugins.sync.xdrip.workers +package app.aaps.plugins.sync.xdrip.workers import android.content.Context import androidx.work.WorkerParameters import app.aaps.annotations.OpenForTesting -import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventXdripNewLog -import info.nightscout.plugins.sync.xdrip.DataSyncSelectorXdripImpl -import info.nightscout.plugins.sync.xdrip.events.EventXdripUpdateGUI +import app.aaps.core.main.utils.worker.LoggingWorker +import app.aaps.plugins.sync.xdrip.DataSyncSelectorXdripImpl +import app.aaps.plugins.sync.xdrip.events.EventXdripUpdateGUI import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/res/layout/ns_client_fragment.xml b/plugins/sync/src/main/res/layout/ns_client_fragment.xml index 9720ddd1eb..6bea262f08 100644 --- a/plugins/sync/src/main/res/layout/ns_client_fragment.xml +++ b/plugins/sync/src/main/res/layout/ns_client_fragment.xml @@ -3,7 +3,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - tools:context="info.nightscout.plugins.sync.nsShared.NSClientFragment"> + tools:context=".nsShared.NSClientFragment"> + android:orientation="vertical" + tools:context=".tidepool.TidepoolFragment"> + tools:context=".xdrip.XdripFragment"> Date: Tue, 26 Sep 2023 17:20:32 +0200 Subject: [PATCH 16/17] :ui cleanup --- app/src/main/AndroidManifest.xml | 4 -- app/src/main/kotlin/app/aaps/MainActivity.kt | 8 +-- app/src/main/kotlin/app/aaps/MainApp.kt | 4 +- .../main/kotlin/app/aaps/di/AppComponent.kt | 2 +- .../aaps/implementations/UiInteractionImpl.kt | 42 +++++------ ui/build.gradle | 2 +- ui/src/main/AndroidManifest.xml | 11 ++- .../activities/BolusProgressHelperActivity.kt | 4 +- .../ui/activities/ErrorHelperActivity.kt | 6 +- .../ui/activities/ProfileHelperActivity.kt | 12 ++-- .../ui/activities/QuickWizardListActivity.kt | 12 ++-- .../app/aaps}/ui/activities/StatsActivity.kt | 8 +-- .../app/aaps}/ui/activities/SurveyActivity.kt | 8 +-- .../aaps}/ui/activities/TDDStatsActivity.kt | 4 +- .../aaps}/ui/activities/TreatmentsActivity.kt | 20 +++--- .../fragments/TreatmentsBolusCarbsFragment.kt | 12 ++-- .../fragments/TreatmentsCareportalFragment.kt | 10 +-- .../TreatmentsExtendedBolusesFragment.kt | 10 +-- .../TreatmentsProfileSwitchFragment.kt | 12 ++-- .../fragments/TreatmentsTempTargetFragment.kt | 10 +-- .../TreatmentsTemporaryBasalsFragment.kt | 10 +-- .../fragments/TreatmentsUserEntryFragment.kt | 8 +-- .../ui/activityMonitor/ActivityMonitor.kt | 4 +- .../app/aaps}/ui/alertDialogs/ErrorDialog.kt | 4 +- .../aaps}/ui/defaultProfile/DefaultProfile.kt | 2 +- .../ui/defaultProfile/DefaultProfileDPV.kt | 2 +- .../app/aaps}/ui/di/UiModule.kt | 72 +++++++++---------- .../aaps}/ui/dialogs/BolusProgressDialog.kt | 4 +- .../app/aaps}/ui/dialogs/CalibrationDialog.kt | 4 +- .../app/aaps}/ui/dialogs/CarbsDialog.kt | 6 +- .../app/aaps}/ui/dialogs/CareDialog.kt | 6 +- .../ui/dialogs/DialogFragmentWithDate.kt | 2 +- .../aaps}/ui/dialogs/EditQuickWizardDialog.kt | 8 +-- .../aaps}/ui/dialogs/ExtendedBolusDialog.kt | 6 +- .../app/aaps}/ui/dialogs/FillDialog.kt | 6 +- .../app/aaps}/ui/dialogs/InsulinDialog.kt | 8 +-- .../app/aaps}/ui/dialogs/LoopDialog.kt | 6 +- .../aaps}/ui/dialogs/ProfileSwitchDialog.kt | 6 +- .../aaps}/ui/dialogs/ProfileViewerDialog.kt | 4 +- .../app/aaps}/ui/dialogs/TempBasalDialog.kt | 6 +- .../app/aaps}/ui/dialogs/TempTargetDialog.kt | 6 +- .../app/aaps}/ui/dialogs/TreatmentDialog.kt | 6 +- .../app/aaps}/ui/dialogs/WizardDialog.kt | 6 +- .../app/aaps}/ui/dialogs/WizardInfoDialog.kt | 6 +- .../aaps}/ui/elements/EmptyRecyclerView.kt | 2 +- .../aaps}/ui/events/EventQuickWizardChange.kt | 2 +- .../ui/extensions/DoubleToSignedString.kt | 2 +- .../ui/extensions/InterfaceIDsExtension.kt | 2 +- .../aaps}/ui/services/AlarmSoundService.kt | 2 +- .../ui/services/AlarmSoundServiceHelper.kt | 2 +- .../app/aaps}/ui/tabs/TabPageAdapter.kt | 2 +- .../app/aaps}/ui/widget/Widget.kt | 4 +- .../ui/widget/WidgetConfigureActivity.kt | 4 +- .../res/layout/activity_profilehelper.xml | 2 +- .../res/layout/activity_quickwizard_list.xml | 2 +- ui/src/main/res/layout/activity_stats.xml | 2 +- ui/src/main/res/layout/activity_tdd_stats.xml | 2 +- ui/src/main/res/layout/dialog_carbs.xml | 2 +- .../res/layout/dialog_edit_quickwizard.xml | 2 +- ui/src/main/res/layout/dialog_wizard.xml | 2 +- .../treatments_bolus_carbs_fragment.xml | 2 +- .../layout/treatments_careportal_fragment.xml | 2 +- .../treatments_extendedbolus_fragment.xml | 2 +- .../treatments_profileswitch_fragment.xml | 2 +- .../layout/treatments_tempbasals_fragment.xml | 2 +- .../layout/treatments_temptarget_fragment.xml | 2 +- .../layout/treatments_user_entry_fragment.xml | 2 +- ui/src/main/res/xml/widget_info.xml | 2 +- .../ui/defaultProfile/DefaultProfileTest.kt | 2 +- .../extensions/InterfaceIDsExtensionKtTest.kt | 2 +- 70 files changed, 228 insertions(+), 227 deletions(-) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/activities/BolusProgressHelperActivity.kt (84%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/activities/ErrorHelperActivity.kt (90%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/activities/ProfileHelperActivity.kt (98%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/activities/QuickWizardListActivity.kt (96%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/activities/StatsActivity.kt (96%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/activities/SurveyActivity.kt (96%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/activities/TDDStatsActivity.kt (99%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/activities/TreatmentsActivity.kt (80%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt (98%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/activities/fragments/TreatmentsCareportalFragment.kt (97%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt (97%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt (97%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/activities/fragments/TreatmentsTempTargetFragment.kt (97%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt (97%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/activities/fragments/TreatmentsUserEntryFragment.kt (97%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/activityMonitor/ActivityMonitor.kt (98%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/alertDialogs/ErrorDialog.kt (97%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/defaultProfile/DefaultProfile.kt (99%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/defaultProfile/DefaultProfileDPV.kt (98%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/di/UiModule.kt (63%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/dialogs/BolusProgressDialog.kt (98%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/dialogs/CalibrationDialog.kt (97%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/dialogs/CarbsDialog.kt (99%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/dialogs/CareDialog.kt (99%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/dialogs/DialogFragmentWithDate.kt (99%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/dialogs/EditQuickWizardDialog.kt (97%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/dialogs/ExtendedBolusDialog.kt (97%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/dialogs/FillDialog.kt (99%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/dialogs/InsulinDialog.kt (98%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/dialogs/LoopDialog.kt (99%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/dialogs/ProfileSwitchDialog.kt (99%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/dialogs/ProfileViewerDialog.kt (99%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/dialogs/TempBasalDialog.kt (98%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/dialogs/TempTargetDialog.kt (99%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/dialogs/TreatmentDialog.kt (98%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/dialogs/WizardDialog.kt (99%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/dialogs/WizardInfoDialog.kt (97%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/elements/EmptyRecyclerView.kt (98%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/events/EventQuickWizardChange.kt (72%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/extensions/DoubleToSignedString.kt (89%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/extensions/InterfaceIDsExtension.kt (77%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/services/AlarmSoundService.kt (99%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/services/AlarmSoundServiceHelper.kt (98%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/tabs/TabPageAdapter.kt (97%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/widget/Widget.kt (99%) rename ui/src/main/{java/info/nightscout => kotlin/app/aaps}/ui/widget/WidgetConfigureActivity.kt (96%) rename ui/src/test/{java/info/nightscout => kotlin/app/aaps}/ui/defaultProfile/DefaultProfileTest.kt (97%) rename ui/src/test/{java/info/nightscout => kotlin/app/aaps}/ui/extensions/InterfaceIDsExtensionKtTest.kt (94%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 2ce0ccee01..6baa3a5a34 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -134,10 +134,6 @@ android:resource="@xml/filepaths" /> - diff --git a/app/src/main/kotlin/app/aaps/MainActivity.kt b/app/src/main/kotlin/app/aaps/MainActivity.kt index 7b68857b63..fcb1e69c17 100644 --- a/app/src/main/kotlin/app/aaps/MainActivity.kt +++ b/app/src/main/kotlin/app/aaps/MainActivity.kt @@ -71,10 +71,10 @@ import com.joanzapata.iconify.fonts.FontAwesomeModule import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.ActivityMainBinding -import info.nightscout.ui.activities.ProfileHelperActivity -import info.nightscout.ui.activities.StatsActivity -import info.nightscout.ui.activities.TreatmentsActivity -import info.nightscout.ui.tabs.TabPageAdapter +import app.aaps.ui.activities.ProfileHelperActivity +import app.aaps.ui.activities.StatsActivity +import app.aaps.ui.activities.TreatmentsActivity +import app.aaps.ui.tabs.TabPageAdapter import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.io.File diff --git a/app/src/main/kotlin/app/aaps/MainApp.kt b/app/src/main/kotlin/app/aaps/MainApp.kt index 997ad70478..3621ae4c12 100644 --- a/app/src/main/kotlin/app/aaps/MainApp.kt +++ b/app/src/main/kotlin/app/aaps/MainApp.kt @@ -49,8 +49,8 @@ import info.nightscout.androidaps.R import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.database.impl.transactions.VersionChangeTransaction -import info.nightscout.ui.activityMonitor.ActivityMonitor -import info.nightscout.ui.widget.Widget +import app.aaps.ui.activityMonitor.ActivityMonitor +import app.aaps.ui.widget.Widget import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.exceptions.UndeliverableException import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/app/src/main/kotlin/app/aaps/di/AppComponent.kt b/app/src/main/kotlin/app/aaps/di/AppComponent.kt index 1768733100..703601777d 100644 --- a/app/src/main/kotlin/app/aaps/di/AppComponent.kt +++ b/app/src/main/kotlin/app/aaps/di/AppComponent.kt @@ -36,7 +36,7 @@ import info.nightscout.pump.danars.di.DanaRSModule import info.nightscout.pump.diaconn.di.DiaconnG8Module import info.nightscout.pump.medtrum.di.MedtrumModule import info.nightscout.pump.virtual.di.VirtualPumpModule -import info.nightscout.ui.di.UiModule +import app.aaps.ui.di.UiModule import info.nightscout.workflow.di.WorkflowModule import javax.inject.Singleton diff --git a/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt b/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt index 2218d96113..b7d41ceda3 100644 --- a/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt +++ b/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt @@ -20,27 +20,27 @@ import app.aaps.plugins.configuration.activities.SingleFragmentActivity import app.aaps.plugins.main.general.overview.notifications.NotificationWithAction import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.ui.activities.BolusProgressHelperActivity -import info.nightscout.ui.activities.ErrorHelperActivity -import info.nightscout.ui.activities.QuickWizardListActivity -import info.nightscout.ui.activities.TDDStatsActivity -import info.nightscout.ui.dialogs.BolusProgressDialog -import info.nightscout.ui.dialogs.CalibrationDialog -import info.nightscout.ui.dialogs.CarbsDialog -import info.nightscout.ui.dialogs.CareDialog -import info.nightscout.ui.dialogs.ExtendedBolusDialog -import info.nightscout.ui.dialogs.FillDialog -import info.nightscout.ui.dialogs.InsulinDialog -import info.nightscout.ui.dialogs.LoopDialog -import info.nightscout.ui.dialogs.ProfileSwitchDialog -import info.nightscout.ui.dialogs.ProfileViewerDialog -import info.nightscout.ui.dialogs.TempBasalDialog -import info.nightscout.ui.dialogs.TempTargetDialog -import info.nightscout.ui.dialogs.TreatmentDialog -import info.nightscout.ui.dialogs.WizardDialog -import info.nightscout.ui.services.AlarmSoundService -import info.nightscout.ui.services.AlarmSoundServiceHelper -import info.nightscout.ui.widget.Widget +import app.aaps.ui.activities.BolusProgressHelperActivity +import app.aaps.ui.activities.ErrorHelperActivity +import app.aaps.ui.activities.QuickWizardListActivity +import app.aaps.ui.activities.TDDStatsActivity +import app.aaps.ui.dialogs.BolusProgressDialog +import app.aaps.ui.dialogs.CalibrationDialog +import app.aaps.ui.dialogs.CarbsDialog +import app.aaps.ui.dialogs.CareDialog +import app.aaps.ui.dialogs.ExtendedBolusDialog +import app.aaps.ui.dialogs.FillDialog +import app.aaps.ui.dialogs.InsulinDialog +import app.aaps.ui.dialogs.LoopDialog +import app.aaps.ui.dialogs.ProfileSwitchDialog +import app.aaps.ui.dialogs.ProfileViewerDialog +import app.aaps.ui.dialogs.TempBasalDialog +import app.aaps.ui.dialogs.TempTargetDialog +import app.aaps.ui.dialogs.TreatmentDialog +import app.aaps.ui.dialogs.WizardDialog +import app.aaps.ui.services.AlarmSoundService +import app.aaps.ui.services.AlarmSoundServiceHelper +import app.aaps.ui.widget.Widget import javax.inject.Inject class UiInteractionImpl @Inject constructor( diff --git a/ui/build.gradle b/ui/build.gradle index 4e92419efc..c75e9364c1 100644 --- a/ui/build.gradle +++ b/ui/build.gradle @@ -11,7 +11,7 @@ apply from: "${project.rootDir}/core/main/test_dependencies.gradle" apply from: "${project.rootDir}/core/main/jacoco_global.gradle" android { - namespace 'info.nightscout.ui' + namespace 'app.aaps.ui' } dependencies { diff --git a/ui/src/main/AndroidManifest.xml b/ui/src/main/AndroidManifest.xml index 76fe1b6ba9..3b6e32a84e 100644 --- a/ui/src/main/AndroidManifest.xml +++ b/ui/src/main/AndroidManifest.xml @@ -29,7 +29,7 @@ android:exported="false" android:theme="@style/AppTheme" /> - + + + \ No newline at end of file diff --git a/ui/src/main/java/info/nightscout/ui/activities/BolusProgressHelperActivity.kt b/ui/src/main/kotlin/app/aaps/ui/activities/BolusProgressHelperActivity.kt similarity index 84% rename from ui/src/main/java/info/nightscout/ui/activities/BolusProgressHelperActivity.kt rename to ui/src/main/kotlin/app/aaps/ui/activities/BolusProgressHelperActivity.kt index 4713d4d5e7..3efe8a01ed 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/BolusProgressHelperActivity.kt +++ b/ui/src/main/kotlin/app/aaps/ui/activities/BolusProgressHelperActivity.kt @@ -1,8 +1,8 @@ -package info.nightscout.ui.activities +package app.aaps.ui.activities import android.os.Bundle import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.ui.dialogs.BolusProgressDialog +import app.aaps.ui.dialogs.BolusProgressDialog class BolusProgressHelperActivity : TranslatedDaggerAppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { diff --git a/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt b/ui/src/main/kotlin/app/aaps/ui/activities/ErrorHelperActivity.kt similarity index 90% rename from ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt rename to ui/src/main/kotlin/app/aaps/ui/activities/ErrorHelperActivity.kt index a27156395a..0e64b71213 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt +++ b/ui/src/main/kotlin/app/aaps/ui/activities/ErrorHelperActivity.kt @@ -1,12 +1,12 @@ -package info.nightscout.ui.activities +package app.aaps.ui.activities import android.os.Bundle import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction -import info.nightscout.ui.alertDialogs.ErrorDialog -import info.nightscout.ui.services.AlarmSoundService +import app.aaps.ui.alertDialogs.ErrorDialog +import app.aaps.ui.services.AlarmSoundService import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt b/ui/src/main/kotlin/app/aaps/ui/activities/ProfileHelperActivity.kt similarity index 98% rename from ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt rename to ui/src/main/kotlin/app/aaps/ui/activities/ProfileHelperActivity.kt index e9d9ce8e0a..2e7915ab12 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt +++ b/ui/src/main/kotlin/app/aaps/ui/activities/ProfileHelperActivity.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.activities +package app.aaps.ui.activities import android.annotation.SuppressLint import android.os.Bundle @@ -27,11 +27,11 @@ import app.aaps.database.entities.EffectiveProfileSwitch import com.google.android.material.tabs.TabLayout import com.google.common.collect.Lists import info.nightscout.database.impl.AppRepository -import info.nightscout.ui.R -import info.nightscout.ui.databinding.ActivityProfilehelperBinding -import info.nightscout.ui.defaultProfile.DefaultProfile -import info.nightscout.ui.defaultProfile.DefaultProfileDPV -import info.nightscout.ui.dialogs.ProfileViewerDialog +import app.aaps.ui.R +import app.aaps.ui.databinding.ActivityProfilehelperBinding +import app.aaps.ui.defaultProfile.DefaultProfile +import app.aaps.ui.defaultProfile.DefaultProfileDPV +import app.aaps.ui.dialogs.ProfileViewerDialog import io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/ui/src/main/java/info/nightscout/ui/activities/QuickWizardListActivity.kt b/ui/src/main/kotlin/app/aaps/ui/activities/QuickWizardListActivity.kt similarity index 96% rename from ui/src/main/java/info/nightscout/ui/activities/QuickWizardListActivity.kt rename to ui/src/main/kotlin/app/aaps/ui/activities/QuickWizardListActivity.kt index 58a81a105d..2f3975914a 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/QuickWizardListActivity.kt +++ b/ui/src/main/kotlin/app/aaps/ui/activities/QuickWizardListActivity.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.activities +package app.aaps.ui.activities import android.annotation.SuppressLint import android.os.Bundle @@ -31,11 +31,11 @@ import app.aaps.core.ui.dialogs.OKDialog import app.aaps.core.ui.dragHelpers.ItemTouchHelperAdapter import app.aaps.core.ui.dragHelpers.OnStartDragListener import app.aaps.core.ui.dragHelpers.SimpleItemTouchHelperCallback -import info.nightscout.ui.R -import info.nightscout.ui.databinding.ActivityQuickwizardListBinding -import info.nightscout.ui.databinding.QuickwizardListItemBinding -import info.nightscout.ui.dialogs.EditQuickWizardDialog -import info.nightscout.ui.events.EventQuickWizardChange +import app.aaps.ui.R +import app.aaps.ui.databinding.ActivityQuickwizardListBinding +import app.aaps.ui.databinding.QuickwizardListItemBinding +import app.aaps.ui.dialogs.EditQuickWizardDialog +import app.aaps.ui.events.EventQuickWizardChange import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt b/ui/src/main/kotlin/app/aaps/ui/activities/StatsActivity.kt similarity index 96% rename from ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt rename to ui/src/main/kotlin/app/aaps/ui/activities/StatsActivity.kt index b31f9e11e3..d13b904b33 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt +++ b/ui/src/main/kotlin/app/aaps/ui/activities/StatsActivity.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.activities +package app.aaps.ui.activities import android.annotation.SuppressLint import android.os.Bundle @@ -17,9 +17,9 @@ import app.aaps.core.ui.dialogs.OKDialog import app.aaps.database.entities.UserEntry.Action import app.aaps.database.entities.UserEntry.Sources import info.nightscout.database.impl.AppRepository -import info.nightscout.ui.R -import info.nightscout.ui.activityMonitor.ActivityMonitor -import info.nightscout.ui.databinding.ActivityStatsBinding +import app.aaps.ui.R +import app.aaps.ui.activityMonitor.ActivityMonitor +import app.aaps.ui.databinding.ActivityStatsBinding import io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt b/ui/src/main/kotlin/app/aaps/ui/activities/SurveyActivity.kt similarity index 96% rename from ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt rename to ui/src/main/kotlin/app/aaps/ui/activities/SurveyActivity.kt index 88b81219b0..cf3d13277d 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt +++ b/ui/src/main/kotlin/app/aaps/ui/activities/SurveyActivity.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.activities +package app.aaps.ui.activities import android.os.Bundle import android.widget.ArrayAdapter @@ -10,9 +10,9 @@ import app.aaps.core.interfaces.utils.SafeParse import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity import app.aaps.core.ui.toast.ToastUtils import app.aaps.core.utils.fabric.InstanceId -import info.nightscout.ui.R -import info.nightscout.ui.databinding.ActivitySurveyBinding -import info.nightscout.ui.defaultProfile.DefaultProfile +import app.aaps.ui.R +import app.aaps.ui.databinding.ActivitySurveyBinding +import app.aaps.ui.defaultProfile.DefaultProfile import javax.inject.Inject class SurveyActivity : TranslatedDaggerAppCompatActivity() { diff --git a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt b/ui/src/main/kotlin/app/aaps/ui/activities/TDDStatsActivity.kt similarity index 99% rename from ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt rename to ui/src/main/kotlin/app/aaps/ui/activities/TDDStatsActivity.kt index a518fe58ca..581164660d 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt +++ b/ui/src/main/kotlin/app/aaps/ui/activities/TDDStatsActivity.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.activities +package app.aaps.ui.activities import android.annotation.SuppressLint import android.graphics.Rect @@ -32,7 +32,7 @@ import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity import app.aaps.database.entities.TotalDailyDose import info.nightscout.database.impl.AppRepository -import info.nightscout.ui.databinding.ActivityTddStatsBinding +import app.aaps.ui.databinding.ActivityTddStatsBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import java.text.DateFormat import java.text.DecimalFormat diff --git a/ui/src/main/java/info/nightscout/ui/activities/TreatmentsActivity.kt b/ui/src/main/kotlin/app/aaps/ui/activities/TreatmentsActivity.kt similarity index 80% rename from ui/src/main/java/info/nightscout/ui/activities/TreatmentsActivity.kt rename to ui/src/main/kotlin/app/aaps/ui/activities/TreatmentsActivity.kt index 94fab6bb7c..b8d4b9d1e4 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/TreatmentsActivity.kt +++ b/ui/src/main/kotlin/app/aaps/ui/activities/TreatmentsActivity.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.activities +package app.aaps.ui.activities import android.os.Bundle import androidx.fragment.app.Fragment @@ -9,15 +9,15 @@ import app.aaps.core.interfaces.plugin.ActivePlugin import app.aaps.core.interfaces.resources.ResourceHelper import com.google.android.material.tabs.TabLayout import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.ui.R -import info.nightscout.ui.activities.fragments.TreatmentsBolusCarbsFragment -import info.nightscout.ui.activities.fragments.TreatmentsCareportalFragment -import info.nightscout.ui.activities.fragments.TreatmentsExtendedBolusesFragment -import info.nightscout.ui.activities.fragments.TreatmentsProfileSwitchFragment -import info.nightscout.ui.activities.fragments.TreatmentsTempTargetFragment -import info.nightscout.ui.activities.fragments.TreatmentsTemporaryBasalsFragment -import info.nightscout.ui.activities.fragments.TreatmentsUserEntryFragment -import info.nightscout.ui.databinding.TreatmentsFragmentBinding +import app.aaps.ui.R +import app.aaps.ui.activities.fragments.TreatmentsBolusCarbsFragment +import app.aaps.ui.activities.fragments.TreatmentsCareportalFragment +import app.aaps.ui.activities.fragments.TreatmentsExtendedBolusesFragment +import app.aaps.ui.activities.fragments.TreatmentsProfileSwitchFragment +import app.aaps.ui.activities.fragments.TreatmentsTempTargetFragment +import app.aaps.ui.activities.fragments.TreatmentsTemporaryBasalsFragment +import app.aaps.ui.activities.fragments.TreatmentsUserEntryFragment +import app.aaps.ui.databinding.TreatmentsFragmentBinding import javax.inject.Inject class TreatmentsActivity : TranslatedDaggerAppCompatActivity() { diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt b/ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt similarity index 98% rename from ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt rename to ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt index 90f20ceab9..fd7ed567bd 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt +++ b/ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.activities.fragments +package app.aaps.ui.activities.fragments import android.annotation.SuppressLint import android.graphics.Paint @@ -47,11 +47,11 @@ import info.nightscout.database.impl.transactions.CutCarbsTransaction import info.nightscout.database.impl.transactions.InvalidateBolusCalculatorResultTransaction import info.nightscout.database.impl.transactions.InvalidateBolusTransaction import info.nightscout.database.impl.transactions.InvalidateCarbsTransaction -import info.nightscout.ui.R -import info.nightscout.ui.databinding.TreatmentsBolusCarbsFragmentBinding -import info.nightscout.ui.databinding.TreatmentsBolusCarbsItemBinding -import info.nightscout.ui.dialogs.WizardInfoDialog -import info.nightscout.ui.extensions.isPumpHistory +import app.aaps.ui.R +import app.aaps.ui.databinding.TreatmentsBolusCarbsFragmentBinding +import app.aaps.ui.databinding.TreatmentsBolusCarbsItemBinding +import app.aaps.ui.dialogs.WizardInfoDialog +import app.aaps.ui.extensions.isPumpHistory import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.concurrent.TimeUnit diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt b/ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsCareportalFragment.kt similarity index 97% rename from ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt rename to ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsCareportalFragment.kt index 33e99806d9..5a6be8d5ae 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt +++ b/ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsCareportalFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.activities.fragments +package app.aaps.ui.activities.fragments import android.os.Bundle import android.util.SparseArray @@ -38,10 +38,10 @@ import dagger.android.support.DaggerFragment import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateAAPSStartedTherapyEventTransaction import info.nightscout.database.impl.transactions.InvalidateTherapyEventTransaction -import info.nightscout.ui.R -import info.nightscout.ui.activities.fragments.TreatmentsCareportalFragment.RecyclerViewAdapter.TherapyEventsViewHolder -import info.nightscout.ui.databinding.TreatmentsCareportalFragmentBinding -import info.nightscout.ui.databinding.TreatmentsCareportalItemBinding +import app.aaps.ui.R +import app.aaps.ui.activities.fragments.TreatmentsCareportalFragment.RecyclerViewAdapter.TherapyEventsViewHolder +import app.aaps.ui.databinding.TreatmentsCareportalFragmentBinding +import app.aaps.ui.databinding.TreatmentsCareportalItemBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.concurrent.TimeUnit diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt b/ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt similarity index 97% rename from ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt rename to ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt index a4ccad549b..5f4b9975ed 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt +++ b/ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.activities.fragments +package app.aaps.ui.activities.fragments import android.annotation.SuppressLint import android.os.Bundle @@ -40,10 +40,10 @@ import app.aaps.database.entities.interfaces.end import dagger.android.support.DaggerFragment import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateExtendedBolusTransaction -import info.nightscout.ui.R -import info.nightscout.ui.activities.fragments.TreatmentsExtendedBolusesFragment.RecyclerViewAdapter.ExtendedBolusesViewHolder -import info.nightscout.ui.databinding.TreatmentsExtendedbolusFragmentBinding -import info.nightscout.ui.databinding.TreatmentsExtendedbolusItemBinding +import app.aaps.ui.R +import app.aaps.ui.activities.fragments.TreatmentsExtendedBolusesFragment.RecyclerViewAdapter.ExtendedBolusesViewHolder +import app.aaps.ui.databinding.TreatmentsExtendedbolusFragmentBinding +import app.aaps.ui.databinding.TreatmentsExtendedbolusItemBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.concurrent.TimeUnit diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt b/ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt similarity index 97% rename from ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt rename to ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt index 88d925c0ef..36d1bf62b7 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt +++ b/ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.activities.fragments +package app.aaps.ui.activities.fragments import android.annotation.SuppressLint import android.graphics.Paint @@ -44,11 +44,11 @@ import app.aaps.database.entities.ValueWithUnit import dagger.android.support.DaggerFragment import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateProfileSwitchTransaction -import info.nightscout.ui.R -import info.nightscout.ui.activities.fragments.TreatmentsProfileSwitchFragment.RecyclerProfileViewAdapter.ProfileSwitchViewHolder -import info.nightscout.ui.databinding.TreatmentsProfileswitchFragmentBinding -import info.nightscout.ui.databinding.TreatmentsProfileswitchItemBinding -import info.nightscout.ui.dialogs.ProfileViewerDialog +import app.aaps.ui.R +import app.aaps.ui.activities.fragments.TreatmentsProfileSwitchFragment.RecyclerProfileViewAdapter.ProfileSwitchViewHolder +import app.aaps.ui.databinding.TreatmentsProfileswitchFragmentBinding +import app.aaps.ui.databinding.TreatmentsProfileswitchItemBinding +import app.aaps.ui.dialogs.ProfileViewerDialog import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt b/ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsTempTargetFragment.kt similarity index 97% rename from ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt rename to ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsTempTargetFragment.kt index ab92b23e54..e6f463c722 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt +++ b/ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsTempTargetFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.activities.fragments +package app.aaps.ui.activities.fragments import android.annotation.SuppressLint import android.os.Bundle @@ -45,10 +45,10 @@ import app.aaps.database.entities.interfaces.end import dagger.android.support.DaggerFragment import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateTemporaryTargetTransaction -import info.nightscout.ui.R -import info.nightscout.ui.activities.fragments.TreatmentsTempTargetFragment.RecyclerViewAdapter.TempTargetsViewHolder -import info.nightscout.ui.databinding.TreatmentsTemptargetFragmentBinding -import info.nightscout.ui.databinding.TreatmentsTemptargetItemBinding +import app.aaps.ui.R +import app.aaps.ui.activities.fragments.TreatmentsTempTargetFragment.RecyclerViewAdapter.TempTargetsViewHolder +import app.aaps.ui.databinding.TreatmentsTemptargetFragmentBinding +import app.aaps.ui.databinding.TreatmentsTemptargetItemBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.concurrent.TimeUnit diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt b/ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt similarity index 97% rename from ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt rename to ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt index 583d022a25..0d5d213f22 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt +++ b/ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.activities.fragments +package app.aaps.ui.activities.fragments import android.annotation.SuppressLint import android.os.Bundle @@ -46,10 +46,10 @@ import dagger.android.support.DaggerFragment import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateExtendedBolusTransaction import info.nightscout.database.impl.transactions.InvalidateTemporaryBasalTransaction -import info.nightscout.ui.R -import info.nightscout.ui.activities.fragments.TreatmentsTemporaryBasalsFragment.RecyclerViewAdapter.TempBasalsViewHolder -import info.nightscout.ui.databinding.TreatmentsTempbasalsFragmentBinding -import info.nightscout.ui.databinding.TreatmentsTempbasalsItemBinding +import app.aaps.ui.R +import app.aaps.ui.activities.fragments.TreatmentsTemporaryBasalsFragment.RecyclerViewAdapter.TempBasalsViewHolder +import app.aaps.ui.databinding.TreatmentsTempbasalsFragmentBinding +import app.aaps.ui.databinding.TreatmentsTempbasalsItemBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.concurrent.TimeUnit diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt b/ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsUserEntryFragment.kt similarity index 97% rename from ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt rename to ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsUserEntryFragment.kt index 1b7f5c54b0..7b798df036 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt +++ b/ui/src/main/kotlin/app/aaps/ui/activities/fragments/TreatmentsUserEntryFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.activities.fragments +package app.aaps.ui.activities.fragments import android.os.Bundle import android.view.LayoutInflater @@ -30,9 +30,9 @@ import app.aaps.database.entities.UserEntry.Action import app.aaps.database.entities.UserEntry.Sources import dagger.android.support.DaggerFragment import info.nightscout.database.impl.AppRepository -import info.nightscout.ui.R -import info.nightscout.ui.databinding.TreatmentsUserEntryFragmentBinding -import info.nightscout.ui.databinding.TreatmentsUserEntryItemBinding +import app.aaps.ui.R +import app.aaps.ui.databinding.TreatmentsUserEntryFragmentBinding +import app.aaps.ui.databinding.TreatmentsUserEntryItemBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/ui/src/main/java/info/nightscout/ui/activityMonitor/ActivityMonitor.kt b/ui/src/main/kotlin/app/aaps/ui/activityMonitor/ActivityMonitor.kt similarity index 98% rename from ui/src/main/java/info/nightscout/ui/activityMonitor/ActivityMonitor.kt rename to ui/src/main/kotlin/app/aaps/ui/activityMonitor/ActivityMonitor.kt index 948ba28c41..566c381d4e 100644 --- a/ui/src/main/java/info/nightscout/ui/activityMonitor/ActivityMonitor.kt +++ b/ui/src/main/kotlin/app/aaps/ui/activityMonitor/ActivityMonitor.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.activityMonitor +package app.aaps.ui.activityMonitor import android.app.Activity import android.app.Application @@ -17,7 +17,7 @@ import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.SafeParse import app.aaps.core.interfaces.utils.T -import info.nightscout.ui.R +import app.aaps.ui.R import javax.inject.Inject import javax.inject.Singleton diff --git a/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt b/ui/src/main/kotlin/app/aaps/ui/alertDialogs/ErrorDialog.kt similarity index 97% rename from ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt rename to ui/src/main/kotlin/app/aaps/ui/alertDialogs/ErrorDialog.kt index 7c5fdd5c18..dd00c57b27 100644 --- a/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/alertDialogs/ErrorDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.alertDialogs +package app.aaps.ui.alertDialogs import android.content.res.Resources import android.os.Bundle @@ -17,7 +17,7 @@ import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity import app.aaps.database.entities.UserEntry.Action import app.aaps.database.entities.UserEntry.Sources import dagger.android.support.DaggerDialogFragment -import info.nightscout.ui.databinding.DialogErrorBinding +import app.aaps.ui.databinding.DialogErrorBinding import javax.inject.Inject class ErrorDialog : DaggerDialogFragment() { diff --git a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt b/ui/src/main/kotlin/app/aaps/ui/defaultProfile/DefaultProfile.kt similarity index 99% rename from ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt rename to ui/src/main/kotlin/app/aaps/ui/defaultProfile/DefaultProfile.kt index 19b5d92377..50a49f29e2 100644 --- a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt +++ b/ui/src/main/kotlin/app/aaps/ui/defaultProfile/DefaultProfile.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.defaultProfile +package app.aaps.ui.defaultProfile import app.aaps.core.main.extensions.pureProfileFromJson import app.aaps.core.interfaces.db.GlucoseUnit diff --git a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt b/ui/src/main/kotlin/app/aaps/ui/defaultProfile/DefaultProfileDPV.kt similarity index 98% rename from ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt rename to ui/src/main/kotlin/app/aaps/ui/defaultProfile/DefaultProfileDPV.kt index 36a7898288..3bd0887bd4 100644 --- a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt +++ b/ui/src/main/kotlin/app/aaps/ui/defaultProfile/DefaultProfileDPV.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.defaultProfile +package app.aaps.ui.defaultProfile import app.aaps.core.main.extensions.pureProfileFromJson import app.aaps.core.interfaces.db.GlucoseUnit diff --git a/ui/src/main/java/info/nightscout/ui/di/UiModule.kt b/ui/src/main/kotlin/app/aaps/ui/di/UiModule.kt similarity index 63% rename from ui/src/main/java/info/nightscout/ui/di/UiModule.kt rename to ui/src/main/kotlin/app/aaps/ui/di/UiModule.kt index e00e2e2e6f..a261dfcabf 100644 --- a/ui/src/main/java/info/nightscout/ui/di/UiModule.kt +++ b/ui/src/main/kotlin/app/aaps/ui/di/UiModule.kt @@ -1,42 +1,42 @@ -package info.nightscout.ui.di +package app.aaps.ui.di import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.ui.activities.BolusProgressHelperActivity -import info.nightscout.ui.activities.ErrorHelperActivity -import info.nightscout.ui.activities.ProfileHelperActivity -import info.nightscout.ui.activities.QuickWizardListActivity -import info.nightscout.ui.activities.StatsActivity -import info.nightscout.ui.activities.SurveyActivity -import info.nightscout.ui.activities.TDDStatsActivity -import info.nightscout.ui.activities.TreatmentsActivity -import info.nightscout.ui.activities.fragments.TreatmentsBolusCarbsFragment -import info.nightscout.ui.activities.fragments.TreatmentsCareportalFragment -import info.nightscout.ui.activities.fragments.TreatmentsExtendedBolusesFragment -import info.nightscout.ui.activities.fragments.TreatmentsProfileSwitchFragment -import info.nightscout.ui.activities.fragments.TreatmentsTempTargetFragment -import info.nightscout.ui.activities.fragments.TreatmentsTemporaryBasalsFragment -import info.nightscout.ui.activities.fragments.TreatmentsUserEntryFragment -import info.nightscout.ui.alertDialogs.ErrorDialog -import info.nightscout.ui.dialogs.BolusProgressDialog -import info.nightscout.ui.dialogs.CalibrationDialog -import info.nightscout.ui.dialogs.CarbsDialog -import info.nightscout.ui.dialogs.CareDialog -import info.nightscout.ui.dialogs.EditQuickWizardDialog -import info.nightscout.ui.dialogs.ExtendedBolusDialog -import info.nightscout.ui.dialogs.FillDialog -import info.nightscout.ui.dialogs.InsulinDialog -import info.nightscout.ui.dialogs.LoopDialog -import info.nightscout.ui.dialogs.ProfileSwitchDialog -import info.nightscout.ui.dialogs.ProfileViewerDialog -import info.nightscout.ui.dialogs.TempBasalDialog -import info.nightscout.ui.dialogs.TempTargetDialog -import info.nightscout.ui.dialogs.TreatmentDialog -import info.nightscout.ui.dialogs.WizardDialog -import info.nightscout.ui.dialogs.WizardInfoDialog -import info.nightscout.ui.services.AlarmSoundService -import info.nightscout.ui.widget.Widget -import info.nightscout.ui.widget.WidgetConfigureActivity +import app.aaps.ui.activities.BolusProgressHelperActivity +import app.aaps.ui.activities.ErrorHelperActivity +import app.aaps.ui.activities.ProfileHelperActivity +import app.aaps.ui.activities.QuickWizardListActivity +import app.aaps.ui.activities.StatsActivity +import app.aaps.ui.activities.SurveyActivity +import app.aaps.ui.activities.TDDStatsActivity +import app.aaps.ui.activities.TreatmentsActivity +import app.aaps.ui.activities.fragments.TreatmentsBolusCarbsFragment +import app.aaps.ui.activities.fragments.TreatmentsCareportalFragment +import app.aaps.ui.activities.fragments.TreatmentsExtendedBolusesFragment +import app.aaps.ui.activities.fragments.TreatmentsProfileSwitchFragment +import app.aaps.ui.activities.fragments.TreatmentsTempTargetFragment +import app.aaps.ui.activities.fragments.TreatmentsTemporaryBasalsFragment +import app.aaps.ui.activities.fragments.TreatmentsUserEntryFragment +import app.aaps.ui.alertDialogs.ErrorDialog +import app.aaps.ui.dialogs.BolusProgressDialog +import app.aaps.ui.dialogs.CalibrationDialog +import app.aaps.ui.dialogs.CarbsDialog +import app.aaps.ui.dialogs.CareDialog +import app.aaps.ui.dialogs.EditQuickWizardDialog +import app.aaps.ui.dialogs.ExtendedBolusDialog +import app.aaps.ui.dialogs.FillDialog +import app.aaps.ui.dialogs.InsulinDialog +import app.aaps.ui.dialogs.LoopDialog +import app.aaps.ui.dialogs.ProfileSwitchDialog +import app.aaps.ui.dialogs.ProfileViewerDialog +import app.aaps.ui.dialogs.TempBasalDialog +import app.aaps.ui.dialogs.TempTargetDialog +import app.aaps.ui.dialogs.TreatmentDialog +import app.aaps.ui.dialogs.WizardDialog +import app.aaps.ui.dialogs.WizardInfoDialog +import app.aaps.ui.services.AlarmSoundService +import app.aaps.ui.widget.Widget +import app.aaps.ui.widget.WidgetConfigureActivity @Module @Suppress("unused") diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/BolusProgressDialog.kt similarity index 98% rename from ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt rename to ui/src/main/kotlin/app/aaps/ui/dialogs/BolusProgressDialog.kt index 2a919dc44c..4be8aadeb7 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/BolusProgressDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.dialogs +package app.aaps.ui.dialogs import android.os.Bundle import android.os.SystemClock @@ -22,7 +22,7 @@ import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity import app.aaps.database.entities.UserEntry.Action import app.aaps.database.entities.UserEntry.Sources import dagger.android.support.DaggerDialogFragment -import info.nightscout.ui.databinding.DialogBolusprogressBinding +import app.aaps.ui.databinding.DialogBolusprogressBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/CalibrationDialog.kt similarity index 97% rename from ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt rename to ui/src/main/kotlin/app/aaps/ui/dialogs/CalibrationDialog.kt index 5a1ae44b3b..1e8d2745c5 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/CalibrationDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.dialogs +package app.aaps.ui.dialogs import android.os.Bundle import android.view.LayoutInflater @@ -17,7 +17,7 @@ import app.aaps.database.entities.UserEntry.Sources import app.aaps.database.entities.ValueWithUnit import com.google.common.base.Joiner import dagger.android.HasAndroidInjector -import info.nightscout.ui.databinding.DialogCalibrationBinding +import app.aaps.ui.databinding.DialogCalibrationBinding import java.text.DecimalFormat import java.util.LinkedList import javax.inject.Inject diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/CarbsDialog.kt similarity index 99% rename from ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt rename to ui/src/main/kotlin/app/aaps/ui/dialogs/CarbsDialog.kt index 6f55bc0b98..9461d8056e 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/CarbsDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.dialogs +package app.aaps.ui.dialogs import android.content.Context import android.os.Bundle @@ -41,8 +41,8 @@ import com.google.common.base.Joiner import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction -import info.nightscout.ui.R -import info.nightscout.ui.databinding.DialogCarbsBinding +import app.aaps.ui.R +import app.aaps.ui.databinding.DialogCarbsBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/CareDialog.kt similarity index 99% rename from ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt rename to ui/src/main/kotlin/app/aaps/ui/dialogs/CareDialog.kt index 9e36c7b299..9ebd072483 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/CareDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.dialogs +package app.aaps.ui.dialogs import android.content.Context import android.os.Bundle @@ -29,8 +29,8 @@ import com.google.common.base.Joiner import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction -import info.nightscout.ui.R -import info.nightscout.ui.databinding.DialogCareBinding +import app.aaps.ui.R +import app.aaps.ui.databinding.DialogCareBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/DialogFragmentWithDate.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/DialogFragmentWithDate.kt similarity index 99% rename from ui/src/main/java/info/nightscout/ui/dialogs/DialogFragmentWithDate.kt rename to ui/src/main/kotlin/app/aaps/ui/dialogs/DialogFragmentWithDate.kt index 926302c5c4..168021894b 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/DialogFragmentWithDate.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/DialogFragmentWithDate.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.dialogs +package app.aaps.ui.dialogs import android.os.Bundle import android.text.format.DateFormat diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/EditQuickWizardDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/EditQuickWizardDialog.kt similarity index 97% rename from ui/src/main/java/info/nightscout/ui/dialogs/EditQuickWizardDialog.kt rename to ui/src/main/kotlin/app/aaps/ui/dialogs/EditQuickWizardDialog.kt index 4e58840e86..a0e4578ed8 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/EditQuickWizardDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/EditQuickWizardDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.dialogs +package app.aaps.ui.dialogs import android.os.Bundle import android.text.format.DateFormat @@ -21,9 +21,9 @@ import dagger.android.support.DaggerDialogFragment import app.aaps.core.ui.extensions.selectedItemPosition import app.aaps.core.ui.extensions.setEnableForChildren import app.aaps.core.ui.extensions.setSelection -import info.nightscout.ui.R -import info.nightscout.ui.databinding.DialogEditQuickwizardBinding -import info.nightscout.ui.events.EventQuickWizardChange +import app.aaps.ui.R +import app.aaps.ui.databinding.DialogEditQuickwizardBinding +import app.aaps.ui.events.EventQuickWizardChange import org.json.JSONException import javax.inject.Inject diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/ExtendedBolusDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/ExtendedBolusDialog.kt similarity index 97% rename from ui/src/main/java/info/nightscout/ui/dialogs/ExtendedBolusDialog.kt rename to ui/src/main/kotlin/app/aaps/ui/dialogs/ExtendedBolusDialog.kt index 956f235c60..9edad6902c 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/ExtendedBolusDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/ExtendedBolusDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.dialogs +package app.aaps.ui.dialogs import android.content.Context import android.os.Bundle @@ -24,8 +24,8 @@ import app.aaps.database.entities.UserEntry import app.aaps.database.entities.ValueWithUnit import com.google.common.base.Joiner import dagger.android.HasAndroidInjector -import info.nightscout.ui.R -import info.nightscout.ui.databinding.DialogExtendedbolusBinding +import app.aaps.ui.R +import app.aaps.ui.databinding.DialogExtendedbolusBinding import java.text.DecimalFormat import java.util.LinkedList import javax.inject.Inject diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/FillDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/FillDialog.kt similarity index 99% rename from ui/src/main/java/info/nightscout/ui/dialogs/FillDialog.kt rename to ui/src/main/kotlin/app/aaps/ui/dialogs/FillDialog.kt index edaa077451..b17fa0fb56 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/FillDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/FillDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.dialogs +package app.aaps.ui.dialogs import android.content.Context import android.os.Bundle @@ -29,8 +29,8 @@ import com.google.common.base.Joiner import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction -import info.nightscout.ui.R -import info.nightscout.ui.databinding.DialogFillBinding +import app.aaps.ui.R +import app.aaps.ui.databinding.DialogFillBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.LinkedList diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/InsulinDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/InsulinDialog.kt similarity index 98% rename from ui/src/main/java/info/nightscout/ui/dialogs/InsulinDialog.kt rename to ui/src/main/kotlin/app/aaps/ui/dialogs/InsulinDialog.kt index 5a2891bc1e..c8204825d3 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/InsulinDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/InsulinDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.dialogs +package app.aaps.ui.dialogs import android.content.Context import android.os.Bundle @@ -43,9 +43,9 @@ import com.google.common.base.Joiner import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction -import info.nightscout.ui.R -import info.nightscout.ui.databinding.DialogInsulinBinding -import info.nightscout.ui.extensions.toSignedString +import app.aaps.ui.R +import app.aaps.ui.databinding.DialogInsulinBinding +import app.aaps.ui.extensions.toSignedString import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/LoopDialog.kt similarity index 99% rename from ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt rename to ui/src/main/kotlin/app/aaps/ui/dialogs/LoopDialog.kt index e729ac4f1c..aa5a717e1f 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/LoopDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.dialogs +package app.aaps.ui.dialogs import android.content.Context import android.os.Bundle @@ -48,8 +48,8 @@ import dagger.android.support.DaggerDialogFragment import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction -import info.nightscout.ui.R -import info.nightscout.ui.databinding.DialogLoopBinding +import app.aaps.ui.R +import app.aaps.ui.databinding.DialogLoopBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/ProfileSwitchDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/ProfileSwitchDialog.kt similarity index 99% rename from ui/src/main/java/info/nightscout/ui/dialogs/ProfileSwitchDialog.kt rename to ui/src/main/kotlin/app/aaps/ui/dialogs/ProfileSwitchDialog.kt index 96f4dfdf38..b3b25ab920 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/ProfileSwitchDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/ProfileSwitchDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.dialogs +package app.aaps.ui.dialogs import android.content.Context import android.os.Bundle @@ -32,8 +32,8 @@ import app.aaps.database.entities.ValueWithUnit import com.google.common.base.Joiner import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction -import info.nightscout.ui.R -import info.nightscout.ui.databinding.DialogProfileswitchBinding +import app.aaps.ui.R +import app.aaps.ui.databinding.DialogProfileswitchBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/ProfileViewerDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/ProfileViewerDialog.kt similarity index 99% rename from ui/src/main/java/info/nightscout/ui/dialogs/ProfileViewerDialog.kt rename to ui/src/main/kotlin/app/aaps/ui/dialogs/ProfileViewerDialog.kt index 0a4497bc42..013714dd1d 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/ProfileViewerDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/ProfileViewerDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.dialogs +package app.aaps.ui.dialogs import android.os.Bundle import android.text.Spanned @@ -28,7 +28,7 @@ import app.aaps.database.ValueWrapper import dagger.android.HasAndroidInjector import dagger.android.support.DaggerDialogFragment import info.nightscout.database.impl.AppRepository -import info.nightscout.ui.databinding.DialogProfileviewerBinding +import app.aaps.ui.databinding.DialogProfileviewerBinding import org.json.JSONObject import java.text.DecimalFormat import javax.inject.Inject diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/TempBasalDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/TempBasalDialog.kt similarity index 98% rename from ui/src/main/java/info/nightscout/ui/dialogs/TempBasalDialog.kt rename to ui/src/main/kotlin/app/aaps/ui/dialogs/TempBasalDialog.kt index 46ec6fb416..5d484530d3 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/TempBasalDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/TempBasalDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.dialogs +package app.aaps.ui.dialogs import android.content.Context import android.os.Bundle @@ -27,8 +27,8 @@ import app.aaps.database.entities.UserEntry import app.aaps.database.entities.ValueWithUnit import com.google.common.base.Joiner import dagger.android.HasAndroidInjector -import info.nightscout.ui.R -import info.nightscout.ui.databinding.DialogTempbasalBinding +import app.aaps.ui.R +import app.aaps.ui.databinding.DialogTempbasalBinding import java.text.DecimalFormat import java.util.LinkedList import javax.inject.Inject diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/TempTargetDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/TempTargetDialog.kt similarity index 99% rename from ui/src/main/java/info/nightscout/ui/dialogs/TempTargetDialog.kt rename to ui/src/main/kotlin/app/aaps/ui/dialogs/TempTargetDialog.kt index 609ed2c967..5cab4b5cf8 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/TempTargetDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/TempTargetDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.dialogs +package app.aaps.ui.dialogs import android.content.Context import android.os.Bundle @@ -28,8 +28,8 @@ import com.google.common.collect.Lists import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction -import info.nightscout.ui.R -import info.nightscout.ui.databinding.DialogTemptargetBinding +import app.aaps.ui.R +import app.aaps.ui.databinding.DialogTemptargetBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/TreatmentDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/TreatmentDialog.kt similarity index 98% rename from ui/src/main/java/info/nightscout/ui/dialogs/TreatmentDialog.kt rename to ui/src/main/kotlin/app/aaps/ui/dialogs/TreatmentDialog.kt index 1c9106d315..0fbb229a40 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/TreatmentDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/TreatmentDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.dialogs +package app.aaps.ui.dialogs import android.content.Context import android.os.Bundle @@ -31,8 +31,8 @@ import app.aaps.database.entities.ValueWithUnit import com.google.common.base.Joiner import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.ui.R -import info.nightscout.ui.databinding.DialogTreatmentBinding +import app.aaps.ui.R +import app.aaps.ui.databinding.DialogTreatmentBinding import java.text.DecimalFormat import java.util.LinkedList import javax.inject.Inject diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/WizardDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/WizardDialog.kt similarity index 99% rename from ui/src/main/java/info/nightscout/ui/dialogs/WizardDialog.kt rename to ui/src/main/kotlin/app/aaps/ui/dialogs/WizardDialog.kt index 07067fc3cb..103e71f81d 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/WizardDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/WizardDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.dialogs +package app.aaps.ui.dialogs import android.annotation.SuppressLint import android.content.Context @@ -52,8 +52,8 @@ import app.aaps.database.ValueWrapper import dagger.android.HasAndroidInjector import dagger.android.support.DaggerDialogFragment import info.nightscout.database.impl.AppRepository -import info.nightscout.ui.R -import info.nightscout.ui.databinding.DialogWizardBinding +import app.aaps.ui.R +import app.aaps.ui.databinding.DialogWizardBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/WizardInfoDialog.kt similarity index 97% rename from ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt rename to ui/src/main/kotlin/app/aaps/ui/dialogs/WizardInfoDialog.kt index 5801977701..309578fec1 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/WizardInfoDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.dialogs +package app.aaps.ui.dialogs import android.os.Bundle import android.view.LayoutInflater @@ -13,8 +13,8 @@ import app.aaps.core.interfaces.utils.DateUtil import app.aaps.database.entities.BolusCalculatorResult import com.google.gson.Gson import dagger.android.support.DaggerDialogFragment -import info.nightscout.ui.R -import info.nightscout.ui.databinding.DialogWizardinfoBinding +import app.aaps.ui.R +import app.aaps.ui.databinding.DialogWizardinfoBinding import javax.inject.Inject class WizardInfoDialog : DaggerDialogFragment() { diff --git a/ui/src/main/java/info/nightscout/ui/elements/EmptyRecyclerView.kt b/ui/src/main/kotlin/app/aaps/ui/elements/EmptyRecyclerView.kt similarity index 98% rename from ui/src/main/java/info/nightscout/ui/elements/EmptyRecyclerView.kt rename to ui/src/main/kotlin/app/aaps/ui/elements/EmptyRecyclerView.kt index 9036237dda..aab1731032 100644 --- a/ui/src/main/java/info/nightscout/ui/elements/EmptyRecyclerView.kt +++ b/ui/src/main/kotlin/app/aaps/ui/elements/EmptyRecyclerView.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.elements +package app.aaps.ui.elements import android.content.Context import android.util.AttributeSet diff --git a/ui/src/main/java/info/nightscout/ui/events/EventQuickWizardChange.kt b/ui/src/main/kotlin/app/aaps/ui/events/EventQuickWizardChange.kt similarity index 72% rename from ui/src/main/java/info/nightscout/ui/events/EventQuickWizardChange.kt rename to ui/src/main/kotlin/app/aaps/ui/events/EventQuickWizardChange.kt index fc6bdcbe95..3f3229fa74 100644 --- a/ui/src/main/java/info/nightscout/ui/events/EventQuickWizardChange.kt +++ b/ui/src/main/kotlin/app/aaps/ui/events/EventQuickWizardChange.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.events +package app.aaps.ui.events import app.aaps.core.interfaces.rx.events.Event diff --git a/ui/src/main/java/info/nightscout/ui/extensions/DoubleToSignedString.kt b/ui/src/main/kotlin/app/aaps/ui/extensions/DoubleToSignedString.kt similarity index 89% rename from ui/src/main/java/info/nightscout/ui/extensions/DoubleToSignedString.kt rename to ui/src/main/kotlin/app/aaps/ui/extensions/DoubleToSignedString.kt index 417d8dda59..6d5ccf86dc 100644 --- a/ui/src/main/java/info/nightscout/ui/extensions/DoubleToSignedString.kt +++ b/ui/src/main/kotlin/app/aaps/ui/extensions/DoubleToSignedString.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.extensions +package app.aaps.ui.extensions import app.aaps.core.interfaces.pump.Pump import app.aaps.core.interfaces.utils.DecimalFormatter diff --git a/ui/src/main/java/info/nightscout/ui/extensions/InterfaceIDsExtension.kt b/ui/src/main/kotlin/app/aaps/ui/extensions/InterfaceIDsExtension.kt similarity index 77% rename from ui/src/main/java/info/nightscout/ui/extensions/InterfaceIDsExtension.kt rename to ui/src/main/kotlin/app/aaps/ui/extensions/InterfaceIDsExtension.kt index e757904c9f..e5919e56bc 100644 --- a/ui/src/main/java/info/nightscout/ui/extensions/InterfaceIDsExtension.kt +++ b/ui/src/main/kotlin/app/aaps/ui/extensions/InterfaceIDsExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.extensions +package app.aaps.ui.extensions import app.aaps.database.entities.embedments.InterfaceIDs diff --git a/ui/src/main/java/info/nightscout/ui/services/AlarmSoundService.kt b/ui/src/main/kotlin/app/aaps/ui/services/AlarmSoundService.kt similarity index 99% rename from ui/src/main/java/info/nightscout/ui/services/AlarmSoundService.kt rename to ui/src/main/kotlin/app/aaps/ui/services/AlarmSoundService.kt index 179e2bd0fd..d853d6cc52 100644 --- a/ui/src/main/java/info/nightscout/ui/services/AlarmSoundService.kt +++ b/ui/src/main/kotlin/app/aaps/ui/services/AlarmSoundService.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.services +package app.aaps.ui.services import android.content.Context import android.content.Intent diff --git a/ui/src/main/java/info/nightscout/ui/services/AlarmSoundServiceHelper.kt b/ui/src/main/kotlin/app/aaps/ui/services/AlarmSoundServiceHelper.kt similarity index 98% rename from ui/src/main/java/info/nightscout/ui/services/AlarmSoundServiceHelper.kt rename to ui/src/main/kotlin/app/aaps/ui/services/AlarmSoundServiceHelper.kt index 7bae3ba610..ecb582154e 100644 --- a/ui/src/main/java/info/nightscout/ui/services/AlarmSoundServiceHelper.kt +++ b/ui/src/main/kotlin/app/aaps/ui/services/AlarmSoundServiceHelper.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.services +package app.aaps.ui.services import android.content.ComponentName import android.content.Context diff --git a/ui/src/main/java/info/nightscout/ui/tabs/TabPageAdapter.kt b/ui/src/main/kotlin/app/aaps/ui/tabs/TabPageAdapter.kt similarity index 97% rename from ui/src/main/java/info/nightscout/ui/tabs/TabPageAdapter.kt rename to ui/src/main/kotlin/app/aaps/ui/tabs/TabPageAdapter.kt index 8964a60b9e..4e8b8f5116 100644 --- a/ui/src/main/java/info/nightscout/ui/tabs/TabPageAdapter.kt +++ b/ui/src/main/kotlin/app/aaps/ui/tabs/TabPageAdapter.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.tabs +package app.aaps.ui.tabs import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment diff --git a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt b/ui/src/main/kotlin/app/aaps/ui/widget/Widget.kt similarity index 99% rename from ui/src/main/java/info/nightscout/ui/widget/Widget.kt rename to ui/src/main/kotlin/app/aaps/ui/widget/Widget.kt index 48d031420a..0b3dfd892d 100644 --- a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt +++ b/ui/src/main/kotlin/app/aaps/ui/widget/Widget.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.widget +package app.aaps.ui.widget import android.app.PendingIntent import android.appwidget.AppWidgetManager @@ -38,7 +38,7 @@ import app.aaps.core.main.iob.displayText import app.aaps.core.main.profile.ProfileSealed import app.aaps.database.entities.interfaces.end import dagger.android.HasAndroidInjector -import info.nightscout.ui.R +import app.aaps.ui.R import java.util.Locale import javax.inject.Inject import kotlin.math.abs diff --git a/ui/src/main/java/info/nightscout/ui/widget/WidgetConfigureActivity.kt b/ui/src/main/kotlin/app/aaps/ui/widget/WidgetConfigureActivity.kt similarity index 96% rename from ui/src/main/java/info/nightscout/ui/widget/WidgetConfigureActivity.kt rename to ui/src/main/kotlin/app/aaps/ui/widget/WidgetConfigureActivity.kt index 9ad3fa4633..2879016bbd 100644 --- a/ui/src/main/java/info/nightscout/ui/widget/WidgetConfigureActivity.kt +++ b/ui/src/main/kotlin/app/aaps/ui/widget/WidgetConfigureActivity.kt @@ -1,4 +1,4 @@ -package info.nightscout.ui.widget +package app.aaps.ui.widget import android.appwidget.AppWidgetManager import android.content.Intent @@ -6,7 +6,7 @@ import android.os.Bundle import android.widget.SeekBar import app.aaps.core.interfaces.sharedPreferences.SP import dagger.android.DaggerActivity -import info.nightscout.ui.databinding.WidgetConfigureBinding +import app.aaps.ui.databinding.WidgetConfigureBinding import javax.inject.Inject /** diff --git a/ui/src/main/res/layout/activity_profilehelper.xml b/ui/src/main/res/layout/activity_profilehelper.xml index b901895a53..a665199c1a 100644 --- a/ui/src/main/res/layout/activity_profilehelper.xml +++ b/ui/src/main/res/layout/activity_profilehelper.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - tools:context="info.nightscout.ui.activities.ProfileHelperActivity"> + tools:context=".activities.ProfileHelperActivity"> + tools:context=".activities.QuickWizardListActivity"> + tools:context=".activities.StatsActivity"> + tools:context=".activities.TDDStatsActivity"> + tools:context=".ui.dialogs.CarbsDialog"> + tools:context=".dialogs.EditQuickWizardDialog"> + tools:context=".dialogs.InsulinDialog"> - - - - - - - Date: Tue, 26 Sep 2023 18:29:58 +0200 Subject: [PATCH 17/17] :app :wear cleanup --- app/build.gradle | 2 +- app/src/main/kotlin/app/aaps/MainActivity.kt | 12 +- app/src/main/kotlin/app/aaps/MainApp.kt | 6 +- .../aaps/activities/HistoryBrowseActivity.kt | 2 +- .../aaps/activities/MyPreferenceFragment.kt | 2 +- .../aaps/activities/PreferencesActivity.kt | 4 +- .../app/aaps/implementations/ConfigImpl.kt | 4 +- .../aaps/implementations/UiInteractionImpl.kt | 4 +- .../app/aaps/receivers/KeepAliveWorker.kt | 2 +- .../app/aaps/core/utils/EspressoTestHelper.kt | 2 +- wear/build.gradle | 2 +- .../app/aaps/wear}/WearApp.kt | 13 +- .../app/aaps/wear}/comm/DataHandlerWear.kt | 18 +- .../comm/DataLayerListenerServiceWear.kt | 6 +- .../aaps/wear}/comm/ExceptionHandlerWear.kt | 140 ++-- .../wear}/comm/IntentCancelNotification.kt | 2 +- .../app/aaps/wear}/comm/IntentWearToMobile.kt | 2 +- .../BaseComplicationProviderService.kt | 22 +- .../complications/BrCobIobComplication.kt | 8 +- .../complications/CobDetailedComplication.kt | 4 +- .../complications/CobIconComplication.kt | 6 +- .../wear}/complications/CobIobComplication.kt | 8 +- .../wear}/complications/ComplicationAction.kt | 2 +- .../ComplicationTapBroadcastReceiver.kt | 20 +- .../complications/IobDetailedComplication.kt | 4 +- .../complications/IobIconComplication.kt | 10 +- .../complications/LongStatusComplication.kt | 4 +- .../LongStatusFlippedComplication.kt | 4 +- .../wear}/complications/SgvComplication.kt | 4 +- .../UploaderBatteryComplication.kt | 6 +- .../complications/WallpaperComplication.kt | 4 +- .../WallpaperDarkComplication.kt | 2 +- .../WallpaperGrayComplication.kt | 2 +- .../WallpaperLightComplication.kt | 2 +- .../app/aaps/wear}/data/RawDisplayData.kt | 4 +- .../app/aaps/wear}/di/WearActivitiesModule.kt | 30 +- .../app/aaps/wear}/di/WearComponent.kt | 4 +- .../app/aaps/wear}/di/WearModule.kt | 4 +- .../app/aaps/wear}/di/WearServicesModule.kt | 39 +- .../wear}/events/EventWearPreferenceChange.kt | 2 +- .../aaps/wear}/heartrate/HeartRateListener.kt | 4 +- .../interaction/ConfigurationActivity.kt | 4 +- .../interaction/TileConfigurationActivity.kt | 6 +- .../WatchfaceConfigurationActivity.kt | 4 +- .../interaction/actions/AcceptActivity.kt | 12 +- .../actions/BackgroundActionActivity.kt | 4 +- .../interaction/actions/BolusActivity.kt | 10 +- .../wear}/interaction/actions/CarbActivity.kt | 10 +- .../interaction/actions/ECarbActivity.kt | 10 +- .../wear}/interaction/actions/FillActivity.kt | 10 +- .../actions/ProfileSwitchActivity.kt | 10 +- .../actions/QuickSnoozeActivity.kt | 108 +-- .../interaction/actions/TempTargetActivity.kt | 10 +- .../interaction/actions/TreatmentActivity.kt | 10 +- .../actions/ViewSelectorActivity.kt | 10 +- .../interaction/actions/WizardActivity.kt | 10 +- .../interaction/menus/FillMenuActivity.kt | 8 +- .../interaction/menus/MainMenuActivity.kt | 14 +- .../menus/PreferenceMenuActivity.kt | 16 +- .../interaction/menus/StatusMenuActivity.kt | 6 +- .../aaps/wear}/interaction/utils/Constants.kt | 2 +- .../wear}/interaction/utils/DisplayFormat.kt | 284 ++++---- .../utils/EditPlusMinusViewAdapter.kt | 196 +++--- .../wear}/interaction/utils/Inevitable.kt | 14 +- .../interaction/utils/MenuListActivity.kt | 6 +- .../app/aaps/wear}/interaction/utils/Pair.kt | 4 +- .../wear}/interaction/utils/Persistence.kt | 2 +- .../interaction/utils/PlusMinusEditText.kt | 11 +- .../interaction/utils/SmallestDoubleString.kt | 3 +- .../interaction/utils/VersionPreference.kt | 6 +- .../utils/WatchfaceSettingsPreference.kt | 4 +- .../aaps/wear}/interaction/utils/WearUtil.kt | 2 +- .../DotsPageIndicatorNonDeprecated.kt | 2 +- .../GridPagerAdapterNonDeprecated.kt | 2 +- .../GridViewPagerNonDeprecated.kt | 2 +- .../app/aaps/wear}/tile/ActionsTileService.kt | 38 +- .../aaps/wear}/tile/QuickWizardTileService.kt | 38 +- .../aaps/wear}/tile/TempTargetTileService.kt | 38 +- .../app/aaps/wear}/tile/TileBase.kt | 618 +++++++++--------- .../aaps/wear}/tile/source/ActionSource.kt | 152 ++--- .../wear}/tile/source/QuickWizardSource.kt | 162 ++--- .../wear}/tile/source/StaticTileSource.kt | 122 ++-- .../wear}/tile/source/TempTargetSource.kt | 166 ++--- .../wear}/watchfaces/AapsLargeWatchface.kt | 8 +- .../aaps/wear}/watchfaces/AapsV2Watchface.kt | 8 +- .../aaps/wear}/watchfaces/AapsWatchface.kt | 8 +- .../wear}/watchfaces/BigChartWatchface.kt | 22 +- .../aaps/wear}/watchfaces/CircleWatchface.kt | 10 +- .../aaps/wear}/watchfaces/CockpitWatchface.kt | 14 +- .../aaps/wear}/watchfaces/CustomWatchface.kt | 8 +- .../wear}/watchfaces/DigitalStyleWatchface.kt | 8 +- .../aaps/wear}/watchfaces/NoChartWatchface.kt | 11 +- .../wear}/watchfaces/SteampunkWatchface.kt | 8 +- .../wear}/watchfaces/utils/BaseWatchFace.kt | 16 +- .../wear}/watchfaces/utils/BgGraphBuilder.kt | 4 +- .../aaps/wear}/watchfaces/utils/SimpleUi.kt | 308 ++++----- .../watchfaces/utils/WatchfaceViewAdapter.kt | 209 +++--- wear/src/main/res/layout/activity_custom.xml | 157 +++-- wear/src/main/res/layout/grid_layout.xml | 4 +- .../app/aaps/wear}/WearTestBase.kt | 10 +- .../wear}/heartrate/HeartRateListenerTest.kt | 2 +- .../interaction/utils/DisplayFormatTest.kt | 10 +- .../aaps/wear}/interaction/utils/PairTest.kt | 2 +- .../wear}/interaction/utils/WearUtilTest.kt | 4 +- .../wear}/testing/mockers/RawDataMocker.kt | 6 +- .../testing/mocks/SharedPreferencesMock.kt | 2 +- 106 files changed, 1723 insertions(+), 1684 deletions(-) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/WearApp.kt (83%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/comm/DataHandlerWear.kt (96%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/comm/DataLayerListenerServiceWear.kt (98%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/comm/ExceptionHandlerWear.kt (95%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/comm/IntentCancelNotification.kt (88%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/comm/IntentWearToMobile.kt (94%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/complications/BaseComplicationProviderService.kt (95%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/complications/BrCobIobComplication.kt (87%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/complications/CobDetailedComplication.kt (93%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/complications/CobIconComplication.kt (91%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/complications/CobIobComplication.kt (84%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/complications/ComplicationAction.kt (68%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/complications/ComplicationTapBroadcastReceiver.kt (91%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/complications/IobDetailedComplication.kt (93%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/complications/IobIconComplication.kt (84%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/complications/LongStatusComplication.kt (94%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/complications/LongStatusFlippedComplication.kt (94%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/complications/SgvComplication.kt (93%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/complications/UploaderBatteryComplication.kt (97%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/complications/WallpaperComplication.kt (94%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/complications/WallpaperDarkComplication.kt (88%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/complications/WallpaperGrayComplication.kt (88%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/complications/WallpaperLightComplication.kt (88%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/data/RawDisplayData.kt (94%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/di/WearActivitiesModule.kt (63%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/di/WearComponent.kt (86%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/di/WearModule.kt (88%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/di/WearServicesModule.kt (65%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/events/EventWearPreferenceChange.kt (92%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/heartrate/HeartRateListener.kt (98%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/ConfigurationActivity.kt (94%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/TileConfigurationActivity.kt (92%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/WatchfaceConfigurationActivity.kt (97%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/actions/AcceptActivity.kt (92%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/actions/BackgroundActionActivity.kt (90%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/actions/BolusActivity.kt (90%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/actions/CarbActivity.kt (90%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/actions/ECarbActivity.kt (93%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/actions/FillActivity.kt (89%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/actions/ProfileSwitchActivity.kt (92%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/actions/QuickSnoozeActivity.kt (92%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/actions/TempTargetActivity.kt (94%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/actions/TreatmentActivity.kt (93%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/actions/ViewSelectorActivity.kt (89%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/actions/WizardActivity.kt (92%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/menus/FillMenuActivity.kt (86%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/menus/MainMenuActivity.kt (88%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/menus/PreferenceMenuActivity.kt (80%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/menus/StatusMenuActivity.kt (89%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/utils/Constants.kt (86%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/utils/DisplayFormat.kt (94%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/utils/EditPlusMinusViewAdapter.kt (85%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/utils/Inevitable.kt (89%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/utils/MenuListActivity.kt (96%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/utils/Pair.kt (88%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/utils/Persistence.kt (99%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/utils/PlusMinusEditText.kt (97%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/utils/SmallestDoubleString.kt (97%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/utils/VersionPreference.kt (88%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/utils/WatchfaceSettingsPreference.kt (90%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/utils/WearUtil.kt (97%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/nondeprecated/DotsPageIndicatorNonDeprecated.kt (89%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/nondeprecated/GridPagerAdapterNonDeprecated.kt (82%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/nondeprecated/GridViewPagerNonDeprecated.kt (88%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/tile/ActionsTileService.kt (78%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/tile/QuickWizardTileService.kt (78%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/tile/TempTargetTileService.kt (78%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/tile/TileBase.kt (96%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/tile/source/ActionSource.kt (81%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/tile/source/QuickWizardSource.kt (90%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/tile/source/StaticTileSource.kt (90%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/tile/source/TempTargetSource.kt (92%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/watchfaces/AapsLargeWatchface.kt (96%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/watchfaces/AapsV2Watchface.kt (97%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/watchfaces/AapsWatchface.kt (96%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/watchfaces/BigChartWatchface.kt (90%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/watchfaces/CircleWatchface.kt (98%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/watchfaces/CockpitWatchface.kt (86%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/watchfaces/CustomWatchface.kt (99%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/watchfaces/DigitalStyleWatchface.kt (96%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/watchfaces/NoChartWatchface.kt (90%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/watchfaces/SteampunkWatchface.kt (97%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/watchfaces/utils/BaseWatchFace.kt (97%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/watchfaces/utils/BgGraphBuilder.kt (99%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/watchfaces/utils/SimpleUi.kt (96%) rename wear/src/main/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/watchfaces/utils/WatchfaceViewAdapter.kt (70%) rename wear/src/test/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/WearTestBase.kt (87%) rename wear/src/test/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/heartrate/HeartRateListenerTest.kt (99%) rename wear/src/test/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/utils/DisplayFormatTest.kt (98%) rename wear/src/test/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/utils/PairTest.kt (96%) rename wear/src/test/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/interaction/utils/WearUtilTest.kt (97%) rename wear/src/test/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/testing/mockers/RawDataMocker.kt (94%) rename wear/src/test/{java/info/nightscout/androidaps => kotlin/app/aaps/wear}/testing/mocks/SharedPreferencesMock.kt (98%) diff --git a/app/build.gradle b/app/build.gradle index d94df5f5f1..67924f5289 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -99,7 +99,7 @@ def allCommitted = { -> android { - namespace 'info.nightscout.androidaps' + namespace 'app.aaps' ndkVersion "21.1.6352462" defaultConfig { diff --git a/app/src/main/kotlin/app/aaps/MainActivity.kt b/app/src/main/kotlin/app/aaps/MainActivity.kt index fcb1e69c17..1ccd5e2a35 100644 --- a/app/src/main/kotlin/app/aaps/MainActivity.kt +++ b/app/src/main/kotlin/app/aaps/MainActivity.kt @@ -59,22 +59,20 @@ import app.aaps.core.ui.toast.ToastUtils import app.aaps.core.utils.isRunningRealPumpTest import app.aaps.database.entities.UserEntry.Action import app.aaps.database.entities.UserEntry.Sources +import app.aaps.databinding.ActivityMainBinding import app.aaps.plugins.configuration.activities.DaggerAppCompatActivityWithResult import app.aaps.plugins.configuration.activities.SingleFragmentActivity import app.aaps.plugins.configuration.setupwizard.SetupWizardActivity import app.aaps.plugins.constraints.signatureVerifier.SignatureVerifierPlugin +import app.aaps.ui.activities.ProfileHelperActivity +import app.aaps.ui.activities.StatsActivity +import app.aaps.ui.activities.TreatmentsActivity +import app.aaps.ui.tabs.TabPageAdapter import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.tabs.TabLayoutMediator import com.google.firebase.crashlytics.FirebaseCrashlytics import com.joanzapata.iconify.Iconify import com.joanzapata.iconify.fonts.FontAwesomeModule -import info.nightscout.androidaps.BuildConfig -import info.nightscout.androidaps.R -import info.nightscout.androidaps.databinding.ActivityMainBinding -import app.aaps.ui.activities.ProfileHelperActivity -import app.aaps.ui.activities.StatsActivity -import app.aaps.ui.activities.TreatmentsActivity -import app.aaps.ui.tabs.TabPageAdapter import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.io.File diff --git a/app/src/main/kotlin/app/aaps/MainApp.kt b/app/src/main/kotlin/app/aaps/MainApp.kt index 3621ae4c12..f2bae3284c 100644 --- a/app/src/main/kotlin/app/aaps/MainApp.kt +++ b/app/src/main/kotlin/app/aaps/MainApp.kt @@ -42,15 +42,13 @@ import app.aaps.receivers.BTReceiver import app.aaps.receivers.ChargingStateReceiver import app.aaps.receivers.KeepAliveWorker import app.aaps.receivers.TimeDateOrTZChangeReceiver +import app.aaps.ui.activityMonitor.ActivityMonitor +import app.aaps.ui.widget.Widget import dagger.android.AndroidInjector import dagger.android.DaggerApplication -import info.nightscout.androidaps.BuildConfig -import info.nightscout.androidaps.R import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.database.impl.transactions.VersionChangeTransaction -import app.aaps.ui.activityMonitor.ActivityMonitor -import app.aaps.ui.widget.Widget import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.exceptions.UndeliverableException import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/app/src/main/kotlin/app/aaps/activities/HistoryBrowseActivity.kt b/app/src/main/kotlin/app/aaps/activities/HistoryBrowseActivity.kt index aa64fe3aa8..5ab29d1384 100644 --- a/app/src/main/kotlin/app/aaps/activities/HistoryBrowseActivity.kt +++ b/app/src/main/kotlin/app/aaps/activities/HistoryBrowseActivity.kt @@ -30,11 +30,11 @@ import app.aaps.core.main.events.EventIobCalculationProgress import app.aaps.core.main.utils.fabric.FabricPrivacy import app.aaps.core.main.workflow.CalculationWorkflow import app.aaps.core.ui.activities.TranslatedDaggerAppCompatActivity +import app.aaps.databinding.ActivityHistorybrowseBinding import app.aaps.plugins.main.general.overview.graphData.GraphData import com.google.android.material.datepicker.MaterialDatePicker import com.jjoe64.graphview.GraphView import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.databinding.ActivityHistorybrowseBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.Calendar diff --git a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt index 96cbbf2728..7167a8fdb9 100644 --- a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt @@ -15,6 +15,7 @@ import androidx.preference.PreferenceGroup import androidx.preference.PreferenceManager import androidx.preference.PreferenceScreen import androidx.preference.size +import app.aaps.R import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.nsclient.NSSettingsStatus import app.aaps.core.interfaces.plugin.PluginBase @@ -60,7 +61,6 @@ import app.aaps.plugins.sync.openhumans.OpenHumansUploaderPlugin import app.aaps.plugins.sync.tidepool.TidepoolPlugin import app.aaps.plugins.sync.xdrip.XdripPlugin import dagger.android.support.AndroidSupportInjection -import info.nightscout.androidaps.R import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin import info.nightscout.androidaps.danaRv2.DanaRv2Plugin import info.nightscout.androidaps.danar.DanaRPlugin diff --git a/app/src/main/kotlin/app/aaps/activities/PreferencesActivity.kt b/app/src/main/kotlin/app/aaps/activities/PreferencesActivity.kt index 656146f503..13ee750747 100644 --- a/app/src/main/kotlin/app/aaps/activities/PreferencesActivity.kt +++ b/app/src/main/kotlin/app/aaps/activities/PreferencesActivity.kt @@ -8,9 +8,9 @@ import androidx.appcompat.widget.SearchView import androidx.core.view.MenuProvider import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceScreen +import app.aaps.R +import app.aaps.databinding.ActivityPreferencesBinding import app.aaps.plugins.configuration.activities.DaggerAppCompatActivityWithResult -import info.nightscout.androidaps.R -import info.nightscout.androidaps.databinding.ActivityPreferencesBinding class PreferencesActivity : DaggerAppCompatActivityWithResult(), PreferenceFragmentCompat.OnPreferenceStartScreenCallback { diff --git a/app/src/main/kotlin/app/aaps/implementations/ConfigImpl.kt b/app/src/main/kotlin/app/aaps/implementations/ConfigImpl.kt index d729a327f5..7102b9ab80 100644 --- a/app/src/main/kotlin/app/aaps/implementations/ConfigImpl.kt +++ b/app/src/main/kotlin/app/aaps/implementations/ConfigImpl.kt @@ -1,10 +1,10 @@ package app.aaps.implementations import android.os.Build +import app.aaps.BuildConfig +import app.aaps.R import app.aaps.core.interfaces.configuration.Config import app.aaps.core.interfaces.maintenance.PrefFileListProvider -import info.nightscout.androidaps.BuildConfig -import info.nightscout.androidaps.R import java.io.File import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt b/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt index b7d41ceda3..774c88d9c0 100644 --- a/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt +++ b/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt @@ -7,6 +7,7 @@ import androidx.annotation.RawRes import androidx.annotation.StringRes import androidx.fragment.app.FragmentManager import app.aaps.MainActivity +import app.aaps.R import app.aaps.activities.HistoryBrowseActivity import app.aaps.activities.MyPreferenceFragment import app.aaps.activities.PreferencesActivity @@ -18,8 +19,6 @@ import app.aaps.core.main.events.EventNewNotification import app.aaps.core.ui.toast.ToastUtils import app.aaps.plugins.configuration.activities.SingleFragmentActivity import app.aaps.plugins.main.general.overview.notifications.NotificationWithAction -import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import app.aaps.ui.activities.BolusProgressHelperActivity import app.aaps.ui.activities.ErrorHelperActivity import app.aaps.ui.activities.QuickWizardListActivity @@ -41,6 +40,7 @@ import app.aaps.ui.dialogs.WizardDialog import app.aaps.ui.services.AlarmSoundService import app.aaps.ui.services.AlarmSoundServiceHelper import app.aaps.ui.widget.Widget +import dagger.android.HasAndroidInjector import javax.inject.Inject class UiInteractionImpl @Inject constructor( diff --git a/app/src/main/kotlin/app/aaps/receivers/KeepAliveWorker.kt b/app/src/main/kotlin/app/aaps/receivers/KeepAliveWorker.kt index 0483f61d56..fcefc76ec7 100644 --- a/app/src/main/kotlin/app/aaps/receivers/KeepAliveWorker.kt +++ b/app/src/main/kotlin/app/aaps/receivers/KeepAliveWorker.kt @@ -9,6 +9,7 @@ import androidx.work.WorkManager import androidx.work.WorkQuery import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.R import app.aaps.core.interfaces.alerts.LocalAlertUtils import app.aaps.core.interfaces.aps.Loop import app.aaps.core.interfaces.configuration.Config @@ -28,7 +29,6 @@ import app.aaps.core.main.profile.ProfileSealed import app.aaps.core.main.utils.worker.LoggingWorker import app.aaps.plugins.configuration.maintenance.MaintenancePlugin import com.google.common.util.concurrent.ListenableFuture -import info.nightscout.androidaps.R import info.nightscout.database.impl.AppRepository import kotlinx.coroutines.Dispatchers import java.util.concurrent.TimeUnit diff --git a/core/utils/src/main/kotlin/app/aaps/core/utils/EspressoTestHelper.kt b/core/utils/src/main/kotlin/app/aaps/core/utils/EspressoTestHelper.kt index f4f79f8824..9804c491af 100644 --- a/core/utils/src/main/kotlin/app/aaps/core/utils/EspressoTestHelper.kt +++ b/core/utils/src/main/kotlin/app/aaps/core/utils/EspressoTestHelper.kt @@ -13,7 +13,7 @@ fun isRunningTest(): Boolean { @Synchronized fun isRunningRealPumpTest(): Boolean { return try { - Class.forName("info.nightscout.androidaps.RealPumpTest") + Class.forName("app.aaps.RealPumpTest") true } catch (e: ClassNotFoundException) { false diff --git a/wear/build.gradle b/wear/build.gradle index 4b98278a83..61a7da54d7 100644 --- a/wear/build.gradle +++ b/wear/build.gradle @@ -80,7 +80,7 @@ android { versionName version + "-aapsclient" } } - namespace 'info.nightscout.androidaps' + namespace 'app.aaps.wear' } allprojects { diff --git a/wear/src/main/java/info/nightscout/androidaps/WearApp.kt b/wear/src/main/kotlin/app/aaps/wear/WearApp.kt similarity index 83% rename from wear/src/main/java/info/nightscout/androidaps/WearApp.kt rename to wear/src/main/kotlin/app/aaps/wear/WearApp.kt index 56a213a15a..fd752670ae 100644 --- a/wear/src/main/java/info/nightscout/androidaps/WearApp.kt +++ b/wear/src/main/kotlin/app/aaps/wear/WearApp.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps +package app.aaps.wear import android.content.Intent import android.content.SharedPreferences @@ -8,19 +8,20 @@ import androidx.preference.PreferenceManager import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.rx.bus.RxBus +import app.aaps.wear.comm.DataHandlerWear +import app.aaps.wear.comm.DataLayerListenerServiceWear +import app.aaps.wear.comm.ExceptionHandlerWear +import app.aaps.wear.di.DaggerWearComponent +import app.aaps.wear.events.EventWearPreferenceChange import dagger.android.AndroidInjector import dagger.android.DaggerApplication -import info.nightscout.androidaps.comm.DataHandlerWear -import info.nightscout.androidaps.comm.DataLayerListenerServiceWear -import info.nightscout.androidaps.comm.ExceptionHandlerWear -import info.nightscout.androidaps.di.DaggerWearComponent -import info.nightscout.androidaps.events.EventWearPreferenceChange import javax.inject.Inject class WearApp : DaggerApplication(), OnSharedPreferenceChangeListener { @Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var rxBus: RxBus + @Suppress("unused") @Inject lateinit var dataHandlerWear: DataHandlerWear // instantiate only @Inject lateinit var exceptionHandlerWear: ExceptionHandlerWear diff --git a/wear/src/main/java/info/nightscout/androidaps/comm/DataHandlerWear.kt b/wear/src/main/kotlin/app/aaps/wear/comm/DataHandlerWear.kt similarity index 96% rename from wear/src/main/java/info/nightscout/androidaps/comm/DataHandlerWear.kt rename to wear/src/main/kotlin/app/aaps/wear/comm/DataHandlerWear.kt index dfa3a28565..119fc92587 100644 --- a/wear/src/main/java/info/nightscout/androidaps/comm/DataHandlerWear.kt +++ b/wear/src/main/kotlin/app/aaps/wear/comm/DataHandlerWear.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.comm +package app.aaps.wear.comm import android.annotation.TargetApi import android.app.Notification @@ -22,15 +22,15 @@ import app.aaps.core.interfaces.rx.events.EventWearDataToMobile import app.aaps.core.interfaces.rx.events.EventWearToMobile import app.aaps.core.interfaces.rx.weardata.EventData import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.wear.R +import app.aaps.wear.interaction.WatchfaceConfigurationActivity +import app.aaps.wear.interaction.actions.AcceptActivity +import app.aaps.wear.interaction.actions.ProfileSwitchActivity +import app.aaps.wear.interaction.utils.Persistence +import app.aaps.wear.tile.ActionsTileService +import app.aaps.wear.tile.QuickWizardTileService +import app.aaps.wear.tile.TempTargetTileService import com.google.android.gms.wearable.WearableListenerService -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.WatchfaceConfigurationActivity -import info.nightscout.androidaps.interaction.actions.AcceptActivity -import info.nightscout.androidaps.interaction.actions.ProfileSwitchActivity -import info.nightscout.androidaps.interaction.utils.Persistence -import info.nightscout.androidaps.tile.ActionsTileService -import info.nightscout.androidaps.tile.QuickWizardTileService -import info.nightscout.androidaps.tile.TempTargetTileService import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/wear/src/main/java/info/nightscout/androidaps/comm/DataLayerListenerServiceWear.kt b/wear/src/main/kotlin/app/aaps/wear/comm/DataLayerListenerServiceWear.kt similarity index 98% rename from wear/src/main/java/info/nightscout/androidaps/comm/DataLayerListenerServiceWear.kt rename to wear/src/main/kotlin/app/aaps/wear/comm/DataLayerListenerServiceWear.kt index 238e60ea67..11914555ad 100644 --- a/wear/src/main/java/info/nightscout/androidaps/comm/DataLayerListenerServiceWear.kt +++ b/wear/src/main/kotlin/app/aaps/wear/comm/DataLayerListenerServiceWear.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.comm +package app.aaps.wear.comm import android.app.NotificationManager import android.content.Intent @@ -13,6 +13,8 @@ import app.aaps.core.interfaces.rx.events.EventWearDataToMobile import app.aaps.core.interfaces.rx.events.EventWearToMobile import app.aaps.core.interfaces.rx.weardata.EventData import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.wear.interaction.utils.Persistence +import app.aaps.wear.interaction.utils.WearUtil import com.google.android.gms.tasks.Tasks import com.google.android.gms.wearable.CapabilityClient import com.google.android.gms.wearable.CapabilityInfo @@ -25,8 +27,6 @@ import com.google.android.gms.wearable.PutDataMapRequest import com.google.android.gms.wearable.Wearable import com.google.android.gms.wearable.WearableListenerService import dagger.android.AndroidInjection -import info.nightscout.androidaps.interaction.utils.Persistence -import info.nightscout.androidaps.interaction.utils.WearUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import kotlinx.coroutines.CancellationException diff --git a/wear/src/main/java/info/nightscout/androidaps/comm/ExceptionHandlerWear.kt b/wear/src/main/kotlin/app/aaps/wear/comm/ExceptionHandlerWear.kt similarity index 95% rename from wear/src/main/java/info/nightscout/androidaps/comm/ExceptionHandlerWear.kt rename to wear/src/main/kotlin/app/aaps/wear/comm/ExceptionHandlerWear.kt index 986ec34c24..5ff6468d70 100644 --- a/wear/src/main/java/info/nightscout/androidaps/comm/ExceptionHandlerWear.kt +++ b/wear/src/main/kotlin/app/aaps/wear/comm/ExceptionHandlerWear.kt @@ -1,70 +1,70 @@ -package info.nightscout.androidaps.comm - -import android.os.Build -import android.util.Log -import app.aaps.core.interfaces.rx.bus.RxBus -import app.aaps.core.interfaces.rx.events.EventWearToMobile -import app.aaps.core.interfaces.rx.weardata.EventData -import java.io.ByteArrayOutputStream -import java.io.IOException -import java.io.ObjectOutputStream -import javax.inject.Inject - -class ExceptionHandlerWear @Inject constructor( - private val rxBus: RxBus, -) { - - private var mDefaultUEH: Thread.UncaughtExceptionHandler? = null - - private val mWearUEH = Thread.UncaughtExceptionHandler { thread, ex -> - Log.d("WEAR", "uncaughtException :" + ex.message) - - // Pass the exception to the bus which will send the data upstream to your Smartphone/Tablet - val wearException = EventData.WearException( - timeStamp = System.currentTimeMillis(), - exception = exceptionToByteArray(ex), - board = Build.BOARD, - sdk = Build.VERSION.SDK_INT.toString(), - fingerprint = Build.FINGERPRINT, - model = Build.MODEL, - manufacturer = Build.MANUFACTURER, - product = Build.PRODUCT - ) - rxBus.send(EventWearToMobile(wearException)) - - // Let the default UncaughtExceptionHandler take it from here - mDefaultUEH?.uncaughtException(thread, ex) - } - - fun register() { - mDefaultUEH = Thread.getDefaultUncaughtExceptionHandler() - Thread.setDefaultUncaughtExceptionHandler(mWearUEH) - } - - private fun exceptionToByteArray(ex: Throwable): ByteArray { - ex.stackTrace // Make sure the stacktrace gets built up - val bos = ByteArrayOutputStream() - var oos: ObjectOutputStream? = null - try { - oos = ObjectOutputStream(bos) - oos.writeObject(ex) - return bos.toByteArray() - - } catch (e: IOException) { - e.printStackTrace() - } finally { - try { - oos?.close() - } catch (exx: IOException) { - // Ignore close exception - } - try { - bos.close() - } catch (exx: IOException) { - // Ignore close exception - } - } - return byteArrayOf() - } - -} +package app.aaps.wear.comm + +import android.os.Build +import android.util.Log +import app.aaps.core.interfaces.rx.bus.RxBus +import app.aaps.core.interfaces.rx.events.EventWearToMobile +import app.aaps.core.interfaces.rx.weardata.EventData +import java.io.ByteArrayOutputStream +import java.io.IOException +import java.io.ObjectOutputStream +import javax.inject.Inject + +class ExceptionHandlerWear @Inject constructor( + private val rxBus: RxBus, +) { + + private var mDefaultUEH: Thread.UncaughtExceptionHandler? = null + + private val mWearUEH = Thread.UncaughtExceptionHandler { thread, ex -> + Log.d("WEAR", "uncaughtException :" + ex.message) + + // Pass the exception to the bus which will send the data upstream to your Smartphone/Tablet + val wearException = EventData.WearException( + timeStamp = System.currentTimeMillis(), + exception = exceptionToByteArray(ex), + board = Build.BOARD, + sdk = Build.VERSION.SDK_INT.toString(), + fingerprint = Build.FINGERPRINT, + model = Build.MODEL, + manufacturer = Build.MANUFACTURER, + product = Build.PRODUCT + ) + rxBus.send(EventWearToMobile(wearException)) + + // Let the default UncaughtExceptionHandler take it from here + mDefaultUEH?.uncaughtException(thread, ex) + } + + fun register() { + mDefaultUEH = Thread.getDefaultUncaughtExceptionHandler() + Thread.setDefaultUncaughtExceptionHandler(mWearUEH) + } + + private fun exceptionToByteArray(ex: Throwable): ByteArray { + ex.stackTrace // Make sure the stacktrace gets built up + val bos = ByteArrayOutputStream() + var oos: ObjectOutputStream? = null + try { + oos = ObjectOutputStream(bos) + oos.writeObject(ex) + return bos.toByteArray() + + } catch (e: IOException) { + e.printStackTrace() + } finally { + try { + oos?.close() + } catch (exx: IOException) { + // Ignore close exception + } + try { + bos.close() + } catch (exx: IOException) { + // Ignore close exception + } + } + return byteArrayOf() + } + +} diff --git a/wear/src/main/java/info/nightscout/androidaps/comm/IntentCancelNotification.kt b/wear/src/main/kotlin/app/aaps/wear/comm/IntentCancelNotification.kt similarity index 88% rename from wear/src/main/java/info/nightscout/androidaps/comm/IntentCancelNotification.kt rename to wear/src/main/kotlin/app/aaps/wear/comm/IntentCancelNotification.kt index 3c8b557ceb..2efac6b4b4 100644 --- a/wear/src/main/java/info/nightscout/androidaps/comm/IntentCancelNotification.kt +++ b/wear/src/main/kotlin/app/aaps/wear/comm/IntentCancelNotification.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.comm +package app.aaps.wear.comm import android.content.Context import android.content.Intent diff --git a/wear/src/main/java/info/nightscout/androidaps/comm/IntentWearToMobile.kt b/wear/src/main/kotlin/app/aaps/wear/comm/IntentWearToMobile.kt similarity index 94% rename from wear/src/main/java/info/nightscout/androidaps/comm/IntentWearToMobile.kt rename to wear/src/main/kotlin/app/aaps/wear/comm/IntentWearToMobile.kt index 7ee0b94f82..faf93f77e9 100644 --- a/wear/src/main/java/info/nightscout/androidaps/comm/IntentWearToMobile.kt +++ b/wear/src/main/kotlin/app/aaps/wear/comm/IntentWearToMobile.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.comm +package app.aaps.wear.comm import android.content.Context import android.content.Intent diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/BaseComplicationProviderService.kt b/wear/src/main/kotlin/app/aaps/wear/complications/BaseComplicationProviderService.kt similarity index 95% rename from wear/src/main/java/info/nightscout/androidaps/complications/BaseComplicationProviderService.kt rename to wear/src/main/kotlin/app/aaps/wear/complications/BaseComplicationProviderService.kt index ccfa9e908d..60b2ff748d 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/BaseComplicationProviderService.kt +++ b/wear/src/main/kotlin/app/aaps/wear/complications/BaseComplicationProviderService.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.complications +package app.aaps.wear.complications import android.app.PendingIntent import android.content.BroadcastReceiver @@ -20,17 +20,17 @@ import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventWearToMobile import app.aaps.core.interfaces.rx.weardata.EventData.ActionResendData +import app.aaps.wear.R +import app.aaps.wear.comm.DataLayerListenerServiceWear.Companion.INTENT_NEW_DATA +import app.aaps.wear.complications.ComplicationTapBroadcastReceiver.Companion.getTapActionIntent +import app.aaps.wear.complications.ComplicationTapBroadcastReceiver.Companion.getTapWarningSinceIntent +import app.aaps.wear.data.RawDisplayData +import app.aaps.wear.interaction.utils.Constants +import app.aaps.wear.interaction.utils.DisplayFormat +import app.aaps.wear.interaction.utils.Inevitable +import app.aaps.wear.interaction.utils.Persistence +import app.aaps.wear.interaction.utils.WearUtil import dagger.android.AndroidInjection -import info.nightscout.androidaps.R -import info.nightscout.androidaps.comm.DataLayerListenerServiceWear.Companion.INTENT_NEW_DATA -import info.nightscout.androidaps.complications.ComplicationTapBroadcastReceiver.Companion.getTapActionIntent -import info.nightscout.androidaps.complications.ComplicationTapBroadcastReceiver.Companion.getTapWarningSinceIntent -import info.nightscout.androidaps.data.RawDisplayData -import info.nightscout.androidaps.interaction.utils.Constants -import info.nightscout.androidaps.interaction.utils.DisplayFormat -import info.nightscout.androidaps.interaction.utils.Inevitable -import info.nightscout.androidaps.interaction.utils.Persistence -import info.nightscout.androidaps.interaction.utils.WearUtil import javax.inject.Inject /** diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/BrCobIobComplication.kt b/wear/src/main/kotlin/app/aaps/wear/complications/BrCobIobComplication.kt similarity index 87% rename from wear/src/main/java/info/nightscout/androidaps/complications/BrCobIobComplication.kt rename to wear/src/main/kotlin/app/aaps/wear/complications/BrCobIobComplication.kt index 3870679499..6120b6db10 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/BrCobIobComplication.kt +++ b/wear/src/main/kotlin/app/aaps/wear/complications/BrCobIobComplication.kt @@ -1,15 +1,15 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.complications +package app.aaps.wear.complications import android.app.PendingIntent import android.support.wearable.complications.ComplicationData import android.support.wearable.complications.ComplicationText import app.aaps.core.interfaces.logging.LTag +import app.aaps.wear.data.RawDisplayData +import app.aaps.wear.interaction.utils.DisplayFormat +import app.aaps.wear.interaction.utils.SmallestDoubleString import dagger.android.AndroidInjection -import info.nightscout.androidaps.data.RawDisplayData -import info.nightscout.androidaps.interaction.utils.DisplayFormat -import info.nightscout.androidaps.interaction.utils.SmallestDoubleString import kotlin.math.max /* diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/CobDetailedComplication.kt b/wear/src/main/kotlin/app/aaps/wear/complications/CobDetailedComplication.kt similarity index 93% rename from wear/src/main/java/info/nightscout/androidaps/complications/CobDetailedComplication.kt rename to wear/src/main/kotlin/app/aaps/wear/complications/CobDetailedComplication.kt index a7234e6850..48527c14e2 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/CobDetailedComplication.kt +++ b/wear/src/main/kotlin/app/aaps/wear/complications/CobDetailedComplication.kt @@ -1,12 +1,12 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.complications +package app.aaps.wear.complications import android.app.PendingIntent import android.support.wearable.complications.ComplicationData import android.support.wearable.complications.ComplicationText import app.aaps.core.interfaces.logging.LTag -import info.nightscout.androidaps.data.RawDisplayData +import app.aaps.wear.data.RawDisplayData /* * Created by dlvoy on 2019-11-12 diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/CobIconComplication.kt b/wear/src/main/kotlin/app/aaps/wear/complications/CobIconComplication.kt similarity index 91% rename from wear/src/main/java/info/nightscout/androidaps/complications/CobIconComplication.kt rename to wear/src/main/kotlin/app/aaps/wear/complications/CobIconComplication.kt index b9ed4a7d98..b12692e67b 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/CobIconComplication.kt +++ b/wear/src/main/kotlin/app/aaps/wear/complications/CobIconComplication.kt @@ -1,14 +1,14 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.complications +package app.aaps.wear.complications import android.app.PendingIntent import android.graphics.drawable.Icon import android.support.wearable.complications.ComplicationData import android.support.wearable.complications.ComplicationText import app.aaps.core.interfaces.logging.LTag -import info.nightscout.androidaps.R -import info.nightscout.androidaps.data.RawDisplayData +import app.aaps.wear.R +import app.aaps.wear.data.RawDisplayData /* * Created by dlvoy on 2019-11-12 diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/CobIobComplication.kt b/wear/src/main/kotlin/app/aaps/wear/complications/CobIobComplication.kt similarity index 84% rename from wear/src/main/java/info/nightscout/androidaps/complications/CobIobComplication.kt rename to wear/src/main/kotlin/app/aaps/wear/complications/CobIobComplication.kt index f7c3c75cf1..9193e707f9 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/CobIobComplication.kt +++ b/wear/src/main/kotlin/app/aaps/wear/complications/CobIobComplication.kt @@ -1,14 +1,14 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.complications +package app.aaps.wear.complications import android.app.PendingIntent import android.support.wearable.complications.ComplicationData import android.support.wearable.complications.ComplicationText import app.aaps.core.interfaces.logging.LTag -import info.nightscout.androidaps.data.RawDisplayData -import info.nightscout.androidaps.interaction.utils.DisplayFormat -import info.nightscout.androidaps.interaction.utils.SmallestDoubleString +import app.aaps.wear.data.RawDisplayData +import app.aaps.wear.interaction.utils.DisplayFormat +import app.aaps.wear.interaction.utils.SmallestDoubleString /* * Created by dlvoy on 2019-11-12 diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/ComplicationAction.kt b/wear/src/main/kotlin/app/aaps/wear/complications/ComplicationAction.kt similarity index 68% rename from wear/src/main/java/info/nightscout/androidaps/complications/ComplicationAction.kt rename to wear/src/main/kotlin/app/aaps/wear/complications/ComplicationAction.kt index 5ad6c80ee7..0bfd241596 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/ComplicationAction.kt +++ b/wear/src/main/kotlin/app/aaps/wear/complications/ComplicationAction.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.complications +package app.aaps.wear.complications enum class ComplicationAction { NONE, MENU, WIZARD, BOLUS, E_CARB, STATUS, WARNING_SYNC, WARNING_OLD diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/ComplicationTapBroadcastReceiver.kt b/wear/src/main/kotlin/app/aaps/wear/complications/ComplicationTapBroadcastReceiver.kt similarity index 91% rename from wear/src/main/java/info/nightscout/androidaps/complications/ComplicationTapBroadcastReceiver.kt rename to wear/src/main/kotlin/app/aaps/wear/complications/ComplicationTapBroadcastReceiver.kt index a0e43a27db..8a34dc7a9c 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/ComplicationTapBroadcastReceiver.kt +++ b/wear/src/main/kotlin/app/aaps/wear/complications/ComplicationTapBroadcastReceiver.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.complications +package app.aaps.wear.complications import android.app.PendingIntent import android.content.ComponentName @@ -12,16 +12,16 @@ import androidx.annotation.StringRes import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.wear.R +import app.aaps.wear.interaction.actions.ECarbActivity +import app.aaps.wear.interaction.actions.TreatmentActivity +import app.aaps.wear.interaction.actions.WizardActivity +import app.aaps.wear.interaction.menus.MainMenuActivity +import app.aaps.wear.interaction.menus.StatusMenuActivity +import app.aaps.wear.interaction.utils.Constants +import app.aaps.wear.interaction.utils.DisplayFormat +import app.aaps.wear.interaction.utils.WearUtil import dagger.android.DaggerBroadcastReceiver -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.actions.ECarbActivity -import info.nightscout.androidaps.interaction.actions.TreatmentActivity -import info.nightscout.androidaps.interaction.actions.WizardActivity -import info.nightscout.androidaps.interaction.menus.MainMenuActivity -import info.nightscout.androidaps.interaction.menus.StatusMenuActivity -import info.nightscout.androidaps.interaction.utils.Constants -import info.nightscout.androidaps.interaction.utils.DisplayFormat -import info.nightscout.androidaps.interaction.utils.WearUtil import javax.inject.Inject /* diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/IobDetailedComplication.kt b/wear/src/main/kotlin/app/aaps/wear/complications/IobDetailedComplication.kt similarity index 93% rename from wear/src/main/java/info/nightscout/androidaps/complications/IobDetailedComplication.kt rename to wear/src/main/kotlin/app/aaps/wear/complications/IobDetailedComplication.kt index 7f49b8b46b..5addf73ae2 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/IobDetailedComplication.kt +++ b/wear/src/main/kotlin/app/aaps/wear/complications/IobDetailedComplication.kt @@ -1,12 +1,12 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.complications +package app.aaps.wear.complications import android.app.PendingIntent import android.support.wearable.complications.ComplicationData import android.support.wearable.complications.ComplicationText import app.aaps.core.interfaces.logging.LTag -import info.nightscout.androidaps.data.RawDisplayData +import app.aaps.wear.data.RawDisplayData /* * Created by dlvoy on 2019-11-12 diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/IobIconComplication.kt b/wear/src/main/kotlin/app/aaps/wear/complications/IobIconComplication.kt similarity index 84% rename from wear/src/main/java/info/nightscout/androidaps/complications/IobIconComplication.kt rename to wear/src/main/kotlin/app/aaps/wear/complications/IobIconComplication.kt index 24db065872..804550298c 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/IobIconComplication.kt +++ b/wear/src/main/kotlin/app/aaps/wear/complications/IobIconComplication.kt @@ -1,16 +1,16 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.complications +package app.aaps.wear.complications import android.app.PendingIntent import android.graphics.drawable.Icon import android.support.wearable.complications.ComplicationData import android.support.wearable.complications.ComplicationText import app.aaps.core.interfaces.logging.LTag -import info.nightscout.androidaps.R -import info.nightscout.androidaps.data.RawDisplayData -import info.nightscout.androidaps.interaction.utils.DisplayFormat -import info.nightscout.androidaps.interaction.utils.SmallestDoubleString +import app.aaps.wear.R +import app.aaps.wear.data.RawDisplayData +import app.aaps.wear.interaction.utils.DisplayFormat +import app.aaps.wear.interaction.utils.SmallestDoubleString /* * Created by dlvoy on 2019-11-12 diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/LongStatusComplication.kt b/wear/src/main/kotlin/app/aaps/wear/complications/LongStatusComplication.kt similarity index 94% rename from wear/src/main/java/info/nightscout/androidaps/complications/LongStatusComplication.kt rename to wear/src/main/kotlin/app/aaps/wear/complications/LongStatusComplication.kt index 308047b0cb..ad8567066a 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/LongStatusComplication.kt +++ b/wear/src/main/kotlin/app/aaps/wear/complications/LongStatusComplication.kt @@ -1,13 +1,13 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.complications +package app.aaps.wear.complications import android.app.PendingIntent import android.support.wearable.complications.ComplicationData import android.support.wearable.complications.ComplicationText import app.aaps.core.interfaces.logging.LTag +import app.aaps.wear.data.RawDisplayData import dagger.android.AndroidInjection -import info.nightscout.androidaps.data.RawDisplayData /* * Created by dlvoy on 2019-11-12 diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/LongStatusFlippedComplication.kt b/wear/src/main/kotlin/app/aaps/wear/complications/LongStatusFlippedComplication.kt similarity index 94% rename from wear/src/main/java/info/nightscout/androidaps/complications/LongStatusFlippedComplication.kt rename to wear/src/main/kotlin/app/aaps/wear/complications/LongStatusFlippedComplication.kt index 179d4017f2..e5107094e0 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/LongStatusFlippedComplication.kt +++ b/wear/src/main/kotlin/app/aaps/wear/complications/LongStatusFlippedComplication.kt @@ -1,13 +1,13 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.complications +package app.aaps.wear.complications import android.app.PendingIntent import android.support.wearable.complications.ComplicationData import android.support.wearable.complications.ComplicationText import app.aaps.core.interfaces.logging.LTag +import app.aaps.wear.data.RawDisplayData import dagger.android.AndroidInjection -import info.nightscout.androidaps.data.RawDisplayData /* * Created by dlvoy on 2019-11-12 diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/SgvComplication.kt b/wear/src/main/kotlin/app/aaps/wear/complications/SgvComplication.kt similarity index 93% rename from wear/src/main/java/info/nightscout/androidaps/complications/SgvComplication.kt rename to wear/src/main/kotlin/app/aaps/wear/complications/SgvComplication.kt index fd6c1b3fb1..ede42b0bba 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/SgvComplication.kt +++ b/wear/src/main/kotlin/app/aaps/wear/complications/SgvComplication.kt @@ -1,13 +1,13 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.complications +package app.aaps.wear.complications import android.app.PendingIntent import android.support.wearable.complications.ComplicationData import android.support.wearable.complications.ComplicationText import app.aaps.core.interfaces.logging.LTag +import app.aaps.wear.data.RawDisplayData import dagger.android.AndroidInjection -import info.nightscout.androidaps.data.RawDisplayData /* * Created by dlvoy on 2019-11-12 diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/UploaderBatteryComplication.kt b/wear/src/main/kotlin/app/aaps/wear/complications/UploaderBatteryComplication.kt similarity index 97% rename from wear/src/main/java/info/nightscout/androidaps/complications/UploaderBatteryComplication.kt rename to wear/src/main/kotlin/app/aaps/wear/complications/UploaderBatteryComplication.kt index 1db261478f..d540205600 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/UploaderBatteryComplication.kt +++ b/wear/src/main/kotlin/app/aaps/wear/complications/UploaderBatteryComplication.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.complications +package app.aaps.wear.complications import android.app.PendingIntent import android.graphics.drawable.Icon @@ -8,8 +8,8 @@ import android.support.wearable.complications.ComplicationData import android.support.wearable.complications.ComplicationText import androidx.annotation.DrawableRes import app.aaps.core.interfaces.logging.LTag -import info.nightscout.androidaps.R -import info.nightscout.androidaps.data.RawDisplayData +import app.aaps.wear.R +import app.aaps.wear.data.RawDisplayData import kotlin.math.floor import kotlin.math.max import kotlin.math.min diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/WallpaperComplication.kt b/wear/src/main/kotlin/app/aaps/wear/complications/WallpaperComplication.kt similarity index 94% rename from wear/src/main/java/info/nightscout/androidaps/complications/WallpaperComplication.kt rename to wear/src/main/kotlin/app/aaps/wear/complications/WallpaperComplication.kt index d4ea563947..559ecc3160 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/WallpaperComplication.kt +++ b/wear/src/main/kotlin/app/aaps/wear/complications/WallpaperComplication.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.complications +package app.aaps.wear.complications import android.app.PendingIntent import android.graphics.Bitmap @@ -10,7 +10,7 @@ import android.support.wearable.complications.ComplicationData import android.util.DisplayMetrics import android.view.WindowManager import app.aaps.core.interfaces.logging.LTag -import info.nightscout.androidaps.data.RawDisplayData +import app.aaps.wear.data.RawDisplayData import java.io.IOException /* diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/WallpaperDarkComplication.kt b/wear/src/main/kotlin/app/aaps/wear/complications/WallpaperDarkComplication.kt similarity index 88% rename from wear/src/main/java/info/nightscout/androidaps/complications/WallpaperDarkComplication.kt rename to wear/src/main/kotlin/app/aaps/wear/complications/WallpaperDarkComplication.kt index ccc6159694..1e469b3140 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/WallpaperDarkComplication.kt +++ b/wear/src/main/kotlin/app/aaps/wear/complications/WallpaperDarkComplication.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.complications +package app.aaps.wear.complications /* * Created by dlvoy on 2019-11-12 diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/WallpaperGrayComplication.kt b/wear/src/main/kotlin/app/aaps/wear/complications/WallpaperGrayComplication.kt similarity index 88% rename from wear/src/main/java/info/nightscout/androidaps/complications/WallpaperGrayComplication.kt rename to wear/src/main/kotlin/app/aaps/wear/complications/WallpaperGrayComplication.kt index ff2028d01b..029d7a64db 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/WallpaperGrayComplication.kt +++ b/wear/src/main/kotlin/app/aaps/wear/complications/WallpaperGrayComplication.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.complications +package app.aaps.wear.complications /* * Created by dlvoy on 2019-11-12 diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/WallpaperLightComplication.kt b/wear/src/main/kotlin/app/aaps/wear/complications/WallpaperLightComplication.kt similarity index 88% rename from wear/src/main/java/info/nightscout/androidaps/complications/WallpaperLightComplication.kt rename to wear/src/main/kotlin/app/aaps/wear/complications/WallpaperLightComplication.kt index 9ac71e953a..22dc797469 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/WallpaperLightComplication.kt +++ b/wear/src/main/kotlin/app/aaps/wear/complications/WallpaperLightComplication.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.complications +package app.aaps.wear.complications /* * Created by dlvoy on 2019-11-12 diff --git a/wear/src/main/java/info/nightscout/androidaps/data/RawDisplayData.kt b/wear/src/main/kotlin/app/aaps/wear/data/RawDisplayData.kt similarity index 94% rename from wear/src/main/java/info/nightscout/androidaps/data/RawDisplayData.kt rename to wear/src/main/kotlin/app/aaps/wear/data/RawDisplayData.kt index f692831d53..14678b2135 100644 --- a/wear/src/main/java/info/nightscout/androidaps/data/RawDisplayData.kt +++ b/wear/src/main/kotlin/app/aaps/wear/data/RawDisplayData.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.data +package app.aaps.wear.data import app.aaps.core.interfaces.rx.weardata.EventData -import info.nightscout.androidaps.interaction.utils.Persistence +import app.aaps.wear.interaction.utils.Persistence /** * Holds bunch of data model variables and lists that arrive from phone app and are due to be diff --git a/wear/src/main/java/info/nightscout/androidaps/di/WearActivitiesModule.kt b/wear/src/main/kotlin/app/aaps/wear/di/WearActivitiesModule.kt similarity index 63% rename from wear/src/main/java/info/nightscout/androidaps/di/WearActivitiesModule.kt rename to wear/src/main/kotlin/app/aaps/wear/di/WearActivitiesModule.kt index dac10f8011..8e5c5c6078 100644 --- a/wear/src/main/java/info/nightscout/androidaps/di/WearActivitiesModule.kt +++ b/wear/src/main/kotlin/app/aaps/wear/di/WearActivitiesModule.kt @@ -1,16 +1,26 @@ -package info.nightscout.androidaps.di +package app.aaps.wear.di +import app.aaps.wear.interaction.ConfigurationActivity +import app.aaps.wear.interaction.TileConfigurationActivity +import app.aaps.wear.interaction.actions.AcceptActivity +import app.aaps.wear.interaction.actions.BackgroundActionActivity +import app.aaps.wear.interaction.actions.BolusActivity +import app.aaps.wear.interaction.actions.CarbActivity +import app.aaps.wear.interaction.actions.ECarbActivity +import app.aaps.wear.interaction.actions.FillActivity +import app.aaps.wear.interaction.actions.ProfileSwitchActivity +import app.aaps.wear.interaction.actions.QuickSnoozeActivity +import app.aaps.wear.interaction.actions.TempTargetActivity +import app.aaps.wear.interaction.actions.TreatmentActivity +import app.aaps.wear.interaction.actions.ViewSelectorActivity +import app.aaps.wear.interaction.actions.WizardActivity +import app.aaps.wear.interaction.menus.FillMenuActivity +import app.aaps.wear.interaction.menus.MainMenuActivity +import app.aaps.wear.interaction.menus.PreferenceMenuActivity +import app.aaps.wear.interaction.menus.StatusMenuActivity +import app.aaps.wear.interaction.utils.MenuListActivity import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.androidaps.interaction.actions.QuickSnoozeActivity -import info.nightscout.androidaps.interaction.ConfigurationActivity -import info.nightscout.androidaps.interaction.TileConfigurationActivity -import info.nightscout.androidaps.interaction.actions.* -import info.nightscout.androidaps.interaction.menus.FillMenuActivity -import info.nightscout.androidaps.interaction.menus.MainMenuActivity -import info.nightscout.androidaps.interaction.menus.PreferenceMenuActivity -import info.nightscout.androidaps.interaction.menus.StatusMenuActivity -import info.nightscout.androidaps.interaction.utils.MenuListActivity @Module @Suppress("unused") diff --git a/wear/src/main/java/info/nightscout/androidaps/di/WearComponent.kt b/wear/src/main/kotlin/app/aaps/wear/di/WearComponent.kt similarity index 86% rename from wear/src/main/java/info/nightscout/androidaps/di/WearComponent.kt rename to wear/src/main/kotlin/app/aaps/wear/di/WearComponent.kt index 8a27a7719d..5b81047595 100644 --- a/wear/src/main/java/info/nightscout/androidaps/di/WearComponent.kt +++ b/wear/src/main/kotlin/app/aaps/wear/di/WearComponent.kt @@ -1,10 +1,10 @@ -package info.nightscout.androidaps.di +package app.aaps.wear.di +import app.aaps.wear.WearApp import dagger.BindsInstance import dagger.Component import dagger.android.AndroidInjectionModule import dagger.android.AndroidInjector -import info.nightscout.androidaps.WearApp import javax.inject.Singleton @Singleton diff --git a/wear/src/main/java/info/nightscout/androidaps/di/WearModule.kt b/wear/src/main/kotlin/app/aaps/wear/di/WearModule.kt similarity index 88% rename from wear/src/main/java/info/nightscout/androidaps/di/WearModule.kt rename to wear/src/main/kotlin/app/aaps/wear/di/WearModule.kt index 78e7cf7985..a3267870be 100644 --- a/wear/src/main/java/info/nightscout/androidaps/di/WearModule.kt +++ b/wear/src/main/kotlin/app/aaps/wear/di/WearModule.kt @@ -1,12 +1,12 @@ -package info.nightscout.androidaps.di +package app.aaps.wear.di import android.content.Context import app.aaps.shared.impl.di.SharedImplModule +import app.aaps.wear.WearApp import dagger.Binds import dagger.Module import dagger.Provides import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.WearApp import kotlinx.datetime.Clock @Suppress("unused") diff --git a/wear/src/main/java/info/nightscout/androidaps/di/WearServicesModule.kt b/wear/src/main/kotlin/app/aaps/wear/di/WearServicesModule.kt similarity index 65% rename from wear/src/main/java/info/nightscout/androidaps/di/WearServicesModule.kt rename to wear/src/main/kotlin/app/aaps/wear/di/WearServicesModule.kt index 3cc8baa387..ea11f0b81c 100644 --- a/wear/src/main/java/info/nightscout/androidaps/di/WearServicesModule.kt +++ b/wear/src/main/kotlin/app/aaps/wear/di/WearServicesModule.kt @@ -1,13 +1,37 @@ -package info.nightscout.androidaps.di +package app.aaps.wear.di +import app.aaps.wear.comm.DataLayerListenerServiceWear +import app.aaps.wear.complications.BaseComplicationProviderService +import app.aaps.wear.complications.BrCobIobComplication +import app.aaps.wear.complications.CobDetailedComplication +import app.aaps.wear.complications.CobIconComplication +import app.aaps.wear.complications.CobIobComplication +import app.aaps.wear.complications.ComplicationTapBroadcastReceiver +import app.aaps.wear.complications.IobDetailedComplication +import app.aaps.wear.complications.IobIconComplication +import app.aaps.wear.complications.LongStatusComplication +import app.aaps.wear.complications.LongStatusFlippedComplication +import app.aaps.wear.complications.SgvComplication +import app.aaps.wear.complications.UploaderBatteryComplication +import app.aaps.wear.complications.WallpaperComplication +import app.aaps.wear.heartrate.HeartRateListener +import app.aaps.wear.tile.ActionsTileService +import app.aaps.wear.tile.QuickWizardTileService +import app.aaps.wear.tile.TempTargetTileService +import app.aaps.wear.tile.TileBase +import app.aaps.wear.watchfaces.AapsLargeWatchface +import app.aaps.wear.watchfaces.AapsV2Watchface +import app.aaps.wear.watchfaces.AapsWatchface +import app.aaps.wear.watchfaces.BigChartWatchface +import app.aaps.wear.watchfaces.CircleWatchface +import app.aaps.wear.watchfaces.CockpitWatchface +import app.aaps.wear.watchfaces.CustomWatchface +import app.aaps.wear.watchfaces.DigitalStyleWatchface +import app.aaps.wear.watchfaces.NoChartWatchface +import app.aaps.wear.watchfaces.SteampunkWatchface +import app.aaps.wear.watchfaces.utils.BaseWatchFace import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.androidaps.comm.DataLayerListenerServiceWear -import info.nightscout.androidaps.complications.* -import info.nightscout.androidaps.heartrate.HeartRateListener -import info.nightscout.androidaps.tile.* -import info.nightscout.androidaps.watchfaces.* -import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace @Module @Suppress("unused") @@ -36,7 +60,6 @@ abstract class WearServicesModule { @ContributesAndroidInjector abstract fun contributesSteampunk(): SteampunkWatchface @ContributesAndroidInjector abstract fun contributesDigitalStyleWatchface(): DigitalStyleWatchface @ContributesAndroidInjector abstract fun contributesCockpitWatchface(): CockpitWatchface - @ContributesAndroidInjector abstract fun contributesBIGChart(): BigChartWatchface @ContributesAndroidInjector abstract fun contributesNOChart(): NoChartWatchface @ContributesAndroidInjector abstract fun contributesCircleWatchface(): CircleWatchface diff --git a/wear/src/main/java/info/nightscout/androidaps/events/EventWearPreferenceChange.kt b/wear/src/main/kotlin/app/aaps/wear/events/EventWearPreferenceChange.kt similarity index 92% rename from wear/src/main/java/info/nightscout/androidaps/events/EventWearPreferenceChange.kt rename to wear/src/main/kotlin/app/aaps/wear/events/EventWearPreferenceChange.kt index 2c1bf496cc..693fabfd81 100644 --- a/wear/src/main/java/info/nightscout/androidaps/events/EventWearPreferenceChange.kt +++ b/wear/src/main/kotlin/app/aaps/wear/events/EventWearPreferenceChange.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.events +package app.aaps.wear.events import android.content.Context import app.aaps.core.interfaces.rx.events.Event diff --git a/wear/src/main/java/info/nightscout/androidaps/heartrate/HeartRateListener.kt b/wear/src/main/kotlin/app/aaps/wear/heartrate/HeartRateListener.kt similarity index 98% rename from wear/src/main/java/info/nightscout/androidaps/heartrate/HeartRateListener.kt rename to wear/src/main/kotlin/app/aaps/wear/heartrate/HeartRateListener.kt index 37ac13bcf7..4679813a06 100644 --- a/wear/src/main/java/info/nightscout/androidaps/heartrate/HeartRateListener.kt +++ b/wear/src/main/kotlin/app/aaps/wear/heartrate/HeartRateListener.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.heartrate +package app.aaps.wear.heartrate import android.content.Context import android.content.Context.SENSOR_SERVICE @@ -12,7 +12,7 @@ import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.rx.AapsSchedulers import app.aaps.core.interfaces.rx.weardata.EventData -import info.nightscout.androidaps.comm.IntentWearToMobile +import app.aaps.wear.comm.IntentWearToMobile import io.reactivex.rxjava3.disposables.Disposable import java.util.concurrent.TimeUnit import java.util.concurrent.locks.ReentrantLock diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/ConfigurationActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/ConfigurationActivity.kt similarity index 94% rename from wear/src/main/java/info/nightscout/androidaps/interaction/ConfigurationActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/ConfigurationActivity.kt index b29a6c3f58..6c6d6d1ff1 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/ConfigurationActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/ConfigurationActivity.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.interaction +package app.aaps.wear.interaction import android.os.Bundle import android.view.View @@ -6,8 +6,8 @@ import android.view.ViewGroup import androidx.core.content.ContextCompat import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag +import app.aaps.wear.R import dagger.android.AndroidInjection -import info.nightscout.androidaps.R import preference.WearPreferenceActivity import javax.inject.Inject diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/TileConfigurationActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/TileConfigurationActivity.kt similarity index 92% rename from wear/src/main/java/info/nightscout/androidaps/interaction/TileConfigurationActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/TileConfigurationActivity.kt index ad2a06c8b4..e6f6f93a54 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/TileConfigurationActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/TileConfigurationActivity.kt @@ -1,13 +1,13 @@ -package info.nightscout.androidaps.interaction +package app.aaps.wear.interaction import android.os.Bundle import android.view.ViewGroup import androidx.wear.tiles.TileService import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag +import app.aaps.wear.tile.ActionsTileService +import app.aaps.wear.tile.TempTargetTileService import dagger.android.AndroidInjection -import info.nightscout.androidaps.tile.ActionsTileService -import info.nightscout.androidaps.tile.TempTargetTileService import preference.WearPreferenceActivity import javax.inject.Inject diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/WatchfaceConfigurationActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/WatchfaceConfigurationActivity.kt similarity index 97% rename from wear/src/main/java/info/nightscout/androidaps/interaction/WatchfaceConfigurationActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/WatchfaceConfigurationActivity.kt index 946d2f87db..e22f825dcc 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/WatchfaceConfigurationActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/WatchfaceConfigurationActivity.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.interaction +package app.aaps.wear.interaction import android.Manifest import android.content.SharedPreferences @@ -11,7 +11,7 @@ import androidx.core.content.ContextCompat import androidx.preference.PreferenceManager import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag -import info.nightscout.androidaps.R +import app.aaps.wear.R import preference.WearPreferenceActivity import javax.inject.Inject diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/AcceptActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/AcceptActivity.kt similarity index 92% rename from wear/src/main/java/info/nightscout/androidaps/interaction/actions/AcceptActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/actions/AcceptActivity.kt index fcdd45b818..0f762c08dc 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/AcceptActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/AcceptActivity.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.interaction.actions +package app.aaps.wear.interaction.actions import android.content.Intent import android.os.Bundle @@ -16,11 +16,11 @@ import android.widget.TextView import androidx.core.view.InputDeviceCompat import androidx.core.view.MotionEventCompat import androidx.core.view.ViewConfigurationCompat -import info.nightscout.androidaps.R -import info.nightscout.androidaps.comm.DataLayerListenerServiceWear -import info.nightscout.androidaps.comm.IntentCancelNotification -import info.nightscout.androidaps.comm.IntentWearToMobile -import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated +import app.aaps.wear.R +import app.aaps.wear.comm.DataLayerListenerServiceWear +import app.aaps.wear.comm.IntentCancelNotification +import app.aaps.wear.comm.IntentWearToMobile +import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated import kotlin.math.roundToInt class AcceptActivity : ViewSelectorActivity() { diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/BackgroundActionActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/BackgroundActionActivity.kt similarity index 90% rename from wear/src/main/java/info/nightscout/androidaps/interaction/actions/BackgroundActionActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/actions/BackgroundActionActivity.kt index 01713b5fd6..01949a6ad6 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/BackgroundActionActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/BackgroundActionActivity.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.interaction.actions +package app.aaps.wear.interaction.actions import android.os.Bundle import android.widget.Toast @@ -7,8 +7,8 @@ import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventWearToMobile import app.aaps.core.interfaces.rx.weardata.EventData +import app.aaps.wear.comm.DataLayerListenerServiceWear import dagger.android.DaggerActivity -import info.nightscout.androidaps.comm.DataLayerListenerServiceWear import javax.inject.Inject class BackgroundActionActivity : DaggerActivity() { diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/BolusActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/BolusActivity.kt similarity index 90% rename from wear/src/main/java/info/nightscout/androidaps/interaction/actions/BolusActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/actions/BolusActivity.kt index 580e17db4f..99085c6470 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/BolusActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/BolusActivity.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.interaction.actions +package app.aaps.wear.interaction.actions import android.os.Bundle import android.view.LayoutInflater @@ -10,10 +10,10 @@ import android.widget.ImageView import app.aaps.core.interfaces.rx.events.EventWearToMobile import app.aaps.core.interfaces.rx.weardata.EventData.ActionBolusPreCheck import app.aaps.core.interfaces.utils.SafeParse -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.utils.EditPlusMinusViewAdapter -import info.nightscout.androidaps.interaction.utils.PlusMinusEditText -import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated +import app.aaps.wear.R +import app.aaps.wear.interaction.utils.EditPlusMinusViewAdapter +import app.aaps.wear.interaction.utils.PlusMinusEditText +import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated import java.text.DecimalFormat import kotlin.math.roundToInt diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/CarbActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/CarbActivity.kt similarity index 90% rename from wear/src/main/java/info/nightscout/androidaps/interaction/actions/CarbActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/actions/CarbActivity.kt index 4b5a838cba..2d78768194 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/CarbActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/CarbActivity.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.interaction.actions +package app.aaps.wear.interaction.actions import android.os.Bundle import android.view.LayoutInflater @@ -10,10 +10,10 @@ import android.widget.ImageView import app.aaps.core.interfaces.rx.events.EventWearToMobile import app.aaps.core.interfaces.rx.weardata.EventData.ActionECarbsPreCheck import app.aaps.core.interfaces.utils.SafeParse -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.utils.EditPlusMinusViewAdapter -import info.nightscout.androidaps.interaction.utils.PlusMinusEditText -import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated +import app.aaps.wear.R +import app.aaps.wear.interaction.utils.EditPlusMinusViewAdapter +import app.aaps.wear.interaction.utils.PlusMinusEditText +import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated import java.text.DecimalFormat class CarbActivity : ViewSelectorActivity() { diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ECarbActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/ECarbActivity.kt similarity index 93% rename from wear/src/main/java/info/nightscout/androidaps/interaction/actions/ECarbActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/actions/ECarbActivity.kt index 5a5e141ef8..537139ceb1 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ECarbActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/ECarbActivity.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.interaction.actions +package app.aaps.wear.interaction.actions import android.os.Bundle import android.view.LayoutInflater @@ -11,10 +11,10 @@ import app.aaps.core.interfaces.rx.events.EventWearToMobile import app.aaps.core.interfaces.rx.weardata.EventData.ActionECarbsPreCheck import app.aaps.core.interfaces.utils.SafeParse.stringToDouble import app.aaps.core.interfaces.utils.SafeParse.stringToInt -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.utils.EditPlusMinusViewAdapter -import info.nightscout.androidaps.interaction.utils.PlusMinusEditText -import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated +import app.aaps.wear.R +import app.aaps.wear.interaction.utils.EditPlusMinusViewAdapter +import app.aaps.wear.interaction.utils.PlusMinusEditText +import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated import java.text.DecimalFormat class ECarbActivity : ViewSelectorActivity() { diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/FillActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/FillActivity.kt similarity index 89% rename from wear/src/main/java/info/nightscout/androidaps/interaction/actions/FillActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/actions/FillActivity.kt index 7aea8b1dcc..344af1c8a1 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/FillActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/FillActivity.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.interaction.actions +package app.aaps.wear.interaction.actions import android.os.Bundle import android.view.LayoutInflater @@ -10,10 +10,10 @@ import android.widget.ImageView import app.aaps.core.interfaces.rx.events.EventWearToMobile import app.aaps.core.interfaces.rx.weardata.EventData.ActionFillPreCheck import app.aaps.core.interfaces.utils.SafeParse.stringToDouble -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.utils.EditPlusMinusViewAdapter -import info.nightscout.androidaps.interaction.utils.PlusMinusEditText -import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated +import app.aaps.wear.R +import app.aaps.wear.interaction.utils.EditPlusMinusViewAdapter +import app.aaps.wear.interaction.utils.PlusMinusEditText +import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated import java.text.DecimalFormat class FillActivity : ViewSelectorActivity() { diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ProfileSwitchActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/ProfileSwitchActivity.kt similarity index 92% rename from wear/src/main/java/info/nightscout/androidaps/interaction/actions/ProfileSwitchActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/actions/ProfileSwitchActivity.kt index 67a5fa20d9..b7c543bdbb 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ProfileSwitchActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/ProfileSwitchActivity.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.interaction.actions +package app.aaps.wear.interaction.actions import android.os.Bundle import android.view.LayoutInflater @@ -10,10 +10,10 @@ import android.widget.ImageView import app.aaps.core.interfaces.rx.events.EventWearToMobile import app.aaps.core.interfaces.rx.weardata.EventData.ActionProfileSwitchPreCheck import app.aaps.core.interfaces.utils.SafeParse -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.utils.EditPlusMinusViewAdapter -import info.nightscout.androidaps.interaction.utils.PlusMinusEditText -import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated +import app.aaps.wear.R +import app.aaps.wear.interaction.utils.EditPlusMinusViewAdapter +import app.aaps.wear.interaction.utils.PlusMinusEditText +import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated import java.text.DecimalFormat class ProfileSwitchActivity : ViewSelectorActivity() { diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/QuickSnoozeActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/QuickSnoozeActivity.kt similarity index 92% rename from wear/src/main/java/info/nightscout/androidaps/interaction/actions/QuickSnoozeActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/actions/QuickSnoozeActivity.kt index 6f4d237560..70a06d8918 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/QuickSnoozeActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/QuickSnoozeActivity.kt @@ -1,54 +1,54 @@ -package info.nightscout.androidaps.interaction.actions - -import android.content.Intent -import android.content.pm.PackageManager -import android.os.Bundle -import android.util.Log -import android.widget.Toast -import app.aaps.core.interfaces.rx.bus.RxBus -import app.aaps.core.interfaces.rx.events.EventWearToMobile -import app.aaps.core.interfaces.rx.weardata.EventData -import app.aaps.shared.impl.extensions.safeGetPackageInfo -import dagger.android.DaggerActivity -import info.nightscout.androidaps.R -import javax.inject.Inject - -/** - * Send a snooze request to silence any alarm. Designed to be bound to a button for fast access - */ - -class QuickSnoozeActivity : DaggerActivity() { - - @Inject lateinit var rxBus: RxBus - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - Toast.makeText(this, R.string.sending_snooze, Toast.LENGTH_LONG).show() - rxBus.send(EventWearToMobile(EventData.SnoozeAlert(System.currentTimeMillis()))) - - val xDripPackageName = "com.eveningoutpost.dexdrip" - if (isPackageExisted(xDripPackageName)) { - try { - val i = Intent() - i.setClassName(xDripPackageName, "$xDripPackageName.QuickSnooze") - startActivity(i) - } catch (e: Exception) { - Log.e("WEAR", "failed to snooze xDrip: ", e) - } - } else { - Log.d("WEAR", "Package $xDripPackageName not available for snooze") - } - - finish() - } - - @Suppress("SameParameterValue") - private fun isPackageExisted(targetPackage: String): Boolean { - try { - packageManager.safeGetPackageInfo(targetPackage, 0) - } catch (e: PackageManager.NameNotFoundException) { - return false - } - return true - } -} +package app.aaps.wear.interaction.actions + +import android.content.Intent +import android.content.pm.PackageManager +import android.os.Bundle +import android.util.Log +import android.widget.Toast +import app.aaps.core.interfaces.rx.bus.RxBus +import app.aaps.core.interfaces.rx.events.EventWearToMobile +import app.aaps.core.interfaces.rx.weardata.EventData +import app.aaps.shared.impl.extensions.safeGetPackageInfo +import app.aaps.wear.R +import dagger.android.DaggerActivity +import javax.inject.Inject + +/** + * Send a snooze request to silence any alarm. Designed to be bound to a button for fast access + */ + +class QuickSnoozeActivity : DaggerActivity() { + + @Inject lateinit var rxBus: RxBus + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + Toast.makeText(this, R.string.sending_snooze, Toast.LENGTH_LONG).show() + rxBus.send(EventWearToMobile(EventData.SnoozeAlert(System.currentTimeMillis()))) + + val xDripPackageName = "com.eveningoutpost.dexdrip" + if (isPackageExisted(xDripPackageName)) { + try { + val i = Intent() + i.setClassName(xDripPackageName, "$xDripPackageName.QuickSnooze") + startActivity(i) + } catch (e: Exception) { + Log.e("WEAR", "failed to snooze xDrip: ", e) + } + } else { + Log.d("WEAR", "Package $xDripPackageName not available for snooze") + } + + finish() + } + + @Suppress("SameParameterValue") + private fun isPackageExisted(targetPackage: String): Boolean { + try { + packageManager.safeGetPackageInfo(targetPackage, 0) + } catch (e: PackageManager.NameNotFoundException) { + return false + } + return true + } +} diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/TempTargetActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/TempTargetActivity.kt similarity index 94% rename from wear/src/main/java/info/nightscout/androidaps/interaction/actions/TempTargetActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/actions/TempTargetActivity.kt index 667ec73703..b7a3cb1422 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/TempTargetActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/TempTargetActivity.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.interaction.actions +package app.aaps.wear.interaction.actions import android.os.Bundle import android.view.LayoutInflater @@ -10,10 +10,10 @@ import android.widget.ImageView import app.aaps.core.interfaces.rx.events.EventWearToMobile import app.aaps.core.interfaces.rx.weardata.EventData.ActionTempTargetPreCheck import app.aaps.core.interfaces.utils.SafeParse -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.utils.EditPlusMinusViewAdapter -import info.nightscout.androidaps.interaction.utils.PlusMinusEditText -import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated +import app.aaps.wear.R +import app.aaps.wear.interaction.utils.EditPlusMinusViewAdapter +import app.aaps.wear.interaction.utils.PlusMinusEditText +import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated import java.text.DecimalFormat class TempTargetActivity : ViewSelectorActivity() { diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/TreatmentActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/TreatmentActivity.kt similarity index 93% rename from wear/src/main/java/info/nightscout/androidaps/interaction/actions/TreatmentActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/actions/TreatmentActivity.kt index b9e21414cd..40ab8599a1 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/TreatmentActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/TreatmentActivity.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.interaction.actions +package app.aaps.wear.interaction.actions import android.os.Bundle import android.view.LayoutInflater @@ -11,10 +11,10 @@ import app.aaps.core.interfaces.rx.events.EventWearToMobile import app.aaps.core.interfaces.rx.weardata.EventData.ActionBolusPreCheck import app.aaps.core.interfaces.utils.SafeParse.stringToDouble import app.aaps.core.interfaces.utils.SafeParse.stringToInt -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.utils.EditPlusMinusViewAdapter -import info.nightscout.androidaps.interaction.utils.PlusMinusEditText -import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated +import app.aaps.wear.R +import app.aaps.wear.interaction.utils.EditPlusMinusViewAdapter +import app.aaps.wear.interaction.utils.PlusMinusEditText +import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated import java.text.DecimalFormat import kotlin.math.roundToInt diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ViewSelectorActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/ViewSelectorActivity.kt similarity index 89% rename from wear/src/main/java/info/nightscout/androidaps/interaction/actions/ViewSelectorActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/actions/ViewSelectorActivity.kt index 5236338ff9..255e892bfe 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ViewSelectorActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/ViewSelectorActivity.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.interaction.actions +package app.aaps.wear.interaction.actions import android.content.Context import android.os.Bundle @@ -11,11 +11,11 @@ import android.widget.Toast import androidx.wear.widget.CurvedTextView import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.wear.R +import app.aaps.wear.nondeprecated.DotsPageIndicatorNonDeprecated +import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated +import app.aaps.wear.nondeprecated.GridViewPagerNonDeprecated import dagger.android.DaggerActivity -import info.nightscout.androidaps.R -import info.nightscout.androidaps.nondeprecated.DotsPageIndicatorNonDeprecated -import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated -import info.nightscout.androidaps.nondeprecated.GridViewPagerNonDeprecated import javax.inject.Inject /** diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/WizardActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/WizardActivity.kt similarity index 92% rename from wear/src/main/java/info/nightscout/androidaps/interaction/actions/WizardActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/actions/WizardActivity.kt index ec62dc1289..1d4c16e3af 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/WizardActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/actions/WizardActivity.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.interaction.actions +package app.aaps.wear.interaction.actions import android.os.Bundle import android.view.LayoutInflater @@ -10,10 +10,10 @@ import android.widget.ImageView import app.aaps.core.interfaces.rx.events.EventWearToMobile import app.aaps.core.interfaces.rx.weardata.EventData.ActionWizardPreCheck import app.aaps.core.interfaces.utils.SafeParse -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.utils.EditPlusMinusViewAdapter -import info.nightscout.androidaps.interaction.utils.PlusMinusEditText -import info.nightscout.androidaps.nondeprecated.GridPagerAdapterNonDeprecated +import app.aaps.wear.R +import app.aaps.wear.interaction.utils.EditPlusMinusViewAdapter +import app.aaps.wear.interaction.utils.PlusMinusEditText +import app.aaps.wear.nondeprecated.GridPagerAdapterNonDeprecated import java.text.DecimalFormat class WizardActivity : ViewSelectorActivity() { diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/menus/FillMenuActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/menus/FillMenuActivity.kt similarity index 86% rename from wear/src/main/java/info/nightscout/androidaps/interaction/menus/FillMenuActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/menus/FillMenuActivity.kt index 2b65aa9e02..cf8e08009e 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/menus/FillMenuActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/menus/FillMenuActivity.kt @@ -1,12 +1,12 @@ -package info.nightscout.androidaps.interaction.menus +package app.aaps.wear.interaction.menus import android.content.Intent import android.os.Bundle import app.aaps.core.interfaces.rx.events.EventWearToMobile import app.aaps.core.interfaces.rx.weardata.EventData -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.actions.FillActivity -import info.nightscout.androidaps.interaction.utils.MenuListActivity +import app.aaps.wear.R +import app.aaps.wear.interaction.actions.FillActivity +import app.aaps.wear.interaction.utils.MenuListActivity class FillMenuActivity : MenuListActivity() { diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/menus/MainMenuActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/menus/MainMenuActivity.kt similarity index 88% rename from wear/src/main/java/info/nightscout/androidaps/interaction/menus/MainMenuActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/menus/MainMenuActivity.kt index 2b73da0dc6..21bdb290e6 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/menus/MainMenuActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/menus/MainMenuActivity.kt @@ -1,16 +1,16 @@ -package info.nightscout.androidaps.interaction.menus +package app.aaps.wear.interaction.menus import android.content.Intent import android.os.Bundle import app.aaps.core.interfaces.rx.events.EventWearToMobile import app.aaps.core.interfaces.rx.weardata.EventData import app.aaps.core.interfaces.rx.weardata.EventData.ActionResendData -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.actions.ECarbActivity -import info.nightscout.androidaps.interaction.actions.TempTargetActivity -import info.nightscout.androidaps.interaction.actions.TreatmentActivity -import info.nightscout.androidaps.interaction.actions.WizardActivity -import info.nightscout.androidaps.interaction.utils.MenuListActivity +import app.aaps.wear.R +import app.aaps.wear.interaction.actions.ECarbActivity +import app.aaps.wear.interaction.actions.TempTargetActivity +import app.aaps.wear.interaction.actions.TreatmentActivity +import app.aaps.wear.interaction.actions.WizardActivity +import app.aaps.wear.interaction.utils.MenuListActivity class MainMenuActivity : MenuListActivity() { diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/menus/PreferenceMenuActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/menus/PreferenceMenuActivity.kt similarity index 80% rename from wear/src/main/java/info/nightscout/androidaps/interaction/menus/PreferenceMenuActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/menus/PreferenceMenuActivity.kt index 8607645d06..4fd8dc6c9c 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/menus/PreferenceMenuActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/menus/PreferenceMenuActivity.kt @@ -1,10 +1,10 @@ -package info.nightscout.androidaps.interaction.menus +package app.aaps.wear.interaction.menus import android.content.Intent import android.os.Bundle -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.WatchfaceConfigurationActivity -import info.nightscout.androidaps.interaction.utils.MenuListActivity +import app.aaps.wear.R +import app.aaps.wear.interaction.WatchfaceConfigurationActivity +import app.aaps.wear.interaction.utils.MenuListActivity class PreferenceMenuActivity : MenuListActivity() { @@ -24,23 +24,27 @@ class PreferenceMenuActivity : MenuListActivity() { override fun doAction(position: String) { when (position) { - getString(R.string.pref_display_settings) -> startActivity(Intent(this, WatchfaceConfigurationActivity::class.java).apply { + getString(R.string.pref_display_settings) -> startActivity(Intent(this, WatchfaceConfigurationActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) putExtra(getString(R.string.key_preference_id), R.xml.display_preferences) }) + getString(R.string.pref_graph_settings) -> startActivity(Intent(this, WatchfaceConfigurationActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) putExtra(getString(R.string.key_preference_id), R.xml.graph_preferences) }) + getString(R.string.pref_interface_settings) -> startActivity(Intent(this, WatchfaceConfigurationActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) putExtra(getString(R.string.key_preference_id), R.xml.interface_preferences) }) + getString(R.string.pref_complication_settings) -> startActivity(Intent(this, WatchfaceConfigurationActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) putExtra(getString(R.string.key_preference_id), R.xml.complication_preferences) }) - getString(R.string.pref_others_settings) -> startActivity(Intent(this, WatchfaceConfigurationActivity::class.java).apply { + + getString(R.string.pref_others_settings) -> startActivity(Intent(this, WatchfaceConfigurationActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) putExtra(getString(R.string.key_preference_id), R.xml.others_preferences) }) diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/menus/StatusMenuActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/menus/StatusMenuActivity.kt similarity index 89% rename from wear/src/main/java/info/nightscout/androidaps/interaction/menus/StatusMenuActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/menus/StatusMenuActivity.kt index 5931d68a09..b44416b17e 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/menus/StatusMenuActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/menus/StatusMenuActivity.kt @@ -1,12 +1,12 @@ -package info.nightscout.androidaps.interaction.menus +package app.aaps.wear.interaction.menus import android.os.Bundle import app.aaps.core.interfaces.rx.events.EventWearToMobile import app.aaps.core.interfaces.rx.weardata.EventData.ActionLoopStatus import app.aaps.core.interfaces.rx.weardata.EventData.ActionPumpStatus import app.aaps.core.interfaces.rx.weardata.EventData.ActionTddStatus -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.utils.MenuListActivity +import app.aaps.wear.R +import app.aaps.wear.interaction.utils.MenuListActivity class StatusMenuActivity : MenuListActivity() { diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Constants.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/Constants.kt similarity index 86% rename from wear/src/main/java/info/nightscout/androidaps/interaction/utils/Constants.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/utils/Constants.kt index 3c8ce54949..fa33226563 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Constants.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/Constants.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.interaction.utils +package app.aaps.wear.interaction.utils @Suppress("unused") object Constants { diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/DisplayFormat.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/DisplayFormat.kt similarity index 94% rename from wear/src/main/java/info/nightscout/androidaps/interaction/utils/DisplayFormat.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/utils/DisplayFormat.kt index 1f5ba2f361..dbf7bb3323 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/DisplayFormat.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/DisplayFormat.kt @@ -1,142 +1,142 @@ -package info.nightscout.androidaps.interaction.utils - -import android.content.Context -import app.aaps.core.interfaces.sharedPreferences.SP -import info.nightscout.androidaps.R -import info.nightscout.androidaps.data.RawDisplayData -import info.nightscout.androidaps.interaction.utils.Pair.Companion.create -import javax.inject.Inject -import javax.inject.Singleton -import kotlin.math.max - -@Singleton -class DisplayFormat @Inject internal constructor() { - - companion object { - - const val MAX_FIELD_LEN_LONG = 22 // this is found out empirical, for TYPE_LONG_TEXT - const val MAX_FIELD_LEN_SHORT = 7 // according to Wear OS docs for TYPE_SHORT_TEXT - const val MIN_FIELD_LEN_COB = 3 // since carbs are usually 0..99g - const val MIN_FIELD_LEN_IOB = 3 // IoB can range from like .1U to 99U - } - - @Inject lateinit var sp: SP - @Inject lateinit var wearUtil: WearUtil - @Inject lateinit var context: Context - - /** - * Maximal and minimal lengths of fields/labels shown in complications, in characters - * For MAX values - above that WearOS and watch faces may start ellipsize (...) contents - * For MIN values - this is minimal length that can hold legible data - */ - - private fun areComplicationsUnicode() = sp.getBoolean("complication_unicode", true) - - private fun deltaSymbol() = if (areComplicationsUnicode()) "\u0394" else "" - - private fun verticalSeparatorSymbol() = if (areComplicationsUnicode()) "\u205E" else "|" - - fun basalRateSymbol() = if (areComplicationsUnicode()) "\u238D\u2006" else "" - - fun shortTimeSince(refTime: Long): String { - val deltaTimeMs = wearUtil.msSince(refTime) - return if (deltaTimeMs < Constants.MINUTE_IN_MS) { - "0'" - } else if (deltaTimeMs < Constants.HOUR_IN_MS) { - val minutes = (deltaTimeMs / Constants.MINUTE_IN_MS).toInt() - "$minutes'" - } else if (deltaTimeMs < Constants.DAY_IN_MS) { - val hours = (deltaTimeMs / Constants.HOUR_IN_MS).toInt() - hours.toString() + context.getString(R.string.hour_short) - } else { - val days = (deltaTimeMs / Constants.DAY_IN_MS).toInt() - if (days < 7) { - days.toString() + context.getString(R.string.day_short) - } else { - val weeks = days / 7 - weeks.toString() + context.getString(R.string.week_short) - } - } - } - - fun shortTrend(raw: RawDisplayData): String { - var minutes = "--" - val rawDelta = if (sp.getBoolean(R.string.key_show_detailed_delta, false)) raw.singleBg.deltaDetailed else raw.singleBg.delta - if (raw.singleBg.timeStamp > 0) { - minutes = shortTimeSince(raw.singleBg.timeStamp) - } - if (minutes.length + rawDelta.length + deltaSymbol().length + 1 <= MAX_FIELD_LEN_SHORT) { - return minutes + " " + deltaSymbol() + rawDelta - } - - // that only optimizes obvious things like 0 before . or at end, + at beginning - val delta = SmallestDoubleString(rawDelta).minimise(MAX_FIELD_LEN_SHORT - 1) - if (minutes.length + delta.length + deltaSymbol().length + 1 <= MAX_FIELD_LEN_SHORT) { - return minutes + " " + deltaSymbol() + delta - } - val shortDelta = SmallestDoubleString(rawDelta).minimise(MAX_FIELD_LEN_SHORT - (1 + minutes.length)) - return "$minutes $shortDelta" - } - - fun longGlucoseLine(raw: RawDisplayData): String { - val rawDelta = if (sp.getBoolean(R.string.key_show_detailed_delta, false)) raw.singleBg.deltaDetailed else raw.singleBg.delta - return raw.singleBg.sgvString + raw.singleBg.slopeArrow + " " + deltaSymbol() + SmallestDoubleString(rawDelta).minimise(8) + " (" + shortTimeSince(raw.singleBg.timeStamp) + ")" - } - - fun longDetailsLine(raw: RawDisplayData): String { - val sepLong = " " + verticalSeparatorSymbol() + " " - val sepShort = " " + verticalSeparatorSymbol() + " " - val sepShortLen = sepShort.length - val sepMin = " " - var line = raw.status.cob + sepLong + raw.status.iobSum + sepLong + basalRateSymbol() + raw.status.currentBasal - if (line.length <= MAX_FIELD_LEN_LONG) { - return line - } - line = raw.status.cob + sepShort + raw.status.iobSum + sepShort + raw.status.currentBasal - if (line.length <= MAX_FIELD_LEN_LONG) { - return line - } - var remainingMax = MAX_FIELD_LEN_LONG - (raw.status.cob.length + raw.status.currentBasal.length + sepShortLen * 2) - val smallestIoB = SmallestDoubleString(raw.status.iobSum, SmallestDoubleString.Units.USE).minimise(max(MIN_FIELD_LEN_IOB, remainingMax)) - line = raw.status.cob + sepShort + smallestIoB + sepShort + raw.status.currentBasal - if (line.length <= MAX_FIELD_LEN_LONG) { - return line - } - remainingMax = MAX_FIELD_LEN_LONG - (smallestIoB.length + raw.status.currentBasal.length + sepShortLen * 2) - val simplifiedCob = SmallestDoubleString(raw.status.cob, SmallestDoubleString.Units.USE).minimise(max(MIN_FIELD_LEN_COB, remainingMax)) - line = simplifiedCob + sepShort + smallestIoB + sepShort + raw.status.currentBasal - if (line.length <= MAX_FIELD_LEN_LONG) { - return line - } - line = simplifiedCob + sepMin + smallestIoB + sepMin + raw.status.currentBasal - return line - } - - fun detailedIob(raw: RawDisplayData): Pair { - val iob1 = SmallestDoubleString(raw.status.iobSum, SmallestDoubleString.Units.USE).minimise(MAX_FIELD_LEN_SHORT) - var iob2 = "" - if (raw.status.iobDetail.contains("|")) { - val iobs = raw.status.iobDetail.replace("(", "").replace(")", "").split("|").toTypedArray() - var iobBolus = SmallestDoubleString(iobs[0]).minimise(MIN_FIELD_LEN_IOB) - if (iobBolus.trim().isEmpty()) { - iobBolus = "--" - } - var iobBasal = SmallestDoubleString(iobs[1]).minimise(MAX_FIELD_LEN_SHORT - 1 - max(MIN_FIELD_LEN_IOB, iobBolus.length)) - if (iobBasal.trim().isEmpty()) { - iobBasal = "--" - } - iob2 = "$iobBolus $iobBasal" - } - return create(iob1, iob2) - } - - fun detailedCob(raw: RawDisplayData): Pair { - val cobMini = SmallestDoubleString(raw.status.cob, SmallestDoubleString.Units.USE) - var cob2 = "" - if (cobMini.extra.isNotEmpty()) { - cob2 = cobMini.extra + cobMini.units - } - val cob1 = cobMini.minimise(MAX_FIELD_LEN_SHORT) - return create(cob1, cob2) - } -} +package app.aaps.wear.interaction.utils + +import android.content.Context +import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.wear.R +import app.aaps.wear.data.RawDisplayData +import app.aaps.wear.interaction.utils.Pair.Companion.create +import javax.inject.Inject +import javax.inject.Singleton +import kotlin.math.max + +@Singleton +class DisplayFormat @Inject internal constructor() { + + companion object { + + const val MAX_FIELD_LEN_LONG = 22 // this is found out empirical, for TYPE_LONG_TEXT + const val MAX_FIELD_LEN_SHORT = 7 // according to Wear OS docs for TYPE_SHORT_TEXT + const val MIN_FIELD_LEN_COB = 3 // since carbs are usually 0..99g + const val MIN_FIELD_LEN_IOB = 3 // IoB can range from like .1U to 99U + } + + @Inject lateinit var sp: SP + @Inject lateinit var wearUtil: WearUtil + @Inject lateinit var context: Context + + /** + * Maximal and minimal lengths of fields/labels shown in complications, in characters + * For MAX values - above that WearOS and watch faces may start ellipsize (...) contents + * For MIN values - this is minimal length that can hold legible data + */ + + private fun areComplicationsUnicode() = sp.getBoolean("complication_unicode", true) + + private fun deltaSymbol() = if (areComplicationsUnicode()) "\u0394" else "" + + private fun verticalSeparatorSymbol() = if (areComplicationsUnicode()) "\u205E" else "|" + + fun basalRateSymbol() = if (areComplicationsUnicode()) "\u238D\u2006" else "" + + fun shortTimeSince(refTime: Long): String { + val deltaTimeMs = wearUtil.msSince(refTime) + return if (deltaTimeMs < Constants.MINUTE_IN_MS) { + "0'" + } else if (deltaTimeMs < Constants.HOUR_IN_MS) { + val minutes = (deltaTimeMs / Constants.MINUTE_IN_MS).toInt() + "$minutes'" + } else if (deltaTimeMs < Constants.DAY_IN_MS) { + val hours = (deltaTimeMs / Constants.HOUR_IN_MS).toInt() + hours.toString() + context.getString(R.string.hour_short) + } else { + val days = (deltaTimeMs / Constants.DAY_IN_MS).toInt() + if (days < 7) { + days.toString() + context.getString(R.string.day_short) + } else { + val weeks = days / 7 + weeks.toString() + context.getString(R.string.week_short) + } + } + } + + fun shortTrend(raw: RawDisplayData): String { + var minutes = "--" + val rawDelta = if (sp.getBoolean(R.string.key_show_detailed_delta, false)) raw.singleBg.deltaDetailed else raw.singleBg.delta + if (raw.singleBg.timeStamp > 0) { + minutes = shortTimeSince(raw.singleBg.timeStamp) + } + if (minutes.length + rawDelta.length + deltaSymbol().length + 1 <= MAX_FIELD_LEN_SHORT) { + return minutes + " " + deltaSymbol() + rawDelta + } + + // that only optimizes obvious things like 0 before . or at end, + at beginning + val delta = SmallestDoubleString(rawDelta).minimise(MAX_FIELD_LEN_SHORT - 1) + if (minutes.length + delta.length + deltaSymbol().length + 1 <= MAX_FIELD_LEN_SHORT) { + return minutes + " " + deltaSymbol() + delta + } + val shortDelta = SmallestDoubleString(rawDelta).minimise(MAX_FIELD_LEN_SHORT - (1 + minutes.length)) + return "$minutes $shortDelta" + } + + fun longGlucoseLine(raw: RawDisplayData): String { + val rawDelta = if (sp.getBoolean(R.string.key_show_detailed_delta, false)) raw.singleBg.deltaDetailed else raw.singleBg.delta + return raw.singleBg.sgvString + raw.singleBg.slopeArrow + " " + deltaSymbol() + SmallestDoubleString(rawDelta).minimise(8) + " (" + shortTimeSince(raw.singleBg.timeStamp) + ")" + } + + fun longDetailsLine(raw: RawDisplayData): String { + val sepLong = " " + verticalSeparatorSymbol() + " " + val sepShort = " " + verticalSeparatorSymbol() + " " + val sepShortLen = sepShort.length + val sepMin = " " + var line = raw.status.cob + sepLong + raw.status.iobSum + sepLong + basalRateSymbol() + raw.status.currentBasal + if (line.length <= MAX_FIELD_LEN_LONG) { + return line + } + line = raw.status.cob + sepShort + raw.status.iobSum + sepShort + raw.status.currentBasal + if (line.length <= MAX_FIELD_LEN_LONG) { + return line + } + var remainingMax = MAX_FIELD_LEN_LONG - (raw.status.cob.length + raw.status.currentBasal.length + sepShortLen * 2) + val smallestIoB = SmallestDoubleString(raw.status.iobSum, SmallestDoubleString.Units.USE).minimise(max(MIN_FIELD_LEN_IOB, remainingMax)) + line = raw.status.cob + sepShort + smallestIoB + sepShort + raw.status.currentBasal + if (line.length <= MAX_FIELD_LEN_LONG) { + return line + } + remainingMax = MAX_FIELD_LEN_LONG - (smallestIoB.length + raw.status.currentBasal.length + sepShortLen * 2) + val simplifiedCob = SmallestDoubleString(raw.status.cob, SmallestDoubleString.Units.USE).minimise(max(MIN_FIELD_LEN_COB, remainingMax)) + line = simplifiedCob + sepShort + smallestIoB + sepShort + raw.status.currentBasal + if (line.length <= MAX_FIELD_LEN_LONG) { + return line + } + line = simplifiedCob + sepMin + smallestIoB + sepMin + raw.status.currentBasal + return line + } + + fun detailedIob(raw: RawDisplayData): Pair { + val iob1 = SmallestDoubleString(raw.status.iobSum, SmallestDoubleString.Units.USE).minimise(MAX_FIELD_LEN_SHORT) + var iob2 = "" + if (raw.status.iobDetail.contains("|")) { + val iobs = raw.status.iobDetail.replace("(", "").replace(")", "").split("|").toTypedArray() + var iobBolus = SmallestDoubleString(iobs[0]).minimise(MIN_FIELD_LEN_IOB) + if (iobBolus.trim().isEmpty()) { + iobBolus = "--" + } + var iobBasal = SmallestDoubleString(iobs[1]).minimise(MAX_FIELD_LEN_SHORT - 1 - max(MIN_FIELD_LEN_IOB, iobBolus.length)) + if (iobBasal.trim().isEmpty()) { + iobBasal = "--" + } + iob2 = "$iobBolus $iobBasal" + } + return create(iob1, iob2) + } + + fun detailedCob(raw: RawDisplayData): Pair { + val cobMini = SmallestDoubleString(raw.status.cob, SmallestDoubleString.Units.USE) + var cob2 = "" + if (cobMini.extra.isNotEmpty()) { + cob2 = cobMini.extra + cobMini.units + } + val cob1 = cobMini.minimise(MAX_FIELD_LEN_SHORT) + return create(cob1, cob2) + } +} diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/EditPlusMinusViewAdapter.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/EditPlusMinusViewAdapter.kt similarity index 85% rename from wear/src/main/java/info/nightscout/androidaps/interaction/utils/EditPlusMinusViewAdapter.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/utils/EditPlusMinusViewAdapter.kt index 9bd43ec7d0..605caf8913 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/EditPlusMinusViewAdapter.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/EditPlusMinusViewAdapter.kt @@ -1,98 +1,98 @@ -package info.nightscout.androidaps.interaction.utils - -import android.content.Context -import android.view.LayoutInflater -import android.view.ViewGroup -import app.aaps.core.interfaces.sharedPreferences.SP -import info.nightscout.androidaps.R -import info.nightscout.androidaps.databinding.ActionEditplusminBinding -import info.nightscout.androidaps.databinding.ActionEditplusminMultiBinding -import info.nightscout.androidaps.databinding.ActionEditplusminQuickleftyBinding -import info.nightscout.androidaps.databinding.ActionEditplusminQuickleftyMultiBinding -import info.nightscout.androidaps.databinding.ActionEditplusminQuickrightyBinding -import info.nightscout.androidaps.databinding.ActionEditplusminQuickrightyMultiBinding -import info.nightscout.androidaps.databinding.ActionEditplusminViktoriaBinding - -/** - * EditPlusMinusViewAdapter binds both ActionEditplusminBinding variants shared attributes to one common view adapter. - * Requires at least one of the ViewBinding as a parameter. Recommended to use the factory object to create the binding. - */ -class EditPlusMinusViewAdapter( - eD: ActionEditplusminBinding?, - eDP: ActionEditplusminMultiBinding?, - eQL: ActionEditplusminQuickleftyBinding?, - eQLP: ActionEditplusminQuickleftyMultiBinding?, - eQR: ActionEditplusminQuickrightyBinding?, - eQRP: ActionEditplusminQuickrightyMultiBinding?, - eV: ActionEditplusminViktoriaBinding? -) { - - init { - if (eD == null && eDP == null && eQL == null && eQLP == null && eQR == null && eQRP == null && eV == null) { - throw IllegalArgumentException("Require at least on Binding parameter") - } - } - - private val errorMessage = "Missing require View Binding parameter" - val editText = - eD?.editText ?: eDP?.editText ?: eQL?.editText ?: eQLP?.editText ?: eQR?.editText ?: eQRP?.editText ?: eV?.editText - ?: throw IllegalArgumentException(errorMessage) - val minButton = - eD?.minButton ?: eDP?.minButton ?: eQL?.minButton ?: eQLP?.minButton ?: eQR?.minButton ?: eQRP?.minButton ?: eV?.minButton - ?: throw IllegalArgumentException(errorMessage) - val plusButton1 = - eD?.plusButton1 ?: eDP?.plusButton1 ?: eQL?.plusButton1 ?: eQLP?.plusButton1 ?: eQR?.plusButton1 ?: eQRP?.plusButton1 ?: eV?.plusButton1 - ?: throw IllegalArgumentException(errorMessage) - val label = - eD?.label ?: eDP?.label ?: eQL?.label ?: eQLP?.label ?: eQR?.label ?: eQRP?.label ?: eV?.label - ?: throw IllegalArgumentException(errorMessage) - val plusButton2 = eDP?.plusButton2 ?: eQLP?.plusButton2 ?: eQRP?.plusButton2 - val plusButton3 = eDP?.plusButton3 ?: eQLP?.plusButton3 ?: eQRP?.plusButton3 - val root = - eD?.root ?: eDP?.root ?: eQL?.root ?: eQLP?.root ?: eQR?.root ?: eQRP?.root ?: eV?.root - ?: throw IllegalArgumentException(errorMessage) - - companion object { - - fun getViewAdapter(sp: SP, context: Context, container: ViewGroup, multiple: Boolean = false): EditPlusMinusViewAdapter { - val inflater = LayoutInflater.from(context) - - return when (sp.getInt(R.string.key_input_design, 1)) { - 2 -> { - if (multiple) { - val bindLayout = ActionEditplusminQuickrightyMultiBinding.inflate(inflater, container, false) - EditPlusMinusViewAdapter(null, null, null, null, null, bindLayout, null) - } else { - val bindLayout = ActionEditplusminQuickrightyBinding.inflate(inflater, container, false) - EditPlusMinusViewAdapter(null, null, null, null, bindLayout, null, null) - } - } - - 3 -> { - if (multiple) { - val bindLayout = ActionEditplusminQuickleftyMultiBinding.inflate(inflater, container, false) - EditPlusMinusViewAdapter(null, null, null, bindLayout, null, null, null) - } else { - val bindLayout = ActionEditplusminQuickleftyBinding.inflate(inflater, container, false) - EditPlusMinusViewAdapter(null, null, bindLayout, null, null, null, null) - } - } - - 4 -> { - val bindLayout = ActionEditplusminViktoriaBinding.inflate(inflater, container, false) - EditPlusMinusViewAdapter(null, null, null, null, null, null, bindLayout) - } - - else -> { - if (multiple) { - val bindLayout = ActionEditplusminMultiBinding.inflate(inflater, container, false) - EditPlusMinusViewAdapter(null, bindLayout, null, null, null, null, null) - } else { - val bindLayout = ActionEditplusminBinding.inflate(inflater, container, false) - EditPlusMinusViewAdapter(bindLayout, null, null, null, null, null, null) - } - } - } - } - } -} +package app.aaps.wear.interaction.utils + +import android.content.Context +import android.view.LayoutInflater +import android.view.ViewGroup +import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.wear.R +import app.aaps.wear.databinding.ActionEditplusminBinding +import app.aaps.wear.databinding.ActionEditplusminMultiBinding +import app.aaps.wear.databinding.ActionEditplusminQuickleftyBinding +import app.aaps.wear.databinding.ActionEditplusminQuickleftyMultiBinding +import app.aaps.wear.databinding.ActionEditplusminQuickrightyBinding +import app.aaps.wear.databinding.ActionEditplusminQuickrightyMultiBinding +import app.aaps.wear.databinding.ActionEditplusminViktoriaBinding + +/** + * EditPlusMinusViewAdapter binds both ActionEditplusminBinding variants shared attributes to one common view adapter. + * Requires at least one of the ViewBinding as a parameter. Recommended to use the factory object to create the binding. + */ +class EditPlusMinusViewAdapter( + eD: ActionEditplusminBinding?, + eDP: ActionEditplusminMultiBinding?, + eQL: ActionEditplusminQuickleftyBinding?, + eQLP: ActionEditplusminQuickleftyMultiBinding?, + eQR: ActionEditplusminQuickrightyBinding?, + eQRP: ActionEditplusminQuickrightyMultiBinding?, + eV: ActionEditplusminViktoriaBinding? +) { + + init { + if (eD == null && eDP == null && eQL == null && eQLP == null && eQR == null && eQRP == null && eV == null) { + throw IllegalArgumentException("Require at least on Binding parameter") + } + } + + private val errorMessage = "Missing require View Binding parameter" + val editText = + eD?.editText ?: eDP?.editText ?: eQL?.editText ?: eQLP?.editText ?: eQR?.editText ?: eQRP?.editText ?: eV?.editText + ?: throw IllegalArgumentException(errorMessage) + val minButton = + eD?.minButton ?: eDP?.minButton ?: eQL?.minButton ?: eQLP?.minButton ?: eQR?.minButton ?: eQRP?.minButton ?: eV?.minButton + ?: throw IllegalArgumentException(errorMessage) + val plusButton1 = + eD?.plusButton1 ?: eDP?.plusButton1 ?: eQL?.plusButton1 ?: eQLP?.plusButton1 ?: eQR?.plusButton1 ?: eQRP?.plusButton1 ?: eV?.plusButton1 + ?: throw IllegalArgumentException(errorMessage) + val label = + eD?.label ?: eDP?.label ?: eQL?.label ?: eQLP?.label ?: eQR?.label ?: eQRP?.label ?: eV?.label + ?: throw IllegalArgumentException(errorMessage) + val plusButton2 = eDP?.plusButton2 ?: eQLP?.plusButton2 ?: eQRP?.plusButton2 + val plusButton3 = eDP?.plusButton3 ?: eQLP?.plusButton3 ?: eQRP?.plusButton3 + val root = + eD?.root ?: eDP?.root ?: eQL?.root ?: eQLP?.root ?: eQR?.root ?: eQRP?.root ?: eV?.root + ?: throw IllegalArgumentException(errorMessage) + + companion object { + + fun getViewAdapter(sp: SP, context: Context, container: ViewGroup, multiple: Boolean = false): EditPlusMinusViewAdapter { + val inflater = LayoutInflater.from(context) + + return when (sp.getInt(R.string.key_input_design, 1)) { + 2 -> { + if (multiple) { + val bindLayout = ActionEditplusminQuickrightyMultiBinding.inflate(inflater, container, false) + EditPlusMinusViewAdapter(null, null, null, null, null, bindLayout, null) + } else { + val bindLayout = ActionEditplusminQuickrightyBinding.inflate(inflater, container, false) + EditPlusMinusViewAdapter(null, null, null, null, bindLayout, null, null) + } + } + + 3 -> { + if (multiple) { + val bindLayout = ActionEditplusminQuickleftyMultiBinding.inflate(inflater, container, false) + EditPlusMinusViewAdapter(null, null, null, bindLayout, null, null, null) + } else { + val bindLayout = ActionEditplusminQuickleftyBinding.inflate(inflater, container, false) + EditPlusMinusViewAdapter(null, null, bindLayout, null, null, null, null) + } + } + + 4 -> { + val bindLayout = ActionEditplusminViktoriaBinding.inflate(inflater, container, false) + EditPlusMinusViewAdapter(null, null, null, null, null, null, bindLayout) + } + + else -> { + if (multiple) { + val bindLayout = ActionEditplusminMultiBinding.inflate(inflater, container, false) + EditPlusMinusViewAdapter(null, bindLayout, null, null, null, null, null) + } else { + val bindLayout = ActionEditplusminBinding.inflate(inflater, container, false) + EditPlusMinusViewAdapter(bindLayout, null, null, null, null, null, null) + } + } + } + } + } +} diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Inevitable.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/Inevitable.kt similarity index 89% rename from wear/src/main/java/info/nightscout/androidaps/interaction/utils/Inevitable.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/utils/Inevitable.kt index 3636fb54ae..1914bfd8a7 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Inevitable.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/Inevitable.kt @@ -1,10 +1,10 @@ -package info.nightscout.androidaps.interaction.utils +package app.aaps.wear.interaction.utils import android.os.SystemClock import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.utils.DateUtil -import info.nightscout.androidaps.BuildConfig +import app.aaps.wear.BuildConfig import java.util.concurrent.ConcurrentHashMap import javax.inject.Inject import javax.inject.Singleton @@ -25,19 +25,19 @@ class Inevitable @Inject internal constructor() { @Inject lateinit var dateUtil: DateUtil private val tasks = ConcurrentHashMap() - fun task(id: String, idle_for: Long, runnable: Runnable?) { - if (idle_for > MAX_QUEUE_TIME) { - throw RuntimeException("$id Requested time: $idle_for beyond max queue time") + fun task(id: String, idleFor: Long, runnable: Runnable?) { + if (idleFor > MAX_QUEUE_TIME) { + throw RuntimeException("$id Requested time: $idleFor beyond max queue time") } val task = tasks[id] if (task != null) { // if it already exists then extend the time - task.extendTime(idle_for) + task.extendTime(idleFor) if (debug) aapsLogger.debug(LTag.WEAR, "Extending time for: " + id + " to " + dateUtil.dateAndTimeAndSecondsString(task.`when`)) } else { // otherwise create new task if (runnable == null) return // extension only if already exists - tasks[id] = Task(id, idle_for, runnable) + tasks[id] = Task(id, idleFor, runnable) if (debug) { aapsLogger.debug( LTag.WEAR, diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/MenuListActivity.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/MenuListActivity.kt similarity index 96% rename from wear/src/main/java/info/nightscout/androidaps/interaction/utils/MenuListActivity.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/utils/MenuListActivity.kt index 9d3a66104c..af6af62efb 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/MenuListActivity.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/MenuListActivity.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.interaction.utils +package app.aaps.wear.interaction.utils import android.os.Bundle import android.view.LayoutInflater @@ -14,9 +14,9 @@ import androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback import androidx.wear.widget.WearableRecyclerView import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.wear.R +import app.aaps.wear.interaction.utils.MenuListActivity.MenuAdapter.ItemViewHolder import dagger.android.DaggerActivity -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.utils.MenuListActivity.MenuAdapter.ItemViewHolder import javax.inject.Inject import kotlin.math.abs import kotlin.math.min diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Pair.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/Pair.kt similarity index 88% rename from wear/src/main/java/info/nightscout/androidaps/interaction/utils/Pair.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/utils/Pair.kt index 9d087b0bc8..03087dd28c 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Pair.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/Pair.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.interaction.utils +package app.aaps.wear.interaction.utils -import java.util.* +import java.util.Objects /** * Same as android Pair, but clean room java class - does not require Android SDK for tests diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Persistence.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/Persistence.kt similarity index 99% rename from wear/src/main/java/info/nightscout/androidaps/interaction/utils/Persistence.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/utils/Persistence.kt index 06a857a4d0..67dcf70797 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Persistence.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/Persistence.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.interaction.utils +package app.aaps.wear.interaction.utils import app.aaps.annotations.OpenForTesting import app.aaps.core.interfaces.logging.AAPSLogger diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/PlusMinusEditText.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/PlusMinusEditText.kt similarity index 97% rename from wear/src/main/java/info/nightscout/androidaps/interaction/utils/PlusMinusEditText.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/utils/PlusMinusEditText.kt index d6933c1a13..9289a52423 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/PlusMinusEditText.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/PlusMinusEditText.kt @@ -1,7 +1,14 @@ -package info.nightscout.androidaps.interaction.utils +package app.aaps.wear.interaction.utils import android.content.Context -import android.os.* +import android.os.Build +import android.os.Bundle +import android.os.Handler +import android.os.Looper +import android.os.Message +import android.os.VibrationEffect +import android.os.Vibrator +import android.os.VibratorManager import android.view.KeyEvent import android.view.MotionEvent import android.view.View diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/SmallestDoubleString.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/SmallestDoubleString.kt similarity index 97% rename from wear/src/main/java/info/nightscout/androidaps/interaction/utils/SmallestDoubleString.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/utils/SmallestDoubleString.kt index 5eb6b8946a..bdb4938405 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/SmallestDoubleString.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/SmallestDoubleString.kt @@ -1,6 +1,5 @@ -package info.nightscout.androidaps.interaction.utils +package app.aaps.wear.interaction.utils -import kotlin.jvm.JvmOverloads import java.math.RoundingMode import java.text.DecimalFormat import java.util.regex.Pattern diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/VersionPreference.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/VersionPreference.kt similarity index 88% rename from wear/src/main/java/info/nightscout/androidaps/interaction/utils/VersionPreference.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/utils/VersionPreference.kt index d63d7ca252..d848c5c1c7 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/VersionPreference.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/VersionPreference.kt @@ -1,10 +1,10 @@ -package info.nightscout.androidaps.interaction.utils +package app.aaps.wear.interaction.utils import android.content.Context import android.util.AttributeSet -import preference.WearListPreference import android.widget.Toast -import info.nightscout.androidaps.BuildConfig +import app.aaps.wear.BuildConfig +import preference.WearListPreference /** * Created by adrian on 07/08/17. diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/WatchfaceSettingsPreference.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/WatchfaceSettingsPreference.kt similarity index 90% rename from wear/src/main/java/info/nightscout/androidaps/interaction/utils/WatchfaceSettingsPreference.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/utils/WatchfaceSettingsPreference.kt index 6ae373d8e8..979237a8ec 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/WatchfaceSettingsPreference.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/WatchfaceSettingsPreference.kt @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.interaction.utils +package app.aaps.wear.interaction.utils import android.content.Context import android.util.AttributeSet import android.widget.Toast -import info.nightscout.androidaps.R +import app.aaps.wear.R import preference.WearListPreference @Suppress("unused") diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/WearUtil.kt b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/WearUtil.kt similarity index 97% rename from wear/src/main/java/info/nightscout/androidaps/interaction/utils/WearUtil.kt rename to wear/src/main/kotlin/app/aaps/wear/interaction/utils/WearUtil.kt index 93f0848026..ed1110bb9e 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/WearUtil.kt +++ b/wear/src/main/kotlin/app/aaps/wear/interaction/utils/WearUtil.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.interaction.utils +package app.aaps.wear.interaction.utils import android.content.Context import android.os.PowerManager diff --git a/wear/src/main/java/info/nightscout/androidaps/nondeprecated/DotsPageIndicatorNonDeprecated.kt b/wear/src/main/kotlin/app/aaps/wear/nondeprecated/DotsPageIndicatorNonDeprecated.kt similarity index 89% rename from wear/src/main/java/info/nightscout/androidaps/nondeprecated/DotsPageIndicatorNonDeprecated.kt rename to wear/src/main/kotlin/app/aaps/wear/nondeprecated/DotsPageIndicatorNonDeprecated.kt index f2fc56b633..17612b8735 100644 --- a/wear/src/main/java/info/nightscout/androidaps/nondeprecated/DotsPageIndicatorNonDeprecated.kt +++ b/wear/src/main/kotlin/app/aaps/wear/nondeprecated/DotsPageIndicatorNonDeprecated.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.nondeprecated +package app.aaps.wear.nondeprecated import android.content.Context import android.support.wearable.view.DotsPageIndicator diff --git a/wear/src/main/java/info/nightscout/androidaps/nondeprecated/GridPagerAdapterNonDeprecated.kt b/wear/src/main/kotlin/app/aaps/wear/nondeprecated/GridPagerAdapterNonDeprecated.kt similarity index 82% rename from wear/src/main/java/info/nightscout/androidaps/nondeprecated/GridPagerAdapterNonDeprecated.kt rename to wear/src/main/kotlin/app/aaps/wear/nondeprecated/GridPagerAdapterNonDeprecated.kt index 5af3500ce6..9233c14b63 100644 --- a/wear/src/main/java/info/nightscout/androidaps/nondeprecated/GridPagerAdapterNonDeprecated.kt +++ b/wear/src/main/kotlin/app/aaps/wear/nondeprecated/GridPagerAdapterNonDeprecated.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.nondeprecated +package app.aaps.wear.nondeprecated import android.support.wearable.view.GridPagerAdapter diff --git a/wear/src/main/java/info/nightscout/androidaps/nondeprecated/GridViewPagerNonDeprecated.kt b/wear/src/main/kotlin/app/aaps/wear/nondeprecated/GridViewPagerNonDeprecated.kt similarity index 88% rename from wear/src/main/java/info/nightscout/androidaps/nondeprecated/GridViewPagerNonDeprecated.kt rename to wear/src/main/kotlin/app/aaps/wear/nondeprecated/GridViewPagerNonDeprecated.kt index eeb476f4ab..747a0f42b9 100644 --- a/wear/src/main/java/info/nightscout/androidaps/nondeprecated/GridViewPagerNonDeprecated.kt +++ b/wear/src/main/kotlin/app/aaps/wear/nondeprecated/GridViewPagerNonDeprecated.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.nondeprecated +package app.aaps.wear.nondeprecated import android.content.Context import android.support.wearable.view.GridViewPager diff --git a/wear/src/main/java/info/nightscout/androidaps/tile/ActionsTileService.kt b/wear/src/main/kotlin/app/aaps/wear/tile/ActionsTileService.kt similarity index 78% rename from wear/src/main/java/info/nightscout/androidaps/tile/ActionsTileService.kt rename to wear/src/main/kotlin/app/aaps/wear/tile/ActionsTileService.kt index 18fdcace9c..72235303cb 100644 --- a/wear/src/main/java/info/nightscout/androidaps/tile/ActionsTileService.kt +++ b/wear/src/main/kotlin/app/aaps/wear/tile/ActionsTileService.kt @@ -1,19 +1,19 @@ -package info.nightscout.androidaps.tile - -import dagger.android.AndroidInjection -import info.nightscout.androidaps.tile.source.ActionSource -import javax.inject.Inject - -class ActionsTileService : TileBase() { - - @Inject lateinit var actionSource: ActionSource - - // Not derived from DaggerService, do injection here - override fun onCreate() { - AndroidInjection.inject(this) - super.onCreate() - } - - override val resourceVersion = "ActionsTileService" - override val source get() = actionSource -} +package app.aaps.wear.tile + +import app.aaps.wear.tile.source.ActionSource +import dagger.android.AndroidInjection +import javax.inject.Inject + +class ActionsTileService : TileBase() { + + @Inject lateinit var actionSource: ActionSource + + // Not derived from DaggerService, do injection here + override fun onCreate() { + AndroidInjection.inject(this) + super.onCreate() + } + + override val resourceVersion = "ActionsTileService" + override val source get() = actionSource +} diff --git a/wear/src/main/java/info/nightscout/androidaps/tile/QuickWizardTileService.kt b/wear/src/main/kotlin/app/aaps/wear/tile/QuickWizardTileService.kt similarity index 78% rename from wear/src/main/java/info/nightscout/androidaps/tile/QuickWizardTileService.kt rename to wear/src/main/kotlin/app/aaps/wear/tile/QuickWizardTileService.kt index 23cd00ca27..61cead0fd8 100644 --- a/wear/src/main/java/info/nightscout/androidaps/tile/QuickWizardTileService.kt +++ b/wear/src/main/kotlin/app/aaps/wear/tile/QuickWizardTileService.kt @@ -1,19 +1,19 @@ -package info.nightscout.androidaps.tile - -import dagger.android.AndroidInjection -import info.nightscout.androidaps.tile.source.QuickWizardSource -import javax.inject.Inject - -class QuickWizardTileService : TileBase() { - - @Inject lateinit var quickWizardSource: QuickWizardSource - - // Not derived from DaggerService, do injection here - override fun onCreate() { - AndroidInjection.inject(this) - super.onCreate() - } - - override val resourceVersion = "QuickWizardTileService" - override val source get() = quickWizardSource -} +package app.aaps.wear.tile + +import app.aaps.wear.tile.source.QuickWizardSource +import dagger.android.AndroidInjection +import javax.inject.Inject + +class QuickWizardTileService : TileBase() { + + @Inject lateinit var quickWizardSource: QuickWizardSource + + // Not derived from DaggerService, do injection here + override fun onCreate() { + AndroidInjection.inject(this) + super.onCreate() + } + + override val resourceVersion = "QuickWizardTileService" + override val source get() = quickWizardSource +} diff --git a/wear/src/main/java/info/nightscout/androidaps/tile/TempTargetTileService.kt b/wear/src/main/kotlin/app/aaps/wear/tile/TempTargetTileService.kt similarity index 78% rename from wear/src/main/java/info/nightscout/androidaps/tile/TempTargetTileService.kt rename to wear/src/main/kotlin/app/aaps/wear/tile/TempTargetTileService.kt index 9526b3feba..daa0ff3783 100644 --- a/wear/src/main/java/info/nightscout/androidaps/tile/TempTargetTileService.kt +++ b/wear/src/main/kotlin/app/aaps/wear/tile/TempTargetTileService.kt @@ -1,19 +1,19 @@ -package info.nightscout.androidaps.tile - -import dagger.android.AndroidInjection -import info.nightscout.androidaps.tile.source.TempTargetSource -import javax.inject.Inject - -class TempTargetTileService : TileBase() { - - @Inject lateinit var tempTargetSource: TempTargetSource - - // Not derived from DaggerService, do injection here - override fun onCreate() { - AndroidInjection.inject(this) - super.onCreate() - } - - override val resourceVersion = "TempTargetTileService" - override val source get() = tempTargetSource -} +package app.aaps.wear.tile + +import app.aaps.wear.tile.source.TempTargetSource +import dagger.android.AndroidInjection +import javax.inject.Inject + +class TempTargetTileService : TileBase() { + + @Inject lateinit var tempTargetSource: TempTargetSource + + // Not derived from DaggerService, do injection here + override fun onCreate() { + AndroidInjection.inject(this) + super.onCreate() + } + + override val resourceVersion = "TempTargetTileService" + override val source get() = tempTargetSource +} diff --git a/wear/src/main/java/info/nightscout/androidaps/tile/TileBase.kt b/wear/src/main/kotlin/app/aaps/wear/tile/TileBase.kt similarity index 96% rename from wear/src/main/java/info/nightscout/androidaps/tile/TileBase.kt rename to wear/src/main/kotlin/app/aaps/wear/tile/TileBase.kt index 4f4c4b7a65..51d28279b0 100644 --- a/wear/src/main/java/info/nightscout/androidaps/tile/TileBase.kt +++ b/wear/src/main/kotlin/app/aaps/wear/tile/TileBase.kt @@ -1,309 +1,309 @@ -@file:Suppress("DEPRECATION") - -package info.nightscout.androidaps.tile - -import androidx.annotation.DrawableRes -import androidx.core.content.ContextCompat -import androidx.wear.tiles.ActionBuilders -import androidx.wear.tiles.ColorBuilders.argb -import androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters -import androidx.wear.tiles.DeviceParametersBuilders.SCREEN_SHAPE_ROUND -import androidx.wear.tiles.DimensionBuilders.SpProp -import androidx.wear.tiles.DimensionBuilders.dp -import androidx.wear.tiles.DimensionBuilders.sp -import androidx.wear.tiles.LayoutElementBuilders.Box -import androidx.wear.tiles.LayoutElementBuilders.Column -import androidx.wear.tiles.LayoutElementBuilders.FONT_WEIGHT_BOLD -import androidx.wear.tiles.LayoutElementBuilders.FontStyle -import androidx.wear.tiles.LayoutElementBuilders.Image -import androidx.wear.tiles.LayoutElementBuilders.Layout -import androidx.wear.tiles.LayoutElementBuilders.LayoutElement -import androidx.wear.tiles.LayoutElementBuilders.Row -import androidx.wear.tiles.LayoutElementBuilders.Spacer -import androidx.wear.tiles.LayoutElementBuilders.Text -import androidx.wear.tiles.ModifiersBuilders.Background -import androidx.wear.tiles.ModifiersBuilders.Clickable -import androidx.wear.tiles.ModifiersBuilders.Corner -import androidx.wear.tiles.ModifiersBuilders.Modifiers -import androidx.wear.tiles.ModifiersBuilders.Semantics -import androidx.wear.tiles.RequestBuilders -import androidx.wear.tiles.RequestBuilders.ResourcesRequest -import androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId -import androidx.wear.tiles.ResourceBuilders.ImageResource -import androidx.wear.tiles.ResourceBuilders.Resources -import androidx.wear.tiles.TileBuilders.Tile -import androidx.wear.tiles.TileService -import androidx.wear.tiles.TimelineBuilders.Timeline -import androidx.wear.tiles.TimelineBuilders.TimelineEntry -import app.aaps.core.interfaces.logging.AAPSLogger -import app.aaps.core.interfaces.rx.weardata.EventData -import app.aaps.core.interfaces.sharedPreferences.SP -import com.google.common.util.concurrent.ListenableFuture -import dagger.android.AndroidInjection -import info.nightscout.androidaps.R -import info.nightscout.androidaps.comm.DataLayerListenerServiceWear -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.Job -import kotlinx.coroutines.guava.future -import javax.inject.Inject -import kotlin.math.sqrt - -private const val SPACING_ACTIONS = 3f -private const val ICON_SIZE_FRACTION = 0.4f // Percentage of button diameter -private val BUTTON_COLOR = R.color.gray_850 -private const val LARGE_SCREEN_WIDTH_DP = 210 - -interface TileSource { - - fun getResourceReferences(resources: android.content.res.Resources): List - fun getSelectedActions(): List - fun getValidFor(): Long? -} - -open class Action( - val buttonText: String, - val buttonTextSub: String? = null, - val activityClass: String, - @DrawableRes val iconRes: Int, - val action: EventData? = null, - val message: String? = null, -) - -enum class WearControl { - NO_DATA, ENABLED, DISABLED -} - -abstract class TileBase : TileService() { - - @Inject lateinit var sp: SP - @Inject lateinit var aapsLogger: AAPSLogger - - abstract val resourceVersion: String - abstract val source: TileSource - - private val serviceJob = Job() - private val serviceScope = CoroutineScope(Dispatchers.IO + serviceJob) - - // Not derived from DaggerService, do injection here - override fun onCreate() { - AndroidInjection.inject(this) - super.onCreate() - } - - override fun onTileRequest( - requestParams: RequestBuilders.TileRequest - ): ListenableFuture = serviceScope.future { - val actionsSelected = getSelectedActions() - val wearControl = getWearControl() - val tile = Tile.Builder() - .setResourcesVersion(resourceVersion) - .setTimeline( - Timeline.Builder().addTimelineEntry( - TimelineEntry.Builder().setLayout( - Layout.Builder().setRoot(layout(wearControl, actionsSelected, requestParams.deviceParameters!!)).build() - ).build() - ).build() - ) - - val validFor = validFor() - if (validFor != null) { - tile.setFreshnessIntervalMillis(validFor) - } - tile.build() - } - - private fun getSelectedActions(): List { - // TODO check why thi scan not be don in scope of the coroutine - return source.getSelectedActions() - } - - private fun validFor(): Long? { - return source.getValidFor() - } - - override fun onResourcesRequest( - requestParams: ResourcesRequest - ): ListenableFuture = serviceScope.future { - Resources.Builder() - .setVersion(resourceVersion) - .apply { - source.getResourceReferences(resources).forEach { resourceId -> - addIdToImageMapping( - resourceId.toString(), - ImageResource.Builder() - .setAndroidResourceByResId( - AndroidImageResourceByResId.Builder() - .setResourceId(resourceId) - .build() - ) - .build() - ) - } - } - .build() - } - - private fun layout(wearControl: WearControl, actions: List, deviceParameters: DeviceParameters): LayoutElement { - if (wearControl == WearControl.DISABLED) { - return Text.Builder() - .setText(resources.getString(R.string.wear_control_not_enabled)) - .build() - } else if (wearControl == WearControl.NO_DATA) { - return Text.Builder() - .setText(resources.getString(R.string.wear_control_no_data)) - .build() - } - if (actions.isNotEmpty()) { - with(Column.Builder()) { - if (actions.size == 1 || actions.size == 3) { - addContent(addRowSingle(actions[0], deviceParameters)) - } - if (actions.size == 4 || actions.size == 2) { - addContent(addRowDouble(actions[0], actions[1], deviceParameters)) - } - if (actions.size == 3) { - addContent(addRowDouble(actions[1], actions[2], deviceParameters)) - } - if (actions.size == 4) { - addContent(Spacer.Builder().setHeight(dp(SPACING_ACTIONS)).build()) - addContent(addRowDouble(actions[2], actions[3], deviceParameters)) - } - return build() - } - } - return Text.Builder() - .setText(resources.getString(R.string.tile_no_config)) - .build() - } - - private fun addRowSingle(action: Action, deviceParameters: DeviceParameters): LayoutElement = - Row.Builder() - .addContent(action(action, deviceParameters)) - .build() - - private fun addRowDouble(action1: Action, action2: Action, deviceParameters: DeviceParameters): LayoutElement = - Row.Builder() - .addContent(action(action1, deviceParameters)) - .addContent(Spacer.Builder().setWidth(dp(SPACING_ACTIONS)).build()) - .addContent(action(action2, deviceParameters)) - .build() - - private fun doAction(action: Action): ActionBuilders.Action { - val builder = ActionBuilders.AndroidActivity.Builder() - .setClassName(action.activityClass) - .setPackageName(this.packageName) - if (action.action != null) { - val actionString = ActionBuilders.AndroidStringExtra.Builder().setValue(action.action.serialize()).build() - builder.addKeyToExtraMapping(DataLayerListenerServiceWear.KEY_ACTION, actionString) - } - if (action.message != null) { - val message = ActionBuilders.AndroidStringExtra.Builder().setValue(action.message).build() - builder.addKeyToExtraMapping(DataLayerListenerServiceWear.KEY_MESSAGE, message) - } - - return ActionBuilders.LaunchAction.Builder() - .setAndroidActivity(builder.build()) - .build() - } - - private fun action(action: Action, deviceParameters: DeviceParameters): LayoutElement { - val circleDiameter = circleDiameter(deviceParameters) - val text = action.buttonText - val textSub = action.buttonTextSub - return Box.Builder() - .setWidth(dp(circleDiameter)) - .setHeight(dp(circleDiameter)) - .setModifiers( - Modifiers.Builder() - .setBackground( - Background.Builder() - .setColor(argb(ContextCompat.getColor(baseContext, BUTTON_COLOR))) - .setCorner(Corner.Builder().setRadius(dp(circleDiameter / 2)).build()) - .build() - ) - .setSemantics( - Semantics.Builder() - .setContentDescription("$text $textSub") - .build() - ) - .setClickable( - Clickable.Builder() - .setOnClick(doAction(action)) - .build() - ) - .build() - ) - .addContent(addTextContent(action, deviceParameters)) - .build() - } - - private fun addTextContent(action: Action, deviceParameters: DeviceParameters): LayoutElement { - val circleDiameter = circleDiameter(deviceParameters) - val iconSize = dp(circleDiameter * ICON_SIZE_FRACTION) - val text = action.buttonText - val textSub = action.buttonTextSub - val col = Column.Builder() - .addContent( - Image.Builder() - .setWidth(iconSize) - .setHeight(iconSize) - .setResourceId(action.iconRes.toString()) - .build() - ).addContent( - Text.Builder() - .setText(text) - .setFontStyle( - FontStyle.Builder() - .setWeight(FONT_WEIGHT_BOLD) - .setColor(argb(ContextCompat.getColor(baseContext, R.color.white))) - .setSize(buttonTextSize(deviceParameters, text)) - .build() - ) - .build() - ) - if (textSub != null) { - col.addContent( - Text.Builder() - .setText(textSub) - .setFontStyle( - FontStyle.Builder() - .setColor(argb(ContextCompat.getColor(baseContext, R.color.white))) - .setSize(buttonTextSize(deviceParameters, textSub)) - .build() - ) - .build() - ) - } - - return col.build() - } - - private fun circleDiameter(deviceParameters: DeviceParameters) = when (deviceParameters.screenShape) { - SCREEN_SHAPE_ROUND -> ((sqrt(2f) - 1) * deviceParameters.screenHeightDp) - (2 * SPACING_ACTIONS) - else -> 0.5f * deviceParameters.screenHeightDp - SPACING_ACTIONS - } - - private fun buttonTextSize(deviceParameters: DeviceParameters, text: String): SpProp { - if (text.length > 6) { - return sp(if (isLargeScreen(deviceParameters)) 14f else 12f) - } - return sp(if (isLargeScreen(deviceParameters)) 16f else 14f) - } - - private fun isLargeScreen(deviceParameters: DeviceParameters): Boolean { - return deviceParameters.screenWidthDp >= LARGE_SCREEN_WIDTH_DP - } - - private fun getWearControl(): WearControl { - if (!sp.contains(R.string.key_wear_control)) { - return WearControl.NO_DATA - } - val wearControlPref = sp.getBoolean(R.string.key_wear_control, false) - if (wearControlPref) { - return WearControl.ENABLED - } - return WearControl.DISABLED - } - -} +@file:Suppress("DEPRECATION") + +package app.aaps.wear.tile + +import androidx.annotation.DrawableRes +import androidx.core.content.ContextCompat +import androidx.wear.tiles.ActionBuilders +import androidx.wear.tiles.ColorBuilders.argb +import androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters +import androidx.wear.tiles.DeviceParametersBuilders.SCREEN_SHAPE_ROUND +import androidx.wear.tiles.DimensionBuilders.SpProp +import androidx.wear.tiles.DimensionBuilders.dp +import androidx.wear.tiles.DimensionBuilders.sp +import androidx.wear.tiles.LayoutElementBuilders.Box +import androidx.wear.tiles.LayoutElementBuilders.Column +import androidx.wear.tiles.LayoutElementBuilders.FONT_WEIGHT_BOLD +import androidx.wear.tiles.LayoutElementBuilders.FontStyle +import androidx.wear.tiles.LayoutElementBuilders.Image +import androidx.wear.tiles.LayoutElementBuilders.Layout +import androidx.wear.tiles.LayoutElementBuilders.LayoutElement +import androidx.wear.tiles.LayoutElementBuilders.Row +import androidx.wear.tiles.LayoutElementBuilders.Spacer +import androidx.wear.tiles.LayoutElementBuilders.Text +import androidx.wear.tiles.ModifiersBuilders.Background +import androidx.wear.tiles.ModifiersBuilders.Clickable +import androidx.wear.tiles.ModifiersBuilders.Corner +import androidx.wear.tiles.ModifiersBuilders.Modifiers +import androidx.wear.tiles.ModifiersBuilders.Semantics +import androidx.wear.tiles.RequestBuilders +import androidx.wear.tiles.RequestBuilders.ResourcesRequest +import androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId +import androidx.wear.tiles.ResourceBuilders.ImageResource +import androidx.wear.tiles.ResourceBuilders.Resources +import androidx.wear.tiles.TileBuilders.Tile +import androidx.wear.tiles.TileService +import androidx.wear.tiles.TimelineBuilders.Timeline +import androidx.wear.tiles.TimelineBuilders.TimelineEntry +import app.aaps.core.interfaces.logging.AAPSLogger +import app.aaps.core.interfaces.rx.weardata.EventData +import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.wear.R +import app.aaps.wear.comm.DataLayerListenerServiceWear +import com.google.common.util.concurrent.ListenableFuture +import dagger.android.AndroidInjection +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.Job +import kotlinx.coroutines.guava.future +import javax.inject.Inject +import kotlin.math.sqrt + +private const val SPACING_ACTIONS = 3f +private const val ICON_SIZE_FRACTION = 0.4f // Percentage of button diameter +private val BUTTON_COLOR = R.color.gray_850 +private const val LARGE_SCREEN_WIDTH_DP = 210 + +interface TileSource { + + fun getResourceReferences(resources: android.content.res.Resources): List + fun getSelectedActions(): List + fun getValidFor(): Long? +} + +open class Action( + val buttonText: String, + val buttonTextSub: String? = null, + val activityClass: String, + @DrawableRes val iconRes: Int, + val action: EventData? = null, + val message: String? = null, +) + +enum class WearControl { + NO_DATA, ENABLED, DISABLED +} + +abstract class TileBase : TileService() { + + @Inject lateinit var sp: SP + @Inject lateinit var aapsLogger: AAPSLogger + + abstract val resourceVersion: String + abstract val source: TileSource + + private val serviceJob = Job() + private val serviceScope = CoroutineScope(Dispatchers.IO + serviceJob) + + // Not derived from DaggerService, do injection here + override fun onCreate() { + AndroidInjection.inject(this) + super.onCreate() + } + + override fun onTileRequest( + requestParams: RequestBuilders.TileRequest + ): ListenableFuture = serviceScope.future { + val actionsSelected = getSelectedActions() + val wearControl = getWearControl() + val tile = Tile.Builder() + .setResourcesVersion(resourceVersion) + .setTimeline( + Timeline.Builder().addTimelineEntry( + TimelineEntry.Builder().setLayout( + Layout.Builder().setRoot(layout(wearControl, actionsSelected, requestParams.deviceParameters!!)).build() + ).build() + ).build() + ) + + val validFor = validFor() + if (validFor != null) { + tile.setFreshnessIntervalMillis(validFor) + } + tile.build() + } + + private fun getSelectedActions(): List { + // TODO check why thi scan not be don in scope of the coroutine + return source.getSelectedActions() + } + + private fun validFor(): Long? { + return source.getValidFor() + } + + override fun onResourcesRequest( + requestParams: ResourcesRequest + ): ListenableFuture = serviceScope.future { + Resources.Builder() + .setVersion(resourceVersion) + .apply { + source.getResourceReferences(resources).forEach { resourceId -> + addIdToImageMapping( + resourceId.toString(), + ImageResource.Builder() + .setAndroidResourceByResId( + AndroidImageResourceByResId.Builder() + .setResourceId(resourceId) + .build() + ) + .build() + ) + } + } + .build() + } + + private fun layout(wearControl: WearControl, actions: List, deviceParameters: DeviceParameters): LayoutElement { + if (wearControl == WearControl.DISABLED) { + return Text.Builder() + .setText(resources.getString(R.string.wear_control_not_enabled)) + .build() + } else if (wearControl == WearControl.NO_DATA) { + return Text.Builder() + .setText(resources.getString(R.string.wear_control_no_data)) + .build() + } + if (actions.isNotEmpty()) { + with(Column.Builder()) { + if (actions.size == 1 || actions.size == 3) { + addContent(addRowSingle(actions[0], deviceParameters)) + } + if (actions.size == 4 || actions.size == 2) { + addContent(addRowDouble(actions[0], actions[1], deviceParameters)) + } + if (actions.size == 3) { + addContent(addRowDouble(actions[1], actions[2], deviceParameters)) + } + if (actions.size == 4) { + addContent(Spacer.Builder().setHeight(dp(SPACING_ACTIONS)).build()) + addContent(addRowDouble(actions[2], actions[3], deviceParameters)) + } + return build() + } + } + return Text.Builder() + .setText(resources.getString(R.string.tile_no_config)) + .build() + } + + private fun addRowSingle(action: Action, deviceParameters: DeviceParameters): LayoutElement = + Row.Builder() + .addContent(action(action, deviceParameters)) + .build() + + private fun addRowDouble(action1: Action, action2: Action, deviceParameters: DeviceParameters): LayoutElement = + Row.Builder() + .addContent(action(action1, deviceParameters)) + .addContent(Spacer.Builder().setWidth(dp(SPACING_ACTIONS)).build()) + .addContent(action(action2, deviceParameters)) + .build() + + private fun doAction(action: Action): ActionBuilders.Action { + val builder = ActionBuilders.AndroidActivity.Builder() + .setClassName(action.activityClass) + .setPackageName(this.packageName) + if (action.action != null) { + val actionString = ActionBuilders.AndroidStringExtra.Builder().setValue(action.action.serialize()).build() + builder.addKeyToExtraMapping(DataLayerListenerServiceWear.KEY_ACTION, actionString) + } + if (action.message != null) { + val message = ActionBuilders.AndroidStringExtra.Builder().setValue(action.message).build() + builder.addKeyToExtraMapping(DataLayerListenerServiceWear.KEY_MESSAGE, message) + } + + return ActionBuilders.LaunchAction.Builder() + .setAndroidActivity(builder.build()) + .build() + } + + private fun action(action: Action, deviceParameters: DeviceParameters): LayoutElement { + val circleDiameter = circleDiameter(deviceParameters) + val text = action.buttonText + val textSub = action.buttonTextSub + return Box.Builder() + .setWidth(dp(circleDiameter)) + .setHeight(dp(circleDiameter)) + .setModifiers( + Modifiers.Builder() + .setBackground( + Background.Builder() + .setColor(argb(ContextCompat.getColor(baseContext, BUTTON_COLOR))) + .setCorner(Corner.Builder().setRadius(dp(circleDiameter / 2)).build()) + .build() + ) + .setSemantics( + Semantics.Builder() + .setContentDescription("$text $textSub") + .build() + ) + .setClickable( + Clickable.Builder() + .setOnClick(doAction(action)) + .build() + ) + .build() + ) + .addContent(addTextContent(action, deviceParameters)) + .build() + } + + private fun addTextContent(action: Action, deviceParameters: DeviceParameters): LayoutElement { + val circleDiameter = circleDiameter(deviceParameters) + val iconSize = dp(circleDiameter * ICON_SIZE_FRACTION) + val text = action.buttonText + val textSub = action.buttonTextSub + val col = Column.Builder() + .addContent( + Image.Builder() + .setWidth(iconSize) + .setHeight(iconSize) + .setResourceId(action.iconRes.toString()) + .build() + ).addContent( + Text.Builder() + .setText(text) + .setFontStyle( + FontStyle.Builder() + .setWeight(FONT_WEIGHT_BOLD) + .setColor(argb(ContextCompat.getColor(baseContext, R.color.white))) + .setSize(buttonTextSize(deviceParameters, text)) + .build() + ) + .build() + ) + if (textSub != null) { + col.addContent( + Text.Builder() + .setText(textSub) + .setFontStyle( + FontStyle.Builder() + .setColor(argb(ContextCompat.getColor(baseContext, R.color.white))) + .setSize(buttonTextSize(deviceParameters, textSub)) + .build() + ) + .build() + ) + } + + return col.build() + } + + private fun circleDiameter(deviceParameters: DeviceParameters) = when (deviceParameters.screenShape) { + SCREEN_SHAPE_ROUND -> ((sqrt(2f) - 1) * deviceParameters.screenHeightDp) - (2 * SPACING_ACTIONS) + else -> 0.5f * deviceParameters.screenHeightDp - SPACING_ACTIONS + } + + private fun buttonTextSize(deviceParameters: DeviceParameters, text: String): SpProp { + if (text.length > 6) { + return sp(if (isLargeScreen(deviceParameters)) 14f else 12f) + } + return sp(if (isLargeScreen(deviceParameters)) 16f else 14f) + } + + private fun isLargeScreen(deviceParameters: DeviceParameters): Boolean { + return deviceParameters.screenWidthDp >= LARGE_SCREEN_WIDTH_DP + } + + private fun getWearControl(): WearControl { + if (!sp.contains(R.string.key_wear_control)) { + return WearControl.NO_DATA + } + val wearControlPref = sp.getBoolean(R.string.key_wear_control, false) + if (wearControlPref) { + return WearControl.ENABLED + } + return WearControl.DISABLED + } + +} diff --git a/wear/src/main/java/info/nightscout/androidaps/tile/source/ActionSource.kt b/wear/src/main/kotlin/app/aaps/wear/tile/source/ActionSource.kt similarity index 81% rename from wear/src/main/java/info/nightscout/androidaps/tile/source/ActionSource.kt rename to wear/src/main/kotlin/app/aaps/wear/tile/source/ActionSource.kt index 36ace680f2..62ec956a9d 100644 --- a/wear/src/main/java/info/nightscout/androidaps/tile/source/ActionSource.kt +++ b/wear/src/main/kotlin/app/aaps/wear/tile/source/ActionSource.kt @@ -1,76 +1,76 @@ -package info.nightscout.androidaps.tile.source - -import android.content.Context -import android.content.res.Resources -import app.aaps.core.interfaces.logging.AAPSLogger -import app.aaps.core.interfaces.sharedPreferences.SP -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.actions.BolusActivity -import info.nightscout.androidaps.interaction.actions.CarbActivity -import info.nightscout.androidaps.interaction.actions.ECarbActivity -import info.nightscout.androidaps.interaction.actions.TempTargetActivity -import info.nightscout.androidaps.interaction.actions.TreatmentActivity -import info.nightscout.androidaps.interaction.actions.WizardActivity -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class ActionSource @Inject constructor(context: Context, sp: SP, aapsLogger: AAPSLogger) : StaticTileSource(context, sp, aapsLogger) { - - override val preferencePrefix = "tile_action_" - - override fun getActions(resources: Resources): List { - return listOf( - StaticAction( - settingName = "wizard", - buttonText = resources.getString(R.string.menu_wizard_short), - iconRes = R.drawable.ic_calculator_green, - activityClass = WizardActivity::class.java.name, - ), - StaticAction( - settingName = "treatment", - buttonText = resources.getString(R.string.menu_treatment_short), - iconRes = R.drawable.ic_bolus_carbs, - activityClass = TreatmentActivity::class.java.name, - ), - StaticAction( - settingName = "bolus", - buttonText = resources.getString(R.string.action_insulin), - iconRes = R.drawable.ic_bolus, - activityClass = BolusActivity::class.java.name, - ), - StaticAction( - settingName = "carbs", - buttonText = resources.getString(R.string.action_carbs), - iconRes = R.drawable.ic_carbs_orange, - activityClass = CarbActivity::class.java.name, - ), - StaticAction( - settingName = "ecarbs", - buttonText = resources.getString(R.string.action_ecarbs), - iconRes = R.drawable.ic_carbs_orange, - activityClass = ECarbActivity::class.java.name, - ), - StaticAction( - settingName = "temp_target", - buttonText = resources.getString(R.string.menu_tempt), - iconRes = R.drawable.ic_temptarget_flat, - activityClass = TempTargetActivity::class.java.name, - ) - ) - } - - override fun getResourceReferences(resources: Resources): List { - return getActions(resources).map { it.iconRes } - } - - override fun getDefaultConfig(): Map { - return mapOf( - "tile_action_1" to "wizard", - "tile_action_2" to "treatment", - "tile_action_3" to "ecarbs", - "tile_action_4" to "temp_target" - ) - } - -} +package app.aaps.wear.tile.source + +import android.content.Context +import android.content.res.Resources +import app.aaps.core.interfaces.logging.AAPSLogger +import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.wear.R +import app.aaps.wear.interaction.actions.BolusActivity +import app.aaps.wear.interaction.actions.CarbActivity +import app.aaps.wear.interaction.actions.ECarbActivity +import app.aaps.wear.interaction.actions.TempTargetActivity +import app.aaps.wear.interaction.actions.TreatmentActivity +import app.aaps.wear.interaction.actions.WizardActivity +import javax.inject.Inject +import javax.inject.Singleton + +@Singleton +class ActionSource @Inject constructor(context: Context, sp: SP, aapsLogger: AAPSLogger) : StaticTileSource(context, sp, aapsLogger) { + + override val preferencePrefix = "tile_action_" + + override fun getActions(resources: Resources): List { + return listOf( + StaticAction( + settingName = "wizard", + buttonText = resources.getString(R.string.menu_wizard_short), + iconRes = R.drawable.ic_calculator_green, + activityClass = WizardActivity::class.java.name, + ), + StaticAction( + settingName = "treatment", + buttonText = resources.getString(R.string.menu_treatment_short), + iconRes = R.drawable.ic_bolus_carbs, + activityClass = TreatmentActivity::class.java.name, + ), + StaticAction( + settingName = "bolus", + buttonText = resources.getString(R.string.action_insulin), + iconRes = R.drawable.ic_bolus, + activityClass = BolusActivity::class.java.name, + ), + StaticAction( + settingName = "carbs", + buttonText = resources.getString(R.string.action_carbs), + iconRes = R.drawable.ic_carbs_orange, + activityClass = CarbActivity::class.java.name, + ), + StaticAction( + settingName = "ecarbs", + buttonText = resources.getString(R.string.action_ecarbs), + iconRes = R.drawable.ic_carbs_orange, + activityClass = ECarbActivity::class.java.name, + ), + StaticAction( + settingName = "temp_target", + buttonText = resources.getString(R.string.menu_tempt), + iconRes = R.drawable.ic_temptarget_flat, + activityClass = TempTargetActivity::class.java.name, + ) + ) + } + + override fun getResourceReferences(resources: Resources): List { + return getActions(resources).map { it.iconRes } + } + + override fun getDefaultConfig(): Map { + return mapOf( + "tile_action_1" to "wizard", + "tile_action_2" to "treatment", + "tile_action_3" to "ecarbs", + "tile_action_4" to "temp_target" + ) + } + +} diff --git a/wear/src/main/java/info/nightscout/androidaps/tile/source/QuickWizardSource.kt b/wear/src/main/kotlin/app/aaps/wear/tile/source/QuickWizardSource.kt similarity index 90% rename from wear/src/main/java/info/nightscout/androidaps/tile/source/QuickWizardSource.kt rename to wear/src/main/kotlin/app/aaps/wear/tile/source/QuickWizardSource.kt index 48829ff81d..9da00b8ca5 100644 --- a/wear/src/main/java/info/nightscout/androidaps/tile/source/QuickWizardSource.kt +++ b/wear/src/main/kotlin/app/aaps/wear/tile/source/QuickWizardSource.kt @@ -1,81 +1,81 @@ -package info.nightscout.androidaps.tile.source - -import android.content.Context -import android.content.res.Resources -import app.aaps.core.interfaces.logging.AAPSLogger -import app.aaps.core.interfaces.logging.LTag -import app.aaps.core.interfaces.rx.weardata.EventData -import app.aaps.core.interfaces.sharedPreferences.SP -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.actions.BackgroundActionActivity -import info.nightscout.androidaps.tile.Action -import info.nightscout.androidaps.tile.TileSource -import java.util.Calendar -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class QuickWizardSource @Inject constructor(private val context: Context, private val sp: SP, private val aapsLogger: AAPSLogger) : TileSource { - - override fun getSelectedActions(): List { - val quickList = mutableListOf() - val quickMap = getQuickWizardData(sp) - val sfm = secondsFromMidnight() - - for (quick in quickMap.entries) { - val isActive = sfm in quick.validFrom..quick.validTo - if (isActive && quick.guid.isNotEmpty()) { - quickList.add( - Action( - buttonText = quick.buttonText, - buttonTextSub = "${quick.carbs} g", - iconRes = R.drawable.ic_quick_wizard, - activityClass = BackgroundActionActivity::class.java.name, - action = EventData.ActionQuickWizardPreCheck(quick.guid), - message = context.resources.getString(R.string.action_quick_wizard_confirmation) - ) - ) - aapsLogger.info(LTag.WEAR, """getSelectedActions: active ${quick.buttonText} guid=${quick.guid}""") - } else { - aapsLogger.info(LTag.WEAR, """getSelectedActions: not active ${quick.buttonText} guid=${quick.guid}""") - } - } - return quickList - } - - override fun getValidFor(): Long? { - val quickMap = getQuickWizardData(sp) - if (quickMap.entries.size == 0) return null - - val sfm = secondsFromMidnight() - var validTill = 24 * 60 * 60 - - for (quick in quickMap.entries) { - val isActive = sfm in quick.validFrom..quick.validTo - if (quick.guid.isNotEmpty()) { - if (isActive && validTill > quick.validTo) validTill = quick.validTo - if (quick.validFrom in (sfm + 1) until validTill) validTill = quick.validFrom - } - } - - val validWithin = 60 - //aapsLogger.info(LTag.WEAR, "getValidTill: sfm$sfm till$validTill d=$delta") - return (validTill - sfm + validWithin) * 1000L - } - - private fun getQuickWizardData(sp: SP): EventData.QuickWizard = - EventData.deserialize(sp.getString(R.string.key_quick_wizard_data, EventData.QuickWizard(arrayListOf()).serialize())) as EventData.QuickWizard - - private fun secondsFromMidnight(): Int { - val c = Calendar.getInstance() - c.set(Calendar.HOUR_OF_DAY, 0) - c.set(Calendar.MINUTE, 0) - c.set(Calendar.SECOND, 0) - c.set(Calendar.MILLISECOND, 0) - val passed: Long = System.currentTimeMillis() - c.timeInMillis - - return (passed / 1000).toInt() - } - - override fun getResourceReferences(resources: Resources): List = listOf(R.drawable.ic_quick_wizard) -} +package app.aaps.wear.tile.source + +import android.content.Context +import android.content.res.Resources +import app.aaps.core.interfaces.logging.AAPSLogger +import app.aaps.core.interfaces.logging.LTag +import app.aaps.core.interfaces.rx.weardata.EventData +import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.wear.R +import app.aaps.wear.interaction.actions.BackgroundActionActivity +import app.aaps.wear.tile.Action +import app.aaps.wear.tile.TileSource +import java.util.Calendar +import javax.inject.Inject +import javax.inject.Singleton + +@Singleton +class QuickWizardSource @Inject constructor(private val context: Context, private val sp: SP, private val aapsLogger: AAPSLogger) : TileSource { + + override fun getSelectedActions(): List { + val quickList = mutableListOf() + val quickMap = getQuickWizardData(sp) + val sfm = secondsFromMidnight() + + for (quick in quickMap.entries) { + val isActive = sfm in quick.validFrom..quick.validTo + if (isActive && quick.guid.isNotEmpty()) { + quickList.add( + Action( + buttonText = quick.buttonText, + buttonTextSub = "${quick.carbs} g", + iconRes = R.drawable.ic_quick_wizard, + activityClass = BackgroundActionActivity::class.java.name, + action = EventData.ActionQuickWizardPreCheck(quick.guid), + message = context.resources.getString(R.string.action_quick_wizard_confirmation) + ) + ) + aapsLogger.info(LTag.WEAR, """getSelectedActions: active ${quick.buttonText} guid=${quick.guid}""") + } else { + aapsLogger.info(LTag.WEAR, """getSelectedActions: not active ${quick.buttonText} guid=${quick.guid}""") + } + } + return quickList + } + + override fun getValidFor(): Long? { + val quickMap = getQuickWizardData(sp) + if (quickMap.entries.size == 0) return null + + val sfm = secondsFromMidnight() + var validTill = 24 * 60 * 60 + + for (quick in quickMap.entries) { + val isActive = sfm in quick.validFrom..quick.validTo + if (quick.guid.isNotEmpty()) { + if (isActive && validTill > quick.validTo) validTill = quick.validTo + if (quick.validFrom in (sfm + 1) until validTill) validTill = quick.validFrom + } + } + + val validWithin = 60 + //aapsLogger.info(LTag.WEAR, "getValidTill: sfm$sfm till$validTill d=$delta") + return (validTill - sfm + validWithin) * 1000L + } + + private fun getQuickWizardData(sp: SP): EventData.QuickWizard = + EventData.deserialize(sp.getString(R.string.key_quick_wizard_data, EventData.QuickWizard(arrayListOf()).serialize())) as EventData.QuickWizard + + private fun secondsFromMidnight(): Int { + val c = Calendar.getInstance() + c.set(Calendar.HOUR_OF_DAY, 0) + c.set(Calendar.MINUTE, 0) + c.set(Calendar.SECOND, 0) + c.set(Calendar.MILLISECOND, 0) + val passed: Long = System.currentTimeMillis() - c.timeInMillis + + return (passed / 1000).toInt() + } + + override fun getResourceReferences(resources: Resources): List = listOf(R.drawable.ic_quick_wizard) +} diff --git a/wear/src/main/java/info/nightscout/androidaps/tile/source/StaticTileSource.kt b/wear/src/main/kotlin/app/aaps/wear/tile/source/StaticTileSource.kt similarity index 90% rename from wear/src/main/java/info/nightscout/androidaps/tile/source/StaticTileSource.kt rename to wear/src/main/kotlin/app/aaps/wear/tile/source/StaticTileSource.kt index 0ac9a7381f..2d5e1489a3 100644 --- a/wear/src/main/java/info/nightscout/androidaps/tile/source/StaticTileSource.kt +++ b/wear/src/main/kotlin/app/aaps/wear/tile/source/StaticTileSource.kt @@ -1,61 +1,61 @@ -package info.nightscout.androidaps.tile.source - -import android.content.Context -import android.content.res.Resources -import androidx.annotation.DrawableRes -import app.aaps.core.interfaces.logging.AAPSLogger -import app.aaps.core.interfaces.rx.weardata.EventData -import app.aaps.core.interfaces.sharedPreferences.SP -import info.nightscout.androidaps.tile.Action -import info.nightscout.androidaps.tile.TileSource - -abstract class StaticTileSource(val context: Context, val sp: SP, val aapsLogger: AAPSLogger) : TileSource { - - class StaticAction( - val settingName: String, - buttonText: String, - buttonTextSub: String? = null, - activityClass: String, - @DrawableRes iconRes: Int, - action: EventData? = null, - message: String? = null, - ) : Action(buttonText, buttonTextSub, activityClass, iconRes, action, message) - - abstract fun getActions(resources: Resources): List - - abstract val preferencePrefix: String - abstract fun getDefaultConfig(): Map - - override fun getSelectedActions(): List { - setDefaultSettings() - - val actionList: MutableList = mutableListOf() - for (i in 1..4) { - val action = getActionFromPreference(i) - if (action != null) { - actionList.add(action) - } - } - if (actionList.isEmpty()) { - return getActions(context.resources).take(4) - } - return actionList - } - - override fun getValidFor(): Long? = null - - private fun getActionFromPreference(index: Int): Action? { - val actionPref = sp.getString(preferencePrefix + index, "none") - return getActions(context.resources).find { action -> action.settingName == actionPref } - } - - private fun setDefaultSettings() { - val defaults = getDefaultConfig() - val firstKey = defaults.firstNotNullOf { settings -> settings.key } - if (!sp.contains(firstKey)) { - for ((key, value) in defaults) { - sp.putString(key, value) - } - } - } -} +package app.aaps.wear.tile.source + +import android.content.Context +import android.content.res.Resources +import androidx.annotation.DrawableRes +import app.aaps.core.interfaces.logging.AAPSLogger +import app.aaps.core.interfaces.rx.weardata.EventData +import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.wear.tile.Action +import app.aaps.wear.tile.TileSource + +abstract class StaticTileSource(val context: Context, val sp: SP, val aapsLogger: AAPSLogger) : TileSource { + + class StaticAction( + val settingName: String, + buttonText: String, + buttonTextSub: String? = null, + activityClass: String, + @DrawableRes iconRes: Int, + action: EventData? = null, + message: String? = null, + ) : Action(buttonText, buttonTextSub, activityClass, iconRes, action, message) + + abstract fun getActions(resources: Resources): List + + abstract val preferencePrefix: String + abstract fun getDefaultConfig(): Map + + override fun getSelectedActions(): List { + setDefaultSettings() + + val actionList: MutableList = mutableListOf() + for (i in 1..4) { + val action = getActionFromPreference(i) + if (action != null) { + actionList.add(action) + } + } + if (actionList.isEmpty()) { + return getActions(context.resources).take(4) + } + return actionList + } + + override fun getValidFor(): Long? = null + + private fun getActionFromPreference(index: Int): Action? { + val actionPref = sp.getString(preferencePrefix + index, "none") + return getActions(context.resources).find { action -> action.settingName == actionPref } + } + + private fun setDefaultSettings() { + val defaults = getDefaultConfig() + val firstKey = defaults.firstNotNullOf { settings -> settings.key } + if (!sp.contains(firstKey)) { + for ((key, value) in defaults) { + sp.putString(key, value) + } + } + } +} diff --git a/wear/src/main/java/info/nightscout/androidaps/tile/source/TempTargetSource.kt b/wear/src/main/kotlin/app/aaps/wear/tile/source/TempTargetSource.kt similarity index 92% rename from wear/src/main/java/info/nightscout/androidaps/tile/source/TempTargetSource.kt rename to wear/src/main/kotlin/app/aaps/wear/tile/source/TempTargetSource.kt index deaefb3318..12db6c6fd8 100644 --- a/wear/src/main/java/info/nightscout/androidaps/tile/source/TempTargetSource.kt +++ b/wear/src/main/kotlin/app/aaps/wear/tile/source/TempTargetSource.kt @@ -1,83 +1,83 @@ -package info.nightscout.androidaps.tile.source - -import android.content.Context -import android.content.res.Resources -import app.aaps.core.interfaces.logging.AAPSLogger -import app.aaps.core.interfaces.rx.weardata.EventData -import app.aaps.core.interfaces.sharedPreferences.SP -import info.nightscout.androidaps.R -import info.nightscout.androidaps.interaction.actions.BackgroundActionActivity -import info.nightscout.androidaps.interaction.actions.TempTargetActivity -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class TempTargetSource @Inject constructor(context: Context, sp: SP, aapsLogger: AAPSLogger) : StaticTileSource(context, sp, aapsLogger) { - - override val preferencePrefix = "tile_tempt_" - - override fun getActions(resources: Resources): List { - val message = resources.getString(R.string.action_tempt_confirmation) - return listOf( - StaticAction( - settingName = "activity", - buttonText = resources.getString(R.string.temp_target_activity), - iconRes = R.drawable.ic_target_activity, - activityClass = BackgroundActionActivity::class.java.name, - message = message, - // actionString = "temptarget false 90 8.0 8.0", - // actionString = "temptarget preset activity", - action = EventData.ActionTempTargetPreCheck(EventData.ActionTempTargetPreCheck.TempTargetCommand.PRESET_ACTIVITY) - ), - StaticAction( - settingName = "eating_soon", - buttonText = resources.getString(R.string.temp_target_eating_soon), - iconRes = R.drawable.ic_target_eatingsoon, - activityClass = BackgroundActionActivity::class.java.name, - message = message, - // actionString = "temptarget false 45 4.5 4.5", - // actionString = "temptarget preset eating", - action = EventData.ActionTempTargetPreCheck(EventData.ActionTempTargetPreCheck.TempTargetCommand.PRESET_EATING) - ), - StaticAction( - settingName = "hypo", - buttonText = resources.getString(R.string.temp_target_hypo), - iconRes = R.drawable.ic_target_hypo, - activityClass = BackgroundActionActivity::class.java.name, - message = message, - // actionString = "temptarget false 45 7.0 7.0", - // actionString = "temptarget preset hypo", - action = EventData.ActionTempTargetPreCheck(EventData.ActionTempTargetPreCheck.TempTargetCommand.PRESET_HYPO) - ), - StaticAction( - settingName = "manual", - buttonText = resources.getString(R.string.temp_target_manual), - iconRes = R.drawable.ic_target_manual, - activityClass = TempTargetActivity::class.java.name, - action = null - ), - StaticAction( - settingName = "cancel", - buttonText = resources.getString(android.support.wearable.R.string.generic_cancel), - iconRes = R.drawable.ic_target_cancel, - activityClass = BackgroundActionActivity::class.java.name, - message = message, - //actionString = "temptarget cancel", - action = EventData.ActionTempTargetPreCheck(EventData.ActionTempTargetPreCheck.TempTargetCommand.CANCEL) - ) - ) - } - - override fun getResourceReferences(resources: Resources): List { - return getActions(resources).map { it.iconRes } - } - - override fun getDefaultConfig(): Map { - return mapOf( - "tile_tempt_1" to "activity", - "tile_tempt_2" to "eating_soon", - "tile_tempt_3" to "hypo", - "tile_tempt_4" to "manual" - ) - } -} +package app.aaps.wear.tile.source + +import android.content.Context +import android.content.res.Resources +import app.aaps.core.interfaces.logging.AAPSLogger +import app.aaps.core.interfaces.rx.weardata.EventData +import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.wear.R +import app.aaps.wear.interaction.actions.BackgroundActionActivity +import app.aaps.wear.interaction.actions.TempTargetActivity +import javax.inject.Inject +import javax.inject.Singleton + +@Singleton +class TempTargetSource @Inject constructor(context: Context, sp: SP, aapsLogger: AAPSLogger) : StaticTileSource(context, sp, aapsLogger) { + + override val preferencePrefix = "tile_tempt_" + + override fun getActions(resources: Resources): List { + val message = resources.getString(R.string.action_tempt_confirmation) + return listOf( + StaticAction( + settingName = "activity", + buttonText = resources.getString(R.string.temp_target_activity), + iconRes = R.drawable.ic_target_activity, + activityClass = BackgroundActionActivity::class.java.name, + message = message, + // actionString = "temptarget false 90 8.0 8.0", + // actionString = "temptarget preset activity", + action = EventData.ActionTempTargetPreCheck(EventData.ActionTempTargetPreCheck.TempTargetCommand.PRESET_ACTIVITY) + ), + StaticAction( + settingName = "eating_soon", + buttonText = resources.getString(R.string.temp_target_eating_soon), + iconRes = R.drawable.ic_target_eatingsoon, + activityClass = BackgroundActionActivity::class.java.name, + message = message, + // actionString = "temptarget false 45 4.5 4.5", + // actionString = "temptarget preset eating", + action = EventData.ActionTempTargetPreCheck(EventData.ActionTempTargetPreCheck.TempTargetCommand.PRESET_EATING) + ), + StaticAction( + settingName = "hypo", + buttonText = resources.getString(R.string.temp_target_hypo), + iconRes = R.drawable.ic_target_hypo, + activityClass = BackgroundActionActivity::class.java.name, + message = message, + // actionString = "temptarget false 45 7.0 7.0", + // actionString = "temptarget preset hypo", + action = EventData.ActionTempTargetPreCheck(EventData.ActionTempTargetPreCheck.TempTargetCommand.PRESET_HYPO) + ), + StaticAction( + settingName = "manual", + buttonText = resources.getString(R.string.temp_target_manual), + iconRes = R.drawable.ic_target_manual, + activityClass = TempTargetActivity::class.java.name, + action = null + ), + StaticAction( + settingName = "cancel", + buttonText = resources.getString(android.support.wearable.R.string.generic_cancel), + iconRes = R.drawable.ic_target_cancel, + activityClass = BackgroundActionActivity::class.java.name, + message = message, + //actionString = "temptarget cancel", + action = EventData.ActionTempTargetPreCheck(EventData.ActionTempTargetPreCheck.TempTargetCommand.CANCEL) + ) + ) + } + + override fun getResourceReferences(resources: Resources): List { + return getActions(resources).map { it.iconRes } + } + + override fun getDefaultConfig(): Map { + return mapOf( + "tile_tempt_1" to "activity", + "tile_tempt_2" to "eating_soon", + "tile_tempt_3" to "hypo", + "tile_tempt_4" to "manual" + ) + } +} diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/AapsLargeWatchface.kt b/wear/src/main/kotlin/app/aaps/wear/watchfaces/AapsLargeWatchface.kt similarity index 96% rename from wear/src/main/java/info/nightscout/androidaps/watchfaces/AapsLargeWatchface.kt rename to wear/src/main/kotlin/app/aaps/wear/watchfaces/AapsLargeWatchface.kt index b8f922f300..9e6abbfb02 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/AapsLargeWatchface.kt +++ b/wear/src/main/kotlin/app/aaps/wear/watchfaces/AapsLargeWatchface.kt @@ -1,13 +1,13 @@ -package info.nightscout.androidaps.watchfaces +package app.aaps.wear.watchfaces import android.graphics.Color import android.view.LayoutInflater import androidx.core.content.ContextCompat import androidx.viewbinding.ViewBinding +import app.aaps.wear.R +import app.aaps.wear.databinding.ActivityHomeLargeBinding +import app.aaps.wear.watchfaces.utils.BaseWatchFace import com.ustwo.clockwise.common.WatchMode -import info.nightscout.androidaps.R -import info.nightscout.androidaps.databinding.ActivityHomeLargeBinding -import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace class AapsLargeWatchface : BaseWatchFace() { diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/AapsV2Watchface.kt b/wear/src/main/kotlin/app/aaps/wear/watchfaces/AapsV2Watchface.kt similarity index 97% rename from wear/src/main/java/info/nightscout/androidaps/watchfaces/AapsV2Watchface.kt rename to wear/src/main/kotlin/app/aaps/wear/watchfaces/AapsV2Watchface.kt index 2bd28d0866..df7723998d 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/AapsV2Watchface.kt +++ b/wear/src/main/kotlin/app/aaps/wear/watchfaces/AapsV2Watchface.kt @@ -1,14 +1,14 @@ -package info.nightscout.androidaps.watchfaces +package app.aaps.wear.watchfaces import android.graphics.Color import android.view.LayoutInflater import androidx.annotation.ColorInt import androidx.core.content.ContextCompat import androidx.viewbinding.ViewBinding +import app.aaps.wear.R +import app.aaps.wear.databinding.ActivityHome2Binding +import app.aaps.wear.watchfaces.utils.BaseWatchFace import com.ustwo.clockwise.common.WatchMode -import info.nightscout.androidaps.R -import info.nightscout.androidaps.databinding.ActivityHome2Binding -import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace class AapsV2Watchface : BaseWatchFace() { diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/AapsWatchface.kt b/wear/src/main/kotlin/app/aaps/wear/watchfaces/AapsWatchface.kt similarity index 96% rename from wear/src/main/java/info/nightscout/androidaps/watchfaces/AapsWatchface.kt rename to wear/src/main/kotlin/app/aaps/wear/watchfaces/AapsWatchface.kt index 4fb3bfc30e..5523e06b88 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/AapsWatchface.kt +++ b/wear/src/main/kotlin/app/aaps/wear/watchfaces/AapsWatchface.kt @@ -1,13 +1,13 @@ -package info.nightscout.androidaps.watchfaces +package app.aaps.wear.watchfaces import android.graphics.Color import android.view.LayoutInflater import androidx.core.content.ContextCompat import androidx.viewbinding.ViewBinding +import app.aaps.wear.R +import app.aaps.wear.databinding.ActivityHomeBinding +import app.aaps.wear.watchfaces.utils.BaseWatchFace import com.ustwo.clockwise.common.WatchMode -import info.nightscout.androidaps.R -import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace -import info.nightscout.androidaps.databinding.ActivityHomeBinding class AapsWatchface : BaseWatchFace() { diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BigChartWatchface.kt b/wear/src/main/kotlin/app/aaps/wear/watchfaces/BigChartWatchface.kt similarity index 90% rename from wear/src/main/java/info/nightscout/androidaps/watchfaces/BigChartWatchface.kt rename to wear/src/main/kotlin/app/aaps/wear/watchfaces/BigChartWatchface.kt index 020c1c8d4b..dbad8dbd01 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BigChartWatchface.kt +++ b/wear/src/main/kotlin/app/aaps/wear/watchfaces/BigChartWatchface.kt @@ -1,16 +1,16 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.watchfaces +package app.aaps.wear.watchfaces import android.annotation.SuppressLint import android.view.LayoutInflater import androidx.core.content.ContextCompat import androidx.viewbinding.ViewBinding +import app.aaps.wear.R +import app.aaps.wear.databinding.ActivityBigchartBinding +import app.aaps.wear.watchfaces.utils.BaseWatchFace +import app.aaps.wear.watchfaces.utils.WatchfaceViewAdapter import com.ustwo.clockwise.common.WatchMode -import info.nightscout.androidaps.R -import info.nightscout.androidaps.databinding.ActivityBigchartBinding -import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace -import info.nightscout.androidaps.watchfaces.utils.WatchfaceViewAdapter class BigChartWatchface : BaseWatchFace() { @@ -53,9 +53,9 @@ class BigChartWatchface : BaseWatchFace() { binding.status?.setTextColor(ContextCompat.getColor(this, R.color.dark_statusView)) binding.mainLayout.setBackgroundColor(ContextCompat.getColor(this, R.color.dark_background)) val color = when (singleBg.sgvLevel) { - 1L -> R.color.dark_highColor - 0L -> R.color.dark_midColor - -1L -> R.color.dark_lowColor + 1L -> R.color.dark_highColor + 0L -> R.color.dark_midColor + -1L -> R.color.dark_lowColor else -> R.color.dark_midColor } binding.sgv?.setTextColor(ContextCompat.getColor(this, color)) @@ -82,9 +82,9 @@ class BigChartWatchface : BaseWatchFace() { binding.status?.setTextColor(ContextCompat.getColor(this, R.color.light_bigchart_status)) binding.mainLayout.setBackgroundColor(ContextCompat.getColor(this, R.color.light_background)) val color = when (singleBg.sgvLevel) { - 1L -> R.color.light_highColor - 0L -> R.color.light_midColor - -1L -> R.color.light_lowColor + 1L -> R.color.light_highColor + 0L -> R.color.light_midColor + -1L -> R.color.light_lowColor else -> R.color.light_midColor } binding.sgv?.setTextColor(ContextCompat.getColor(this, color)) diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/CircleWatchface.kt b/wear/src/main/kotlin/app/aaps/wear/watchfaces/CircleWatchface.kt similarity index 98% rename from wear/src/main/java/info/nightscout/androidaps/watchfaces/CircleWatchface.kt rename to wear/src/main/kotlin/app/aaps/wear/watchfaces/CircleWatchface.kt index cd132d0c74..1d92a673d5 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/CircleWatchface.kt +++ b/wear/src/main/kotlin/app/aaps/wear/watchfaces/CircleWatchface.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.watchfaces +package app.aaps.wear.watchfaces import android.annotation.SuppressLint import android.content.Intent @@ -25,13 +25,13 @@ import app.aaps.core.interfaces.rx.weardata.EventData import app.aaps.core.interfaces.rx.weardata.EventData.ActionResendData import app.aaps.core.interfaces.rx.weardata.EventData.SingleBg import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.wear.R +import app.aaps.wear.data.RawDisplayData +import app.aaps.wear.interaction.menus.MainMenuActivity +import app.aaps.wear.interaction.utils.Persistence import com.ustwo.clockwise.common.WatchFaceTime import com.ustwo.clockwise.wearable.WatchFace import dagger.android.AndroidInjection -import info.nightscout.androidaps.R -import info.nightscout.androidaps.data.RawDisplayData -import info.nightscout.androidaps.interaction.menus.MainMenuActivity -import info.nightscout.androidaps.interaction.utils.Persistence import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.* diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/CockpitWatchface.kt b/wear/src/main/kotlin/app/aaps/wear/watchfaces/CockpitWatchface.kt similarity index 86% rename from wear/src/main/java/info/nightscout/androidaps/watchfaces/CockpitWatchface.kt rename to wear/src/main/kotlin/app/aaps/wear/watchfaces/CockpitWatchface.kt index 97af6a42e1..7c0ac08220 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/CockpitWatchface.kt +++ b/wear/src/main/kotlin/app/aaps/wear/watchfaces/CockpitWatchface.kt @@ -1,11 +1,11 @@ -package info.nightscout.androidaps.watchfaces +package app.aaps.wear.watchfaces import android.view.LayoutInflater import android.view.View import androidx.viewbinding.ViewBinding -import info.nightscout.androidaps.R -import info.nightscout.androidaps.databinding.ActivityCockpitBinding -import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace +import app.aaps.wear.R +import app.aaps.wear.databinding.ActivityCockpitBinding +import app.aaps.wear.watchfaces.utils.BaseWatchFace /** * Created by andrew-warrington on 18/11/2017. @@ -24,9 +24,9 @@ class CockpitWatchface : BaseWatchFace() { binding.mainLayout.setBackgroundResource(R.drawable.airplane_cockpit_outside_clouds) setTextSizes() val led = when (singleBg.sgvLevel) { - 1L -> R.drawable.airplane_led_yellow_lit - 0L -> R.drawable.airplane_led_grey_unlit - -1L -> R.drawable.airplane_led_red_lit + 1L -> R.drawable.airplane_led_yellow_lit + 0L -> R.drawable.airplane_led_grey_unlit + -1L -> R.drawable.airplane_led_red_lit else -> R.drawable.airplane_led_grey_unlit } diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/CustomWatchface.kt b/wear/src/main/kotlin/app/aaps/wear/watchfaces/CustomWatchface.kt similarity index 99% rename from wear/src/main/java/info/nightscout/androidaps/watchfaces/CustomWatchface.kt rename to wear/src/main/kotlin/app/aaps/wear/watchfaces/CustomWatchface.kt index c5b47976d0..e8d5d868ae 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/CustomWatchface.kt +++ b/wear/src/main/kotlin/app/aaps/wear/watchfaces/CustomWatchface.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.watchfaces +package app.aaps.wear.watchfaces import android.annotation.SuppressLint import android.content.Context @@ -44,9 +44,9 @@ import app.aaps.core.interfaces.rx.weardata.ResFileMap import app.aaps.core.interfaces.rx.weardata.ResFormat import app.aaps.core.interfaces.rx.weardata.ViewKeys import app.aaps.core.interfaces.rx.weardata.ZipWatchfaceFormat -import info.nightscout.androidaps.R -import info.nightscout.androidaps.databinding.ActivityCustomBinding -import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace +import app.aaps.wear.R +import app.aaps.wear.databinding.ActivityCustomBinding +import app.aaps.wear.watchfaces.utils.BaseWatchFace import org.joda.time.TimeOfDay import org.json.JSONObject import java.io.ByteArrayOutputStream diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/DigitalStyleWatchface.kt b/wear/src/main/kotlin/app/aaps/wear/watchfaces/DigitalStyleWatchface.kt similarity index 96% rename from wear/src/main/java/info/nightscout/androidaps/watchfaces/DigitalStyleWatchface.kt rename to wear/src/main/kotlin/app/aaps/wear/watchfaces/DigitalStyleWatchface.kt index c490adf38e..377632b0c4 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/DigitalStyleWatchface.kt +++ b/wear/src/main/kotlin/app/aaps/wear/watchfaces/DigitalStyleWatchface.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.watchfaces +package app.aaps.wear.watchfaces import android.annotation.SuppressLint import android.support.wearable.watchface.WatchFaceStyle @@ -10,9 +10,9 @@ import android.widget.LinearLayout import androidx.core.content.ContextCompat import androidx.viewbinding.ViewBinding import app.aaps.core.interfaces.logging.LTag -import info.nightscout.androidaps.R -import info.nightscout.androidaps.databinding.ActivityDigitalstyleBinding -import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace +import app.aaps.wear.R +import app.aaps.wear.databinding.ActivityDigitalstyleBinding +import app.aaps.wear.watchfaces.utils.BaseWatchFace class DigitalStyleWatchface : BaseWatchFace() { diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/NoChartWatchface.kt b/wear/src/main/kotlin/app/aaps/wear/watchfaces/NoChartWatchface.kt similarity index 90% rename from wear/src/main/java/info/nightscout/androidaps/watchfaces/NoChartWatchface.kt rename to wear/src/main/kotlin/app/aaps/wear/watchfaces/NoChartWatchface.kt index ac160baaf3..4f64489e9c 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/NoChartWatchface.kt +++ b/wear/src/main/kotlin/app/aaps/wear/watchfaces/NoChartWatchface.kt @@ -1,14 +1,13 @@ -package info.nightscout.androidaps.watchfaces +package app.aaps.wear.watchfaces import android.view.LayoutInflater import androidx.core.content.ContextCompat import androidx.viewbinding.ViewBinding +import app.aaps.wear.R +import app.aaps.wear.databinding.ActivityNochartBinding +import app.aaps.wear.watchfaces.utils.BaseWatchFace +import app.aaps.wear.watchfaces.utils.WatchfaceViewAdapter import com.ustwo.clockwise.common.WatchMode -import info.nightscout.androidaps.R -import info.nightscout.androidaps.databinding.ActivityBigchartBinding -import info.nightscout.androidaps.databinding.ActivityNochartBinding -import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace -import info.nightscout.androidaps.watchfaces.utils.WatchfaceViewAdapter class NoChartWatchface : BaseWatchFace() { diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/SteampunkWatchface.kt b/wear/src/main/kotlin/app/aaps/wear/watchfaces/SteampunkWatchface.kt similarity index 97% rename from wear/src/main/java/info/nightscout/androidaps/watchfaces/SteampunkWatchface.kt rename to wear/src/main/kotlin/app/aaps/wear/watchfaces/SteampunkWatchface.kt index f17ceb84b7..dc3acea391 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/SteampunkWatchface.kt +++ b/wear/src/main/kotlin/app/aaps/wear/watchfaces/SteampunkWatchface.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.watchfaces +package app.aaps.wear.watchfaces import android.view.LayoutInflater import android.view.animation.Animation @@ -9,9 +9,9 @@ import android.view.animation.RotateAnimation import androidx.core.content.ContextCompat import androidx.viewbinding.ViewBinding import app.aaps.core.interfaces.utils.SafeParse.stringToFloat -import info.nightscout.androidaps.R -import info.nightscout.androidaps.databinding.ActivitySteampunkBinding -import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace +import app.aaps.wear.R +import app.aaps.wear.databinding.ActivitySteampunkBinding +import app.aaps.wear.watchfaces.utils.BaseWatchFace import org.joda.time.TimeOfDay /** diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/BaseWatchFace.kt b/wear/src/main/kotlin/app/aaps/wear/watchfaces/utils/BaseWatchFace.kt similarity index 97% rename from wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/BaseWatchFace.kt rename to wear/src/main/kotlin/app/aaps/wear/watchfaces/utils/BaseWatchFace.kt index a69a4f5595..ea623a9946 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/BaseWatchFace.kt +++ b/wear/src/main/kotlin/app/aaps/wear/watchfaces/utils/BaseWatchFace.kt @@ -1,6 +1,6 @@ @file:Suppress("DEPRECATION") -package info.nightscout.androidaps.watchfaces.utils +package app.aaps.wear.watchfaces.utils import android.annotation.SuppressLint import android.content.Intent @@ -23,18 +23,18 @@ import app.aaps.core.interfaces.rx.weardata.EventData import app.aaps.core.interfaces.rx.weardata.EventData.ActionResendData import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil +import app.aaps.wear.R +import app.aaps.wear.data.RawDisplayData +import app.aaps.wear.events.EventWearPreferenceChange +import app.aaps.wear.heartrate.HeartRateListener +import app.aaps.wear.interaction.menus.MainMenuActivity +import app.aaps.wear.interaction.utils.Persistence +import app.aaps.wear.interaction.utils.WearUtil import com.ustwo.clockwise.common.WatchFaceTime import com.ustwo.clockwise.common.WatchMode import com.ustwo.clockwise.common.WatchShape import com.ustwo.clockwise.wearable.WatchFace import dagger.android.AndroidInjection -import info.nightscout.androidaps.R -import info.nightscout.androidaps.data.RawDisplayData -import info.nightscout.androidaps.events.EventWearPreferenceChange -import info.nightscout.androidaps.heartrate.HeartRateListener -import info.nightscout.androidaps.interaction.menus.MainMenuActivity -import info.nightscout.androidaps.interaction.utils.Persistence -import info.nightscout.androidaps.interaction.utils.WearUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/BgGraphBuilder.kt b/wear/src/main/kotlin/app/aaps/wear/watchfaces/utils/BgGraphBuilder.kt similarity index 99% rename from wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/BgGraphBuilder.kt rename to wear/src/main/kotlin/app/aaps/wear/watchfaces/utils/BgGraphBuilder.kt index 6e2f27edf3..d33fc56006 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/BgGraphBuilder.kt +++ b/wear/src/main/kotlin/app/aaps/wear/watchfaces/utils/BgGraphBuilder.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.watchfaces.utils +package app.aaps.wear.watchfaces.utils import android.graphics.DashPathEffect import app.aaps.core.interfaces.rx.weardata.EventData @@ -6,7 +6,7 @@ import app.aaps.core.interfaces.rx.weardata.EventData.SingleBg import app.aaps.core.interfaces.rx.weardata.EventData.TreatmentData.Basal import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil -import info.nightscout.androidaps.R +import app.aaps.wear.R import lecho.lib.hellocharts.model.Axis import lecho.lib.hellocharts.model.AxisValue import lecho.lib.hellocharts.model.Line diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/SimpleUi.kt b/wear/src/main/kotlin/app/aaps/wear/watchfaces/utils/SimpleUi.kt similarity index 96% rename from wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/SimpleUi.kt rename to wear/src/main/kotlin/app/aaps/wear/watchfaces/utils/SimpleUi.kt index 5036848c4a..6cd4d5890c 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/SimpleUi.kt +++ b/wear/src/main/kotlin/app/aaps/wear/watchfaces/utils/SimpleUi.kt @@ -1,154 +1,154 @@ -package info.nightscout.androidaps.watchfaces.utils - -import android.content.BroadcastReceiver -import android.content.Context -import android.content.Intent -import android.content.IntentFilter -import android.graphics.Canvas -import android.graphics.Paint -import android.graphics.Point -import android.graphics.Typeface -import android.os.BatteryManager -import android.view.WindowManager -import androidx.core.content.ContextCompat -import app.aaps.core.interfaces.rx.weardata.EventData -import app.aaps.core.interfaces.sharedPreferences.SP -import app.aaps.core.interfaces.utils.DateUtil -import com.ustwo.clockwise.common.WatchMode -import com.ustwo.clockwise.wearable.WatchFace -import info.nightscout.androidaps.R -import javax.inject.Inject - -class SimpleUi @Inject constructor( - private val context: Context, - private val sp: SP, - private val dateUtil: DateUtil -) { - - private var batteryReceiver: BroadcastReceiver? = null - private var mBackgroundPaint = Paint() - private lateinit var mTimePaint: Paint - private lateinit var mSvgPaint: Paint - private lateinit var mDirectionPaint: Paint - private var mYOffset = 0f - private val colorDarkHigh = ContextCompat.getColor(context, R.color.dark_highColor) - private var colorDarkMid = ContextCompat.getColor(context, R.color.dark_midColor) - private var colorDarkLow = ContextCompat.getColor(context, R.color.dark_lowColor) - private val displaySize = Point() - private lateinit var callback: () -> Unit - - fun onCreate(callback: () -> Unit) { - this.callback = callback - @Suppress("DEPRECATION") - (context.getSystemService(WatchFace.WINDOW_SERVICE) as WindowManager).defaultDisplay.getSize(displaySize) - setupBatteryReceiver() - setupUi() - } - - fun updatePreferences() { - setupBatteryReceiver() - } - - fun setAntiAlias(currentWatchMode: WatchMode) { - val antiAlias = currentWatchMode == WatchMode.AMBIENT - mSvgPaint.isAntiAlias = antiAlias - mDirectionPaint.isAntiAlias = antiAlias - mTimePaint.isAntiAlias = antiAlias - } - - fun isEnabled(currentWatchMode: WatchMode): Boolean { - val simplify = sp.getString(R.string.key_simplify_ui, "off") - return if (simplify == "off") false - else if ((simplify == "ambient" || simplify == "ambient_charging") && currentWatchMode == WatchMode.AMBIENT) true - else (simplify == "charging" || simplify == "ambient_charging") && isCharging - } - - fun onDraw(canvas: Canvas, singleBg: EventData.SingleBg) { - canvas.drawRect(0f, 0f, displaySize.x.toFloat(), displaySize.y.toFloat(), mBackgroundPaint) - val xHalf = displaySize.x / 2f - val yThird = displaySize.y / 3f - - mSvgPaint.isStrikeThruText = isOutdated(singleBg) - mSvgPaint.color = getBgColour(singleBg.sgvLevel) - mDirectionPaint.color = getBgColour(singleBg.sgvLevel) - val sSvg = singleBg.sgvString - val svgWidth = mSvgPaint.measureText(sSvg) - val sDirection = " " + singleBg.slopeArrow + "\uFE0E" - val directionWidth = mDirectionPaint.measureText(sDirection) - val xSvg = xHalf - (svgWidth + directionWidth) / 2 - canvas.drawText(sSvg, xSvg, yThird + mYOffset, mSvgPaint) - val xDirection = xSvg + svgWidth - canvas.drawText(sDirection, xDirection, yThird + mYOffset, mDirectionPaint) - val sTime = dateUtil.timeString() - val xTime = xHalf - mTimePaint.measureText(sTime) / 2f - canvas.drawText(sTime, xTime, yThird * 2f + mYOffset, mTimePaint) - } - - fun onDestroy() { - if (batteryReceiver != null) { - context.unregisterReceiver(batteryReceiver) - } - } - - private fun isOutdated(singleBg: EventData.SingleBg): Boolean = - singleBg.timeStamp > 0 && (System.currentTimeMillis() - singleBg.timeStamp) > 1000 * 60 * 12 - - private fun getBgColour(level: Long): Int = - when (level) { - 1L -> colorDarkHigh - 0L -> colorDarkMid - else -> colorDarkLow - } - - private val isCharging: Boolean - get() { - val mBatteryStatus = context.registerReceiver(null, iFilter) - val status = mBatteryStatus?.getIntExtra(BatteryManager.EXTRA_STATUS, -1) - return status == BatteryManager.BATTERY_STATUS_CHARGING || status == BatteryManager.BATTERY_STATUS_FULL - } - - private fun setupUi() { - val black = ContextCompat.getColor(context, R.color.black) - mBackgroundPaint.color = black - val white = ContextCompat.getColor(context, R.color.white) - val resources = context.resources - val textSizeSvg = resources.getDimension(R.dimen.simple_ui_svg_text_size) - val textSizeDirection = resources.getDimension(R.dimen.simple_ui_direction_text_size) - val textSizeTime = resources.getDimension(R.dimen.simple_ui_time_text_size) - mYOffset = resources.getDimension(R.dimen.simple_ui_y_offset) - mSvgPaint = createTextPaint(NORMAL_TYPEFACE, white, textSizeSvg) - mDirectionPaint = createTextPaint(BOLD_TYPEFACE, white, textSizeDirection) - mTimePaint = createTextPaint(NORMAL_TYPEFACE, white, textSizeTime) - } - - private fun setupBatteryReceiver() { - val setting = sp.getString(R.string.key_simplify_ui, "off") - if ((setting == "charging" || setting == "ambient_charging") && batteryReceiver == null) { - val intentBatteryFilter = IntentFilter() - intentBatteryFilter.addAction(BatteryManager.ACTION_CHARGING) - intentBatteryFilter.addAction(BatteryManager.ACTION_DISCHARGING) - batteryReceiver = object : BroadcastReceiver() { - override fun onReceive(context: Context, intent: Intent) { - callback() - } - } - context.registerReceiver(batteryReceiver, intentBatteryFilter) - } - } - - private fun createTextPaint(typeface: Typeface, colour: Int, textSize: Float): Paint { - val paint = Paint() - paint.color = colour - paint.typeface = typeface - paint.isAntiAlias = true - paint.textSize = textSize - return paint - } - - companion object { - - var iFilter = IntentFilter(Intent.ACTION_BATTERY_CHANGED) - val NORMAL_TYPEFACE: Typeface = Typeface.create(Typeface.SANS_SERIF, Typeface.NORMAL) - val BOLD_TYPEFACE: Typeface = Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD) - } -} +package app.aaps.wear.watchfaces.utils + +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent +import android.content.IntentFilter +import android.graphics.Canvas +import android.graphics.Paint +import android.graphics.Point +import android.graphics.Typeface +import android.os.BatteryManager +import android.view.WindowManager +import androidx.core.content.ContextCompat +import app.aaps.core.interfaces.rx.weardata.EventData +import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.core.interfaces.utils.DateUtil +import app.aaps.wear.R +import com.ustwo.clockwise.common.WatchMode +import com.ustwo.clockwise.wearable.WatchFace +import javax.inject.Inject + +class SimpleUi @Inject constructor( + private val context: Context, + private val sp: SP, + private val dateUtil: DateUtil +) { + + private var batteryReceiver: BroadcastReceiver? = null + private var mBackgroundPaint = Paint() + private lateinit var mTimePaint: Paint + private lateinit var mSvgPaint: Paint + private lateinit var mDirectionPaint: Paint + private var mYOffset = 0f + private val colorDarkHigh = ContextCompat.getColor(context, R.color.dark_highColor) + private var colorDarkMid = ContextCompat.getColor(context, R.color.dark_midColor) + private var colorDarkLow = ContextCompat.getColor(context, R.color.dark_lowColor) + private val displaySize = Point() + private lateinit var callback: () -> Unit + + fun onCreate(callback: () -> Unit) { + this.callback = callback + @Suppress("DEPRECATION") + (context.getSystemService(WatchFace.WINDOW_SERVICE) as WindowManager).defaultDisplay.getSize(displaySize) + setupBatteryReceiver() + setupUi() + } + + fun updatePreferences() { + setupBatteryReceiver() + } + + fun setAntiAlias(currentWatchMode: WatchMode) { + val antiAlias = currentWatchMode == WatchMode.AMBIENT + mSvgPaint.isAntiAlias = antiAlias + mDirectionPaint.isAntiAlias = antiAlias + mTimePaint.isAntiAlias = antiAlias + } + + fun isEnabled(currentWatchMode: WatchMode): Boolean { + val simplify = sp.getString(R.string.key_simplify_ui, "off") + return if (simplify == "off") false + else if ((simplify == "ambient" || simplify == "ambient_charging") && currentWatchMode == WatchMode.AMBIENT) true + else (simplify == "charging" || simplify == "ambient_charging") && isCharging + } + + fun onDraw(canvas: Canvas, singleBg: EventData.SingleBg) { + canvas.drawRect(0f, 0f, displaySize.x.toFloat(), displaySize.y.toFloat(), mBackgroundPaint) + val xHalf = displaySize.x / 2f + val yThird = displaySize.y / 3f + + mSvgPaint.isStrikeThruText = isOutdated(singleBg) + mSvgPaint.color = getBgColour(singleBg.sgvLevel) + mDirectionPaint.color = getBgColour(singleBg.sgvLevel) + val sSvg = singleBg.sgvString + val svgWidth = mSvgPaint.measureText(sSvg) + val sDirection = " " + singleBg.slopeArrow + "\uFE0E" + val directionWidth = mDirectionPaint.measureText(sDirection) + val xSvg = xHalf - (svgWidth + directionWidth) / 2 + canvas.drawText(sSvg, xSvg, yThird + mYOffset, mSvgPaint) + val xDirection = xSvg + svgWidth + canvas.drawText(sDirection, xDirection, yThird + mYOffset, mDirectionPaint) + val sTime = dateUtil.timeString() + val xTime = xHalf - mTimePaint.measureText(sTime) / 2f + canvas.drawText(sTime, xTime, yThird * 2f + mYOffset, mTimePaint) + } + + fun onDestroy() { + if (batteryReceiver != null) { + context.unregisterReceiver(batteryReceiver) + } + } + + private fun isOutdated(singleBg: EventData.SingleBg): Boolean = + singleBg.timeStamp > 0 && (System.currentTimeMillis() - singleBg.timeStamp) > 1000 * 60 * 12 + + private fun getBgColour(level: Long): Int = + when (level) { + 1L -> colorDarkHigh + 0L -> colorDarkMid + else -> colorDarkLow + } + + private val isCharging: Boolean + get() { + val mBatteryStatus = context.registerReceiver(null, iFilter) + val status = mBatteryStatus?.getIntExtra(BatteryManager.EXTRA_STATUS, -1) + return status == BatteryManager.BATTERY_STATUS_CHARGING || status == BatteryManager.BATTERY_STATUS_FULL + } + + private fun setupUi() { + val black = ContextCompat.getColor(context, R.color.black) + mBackgroundPaint.color = black + val white = ContextCompat.getColor(context, R.color.white) + val resources = context.resources + val textSizeSvg = resources.getDimension(R.dimen.simple_ui_svg_text_size) + val textSizeDirection = resources.getDimension(R.dimen.simple_ui_direction_text_size) + val textSizeTime = resources.getDimension(R.dimen.simple_ui_time_text_size) + mYOffset = resources.getDimension(R.dimen.simple_ui_y_offset) + mSvgPaint = createTextPaint(NORMAL_TYPEFACE, white, textSizeSvg) + mDirectionPaint = createTextPaint(BOLD_TYPEFACE, white, textSizeDirection) + mTimePaint = createTextPaint(NORMAL_TYPEFACE, white, textSizeTime) + } + + private fun setupBatteryReceiver() { + val setting = sp.getString(R.string.key_simplify_ui, "off") + if ((setting == "charging" || setting == "ambient_charging") && batteryReceiver == null) { + val intentBatteryFilter = IntentFilter() + intentBatteryFilter.addAction(BatteryManager.ACTION_CHARGING) + intentBatteryFilter.addAction(BatteryManager.ACTION_DISCHARGING) + batteryReceiver = object : BroadcastReceiver() { + override fun onReceive(context: Context, intent: Intent) { + callback() + } + } + context.registerReceiver(batteryReceiver, intentBatteryFilter) + } + } + + private fun createTextPaint(typeface: Typeface, colour: Int, textSize: Float): Paint { + val paint = Paint() + paint.color = colour + paint.typeface = typeface + paint.isAntiAlias = true + paint.textSize = textSize + return paint + } + + companion object { + + var iFilter = IntentFilter(Intent.ACTION_BATTERY_CHANGED) + val NORMAL_TYPEFACE: Typeface = Typeface.create(Typeface.SANS_SERIF, Typeface.NORMAL) + val BOLD_TYPEFACE: Typeface = Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD) + } +} diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/WatchfaceViewAdapter.kt b/wear/src/main/kotlin/app/aaps/wear/watchfaces/utils/WatchfaceViewAdapter.kt similarity index 70% rename from wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/WatchfaceViewAdapter.kt rename to wear/src/main/kotlin/app/aaps/wear/watchfaces/utils/WatchfaceViewAdapter.kt index 9ccd931586..88e365096b 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/WatchfaceViewAdapter.kt +++ b/wear/src/main/kotlin/app/aaps/wear/watchfaces/utils/WatchfaceViewAdapter.kt @@ -1,104 +1,105 @@ -package info.nightscout.androidaps.watchfaces.utils - -import androidx.viewbinding.ViewBinding -import info.nightscout.androidaps.databinding.ActivityHomeLargeBinding -import info.nightscout.androidaps.databinding.ActivityHome2Binding -import info.nightscout.androidaps.databinding.ActivityHomeBinding -import info.nightscout.androidaps.databinding.ActivityBigchartBinding -import info.nightscout.androidaps.databinding.ActivityCockpitBinding -import info.nightscout.androidaps.databinding.ActivityCustomBinding -import info.nightscout.androidaps.databinding.ActivityDigitalstyleBinding -import info.nightscout.androidaps.databinding.ActivityNochartBinding -import info.nightscout.androidaps.databinding.ActivitySteampunkBinding - -/** - * WatchfaceViewAdapter binds all WatchFace variants shared attributes to one common view adapter. - * Requires at least one of the ViewBinding as a parameter. Recommended to use the factory object to create the binding. - */ -class WatchfaceViewAdapter( - aL: ActivityHomeLargeBinding? = null, - a2: ActivityHome2Binding? = null, - aa: ActivityHomeBinding? = null, - bC: ActivityBigchartBinding? = null, - cp: ActivityCockpitBinding? = null, - ds: ActivityDigitalstyleBinding? = null, - nC: ActivityNochartBinding? = null, - sP: ActivitySteampunkBinding? = null, - cU: ActivityCustomBinding? = null -) { - - init { - if (aL == null && a2 == null && aa == null && bC == null && cp == null && ds == null && nC == null && sP == null && cU == null) { - throw IllegalArgumentException("Require at least on Binding parameter") - } - } - - private val errorMessage = "Missing require View Binding parameter" - // Required attributes - val mainLayout = - aL?.mainLayout ?: a2?.mainLayout ?: aa?.mainLayout ?: bC?.mainLayout ?: bC?.mainLayout ?: cp?.mainLayout ?: ds?.mainLayout ?: nC?.mainLayout ?: sP?.mainLayout ?: cU?.mainLayout - ?: throw IllegalArgumentException(errorMessage) - val timestamp = - aL?.timestamp ?: a2?.timestamp ?: aa?.timestamp ?: bC?.timestamp ?: bC?.timestamp ?: cp?.timestamp ?: ds?.timestamp ?: nC?.timestamp ?: sP?.timestamp ?: cU?.timestamp - ?: throw IllegalArgumentException(errorMessage) - val root = - aL?.root ?: a2?.root ?: aa?.root ?: bC?.root ?: bC?.root ?: cp?.root ?: ds?.root ?: nC?.root ?: sP?.root ?: cU?.root - ?: throw IllegalArgumentException(errorMessage) - - // Optional attributes - val sgv = aL?.sgv ?: a2?.sgv ?: aa?.sgv ?: bC?.sgv ?: bC?.sgv ?: cp?.sgv ?: ds?.sgv ?: nC?.sgv ?: cU?.sgv - val direction = aL?.direction ?: a2?.direction ?: aa?.direction ?: cp?.direction ?: ds?.direction - val loop = a2?.loop ?: cp?.loop ?: sP?.loop ?: cU?.loop - val delta = aL?.delta ?: a2?.delta ?: aa?.delta ?: bC?.delta ?: bC?.delta ?: cp?.delta ?: ds?.delta ?: nC?.delta ?: cU?.delta - val avgDelta = a2?.avgDelta ?: bC?.avgDelta ?: bC?.avgDelta ?: cp?.avgDelta ?: ds?.avgDelta ?: nC?.avgDelta ?: cU?.avgDelta - val uploaderBattery = aL?.uploaderBattery ?: a2?.uploaderBattery ?: aa?.uploaderBattery ?: cp?.uploaderBattery ?: ds?.uploaderBattery ?: sP?.uploaderBattery ?: cU?.uploaderBattery - val rigBattery = a2?.rigBattery ?: cp?.rigBattery ?: ds?.rigBattery ?: sP?.rigBattery ?: cU?.rigBattery - val basalRate = a2?.basalRate ?: cp?.basalRate ?: ds?.basalRate ?: sP?.basalRate ?: cU?.basalRate - val bgi = a2?.bgi ?: ds?.bgi ?: cU?.bgi - val AAPSv2 = a2?.AAPSv2 ?: cp?.AAPSv2 ?: ds?.AAPSv2 ?: sP?.AAPSv2 ?: cU?.AAPSv2 - val cob1 = a2?.cob1 ?: ds?.cob1 ?: cU?.cob1 - val cob2 = a2?.cob2 ?: cp?.cob2 ?: ds?.cob2 ?: sP?.cob2 ?: cU?.cob2 - val time = aL?.time ?: a2?.time ?: aa?.time ?: bC?.time ?: bC?.time ?: cp?.time ?: nC?.time ?: cU?.time - val second = cU?.second - val minute = ds?.minute ?: cU?.minute - val hour = ds?.hour ?: cU?.hour - val day = a2?.day ?: ds?.day ?: cU?.day - val month = a2?.month ?: ds?.month ?: cU?.month - val iob1 = a2?.iob1 ?: ds?.iob1 ?: cU?.iob1 - val iob2 = a2?.iob2 ?: cp?.iob2 ?: ds?.iob2 ?: sP?.iob2 ?: cU?.iob2 - val chart = a2?.chart ?: aa?.chart ?: bC?.chart ?: bC?.chart ?: ds?.chart ?: sP?.chart ?: cU?.chart - val status = aL?.status ?: aa?.status ?: bC?.status ?: bC?.status ?: nC?.status - val timePeriod = ds?.timePeriod ?: aL?.timePeriod ?: nC?.timePeriod ?: bC?.timePeriod ?: cU?.timePeriod - val dayName = ds?.dayName ?: cU?.dayName - val mainMenuTap = ds?.mainMenuTap ?: sP?.mainMenuTap - val chartZoomTap = ds?.chartZoomTap ?: sP?.chartZoomTap - val dateTime = ds?.dateTime ?: a2?.dateTime - val weekNumber = ds?.weekNumber ?: cU?.weekNumber - // val minuteHand = sP?.minuteHand - // val secondaryLayout = aL?.secondaryLayout ?: a2?.secondaryLayout ?: aa?.secondaryLayout ?: ds?.secondaryLayout ?: sP?.secondaryLayout - // val tertiaryLayout = a2?.tertiaryLayout ?: sP?.tertiaryLayout - // val highLight = cp?.highLight - // val lowLight = cp?.lowLight - // val deltaGauge = sP?.deltaPointer - // val hourHand = sP?.hourHand - // val glucoseDial = sP?.glucoseDial - - companion object { - - fun getBinding(bindLayout: ViewBinding): WatchfaceViewAdapter { - return when (bindLayout) { - is ActivityHomeLargeBinding -> WatchfaceViewAdapter(bindLayout) - is ActivityHome2Binding -> WatchfaceViewAdapter(null, bindLayout) - is ActivityHomeBinding -> WatchfaceViewAdapter(null, null, bindLayout) - is ActivityBigchartBinding -> WatchfaceViewAdapter(null, null, null, bindLayout) - is ActivityCockpitBinding -> WatchfaceViewAdapter(null, null, null, null, bindLayout) - is ActivityDigitalstyleBinding -> WatchfaceViewAdapter(null, null, null, null, null, bindLayout) - is ActivityNochartBinding -> WatchfaceViewAdapter(null, null, null, null, null, null, bindLayout) - is ActivitySteampunkBinding -> WatchfaceViewAdapter(null, null, null, null, null, null, null, bindLayout) - is ActivityCustomBinding -> WatchfaceViewAdapter(null, null, null, null, null, null, null, null, bindLayout) - else -> throw IllegalArgumentException("ViewBinding is not implement in WatchfaceViewAdapter") - } - } - } - -} +package app.aaps.wear.watchfaces.utils + +import androidx.viewbinding.ViewBinding +import app.aaps.wear.databinding.ActivityBigchartBinding +import app.aaps.wear.databinding.ActivityCockpitBinding +import app.aaps.wear.databinding.ActivityCustomBinding +import app.aaps.wear.databinding.ActivityDigitalstyleBinding +import app.aaps.wear.databinding.ActivityHome2Binding +import app.aaps.wear.databinding.ActivityHomeBinding +import app.aaps.wear.databinding.ActivityHomeLargeBinding +import app.aaps.wear.databinding.ActivityNochartBinding +import app.aaps.wear.databinding.ActivitySteampunkBinding + +/** + * WatchfaceViewAdapter binds all WatchFace variants shared attributes to one common view adapter. + * Requires at least one of the ViewBinding as a parameter. Recommended to use the factory object to create the binding. + */ +class WatchfaceViewAdapter( + aL: ActivityHomeLargeBinding? = null, + a2: ActivityHome2Binding? = null, + aa: ActivityHomeBinding? = null, + bC: ActivityBigchartBinding? = null, + cp: ActivityCockpitBinding? = null, + ds: ActivityDigitalstyleBinding? = null, + nC: ActivityNochartBinding? = null, + sP: ActivitySteampunkBinding? = null, + cU: ActivityCustomBinding? = null +) { + + init { + if (aL == null && a2 == null && aa == null && bC == null && cp == null && ds == null && nC == null && sP == null && cU == null) { + throw IllegalArgumentException("Require at least on Binding parameter") + } + } + + private val errorMessage = "Missing require View Binding parameter" + + // Required attributes + val mainLayout = + aL?.mainLayout ?: a2?.mainLayout ?: aa?.mainLayout ?: bC?.mainLayout ?: bC?.mainLayout ?: cp?.mainLayout ?: ds?.mainLayout ?: nC?.mainLayout ?: sP?.mainLayout ?: cU?.mainLayout + ?: throw IllegalArgumentException(errorMessage) + val timestamp = + aL?.timestamp ?: a2?.timestamp ?: aa?.timestamp ?: bC?.timestamp ?: bC?.timestamp ?: cp?.timestamp ?: ds?.timestamp ?: nC?.timestamp ?: sP?.timestamp ?: cU?.timestamp + ?: throw IllegalArgumentException(errorMessage) + val root = + aL?.root ?: a2?.root ?: aa?.root ?: bC?.root ?: bC?.root ?: cp?.root ?: ds?.root ?: nC?.root ?: sP?.root ?: cU?.root + ?: throw IllegalArgumentException(errorMessage) + + // Optional attributes + val sgv = aL?.sgv ?: a2?.sgv ?: aa?.sgv ?: bC?.sgv ?: bC?.sgv ?: cp?.sgv ?: ds?.sgv ?: nC?.sgv ?: cU?.sgv + val direction = aL?.direction ?: a2?.direction ?: aa?.direction ?: cp?.direction ?: ds?.direction + val loop = a2?.loop ?: cp?.loop ?: sP?.loop ?: cU?.loop + val delta = aL?.delta ?: a2?.delta ?: aa?.delta ?: bC?.delta ?: bC?.delta ?: cp?.delta ?: ds?.delta ?: nC?.delta ?: cU?.delta + val avgDelta = a2?.avgDelta ?: bC?.avgDelta ?: bC?.avgDelta ?: cp?.avgDelta ?: ds?.avgDelta ?: nC?.avgDelta ?: cU?.avgDelta + val uploaderBattery = aL?.uploaderBattery ?: a2?.uploaderBattery ?: aa?.uploaderBattery ?: cp?.uploaderBattery ?: ds?.uploaderBattery ?: sP?.uploaderBattery ?: cU?.uploaderBattery + val rigBattery = a2?.rigBattery ?: cp?.rigBattery ?: ds?.rigBattery ?: sP?.rigBattery ?: cU?.rigBattery + val basalRate = a2?.basalRate ?: cp?.basalRate ?: ds?.basalRate ?: sP?.basalRate ?: cU?.basalRate + val bgi = a2?.bgi ?: ds?.bgi ?: cU?.bgi + val AAPSv2 = a2?.AAPSv2 ?: cp?.AAPSv2 ?: ds?.AAPSv2 ?: sP?.AAPSv2 ?: cU?.AAPSv2 + val cob1 = a2?.cob1 ?: ds?.cob1 ?: cU?.cob1 + val cob2 = a2?.cob2 ?: cp?.cob2 ?: ds?.cob2 ?: sP?.cob2 ?: cU?.cob2 + val time = aL?.time ?: a2?.time ?: aa?.time ?: bC?.time ?: bC?.time ?: cp?.time ?: nC?.time ?: cU?.time + val second = cU?.second + val minute = ds?.minute ?: cU?.minute + val hour = ds?.hour ?: cU?.hour + val day = a2?.day ?: ds?.day ?: cU?.day + val month = a2?.month ?: ds?.month ?: cU?.month + val iob1 = a2?.iob1 ?: ds?.iob1 ?: cU?.iob1 + val iob2 = a2?.iob2 ?: cp?.iob2 ?: ds?.iob2 ?: sP?.iob2 ?: cU?.iob2 + val chart = a2?.chart ?: aa?.chart ?: bC?.chart ?: bC?.chart ?: ds?.chart ?: sP?.chart ?: cU?.chart + val status = aL?.status ?: aa?.status ?: bC?.status ?: bC?.status ?: nC?.status + val timePeriod = ds?.timePeriod ?: aL?.timePeriod ?: nC?.timePeriod ?: bC?.timePeriod ?: cU?.timePeriod + val dayName = ds?.dayName ?: cU?.dayName + val mainMenuTap = ds?.mainMenuTap ?: sP?.mainMenuTap + val chartZoomTap = ds?.chartZoomTap ?: sP?.chartZoomTap + val dateTime = ds?.dateTime ?: a2?.dateTime + val weekNumber = ds?.weekNumber ?: cU?.weekNumber + // val minuteHand = sP?.minuteHand + // val secondaryLayout = aL?.secondaryLayout ?: a2?.secondaryLayout ?: aa?.secondaryLayout ?: ds?.secondaryLayout ?: sP?.secondaryLayout + // val tertiaryLayout = a2?.tertiaryLayout ?: sP?.tertiaryLayout + // val highLight = cp?.highLight + // val lowLight = cp?.lowLight + // val deltaGauge = sP?.deltaPointer + // val hourHand = sP?.hourHand + // val glucoseDial = sP?.glucoseDial + + companion object { + + fun getBinding(bindLayout: ViewBinding): WatchfaceViewAdapter { + return when (bindLayout) { + is ActivityHomeLargeBinding -> WatchfaceViewAdapter(bindLayout) + is ActivityHome2Binding -> WatchfaceViewAdapter(null, bindLayout) + is ActivityHomeBinding -> WatchfaceViewAdapter(null, null, bindLayout) + is ActivityBigchartBinding -> WatchfaceViewAdapter(null, null, null, bindLayout) + is ActivityCockpitBinding -> WatchfaceViewAdapter(null, null, null, null, bindLayout) + is ActivityDigitalstyleBinding -> WatchfaceViewAdapter(null, null, null, null, null, bindLayout) + is ActivityNochartBinding -> WatchfaceViewAdapter(null, null, null, null, null, null, bindLayout) + is ActivitySteampunkBinding -> WatchfaceViewAdapter(null, null, null, null, null, null, null, bindLayout) + is ActivityCustomBinding -> WatchfaceViewAdapter(null, null, null, null, null, null, null, null, bindLayout) + else -> throw IllegalArgumentException("ViewBinding is not implement in WatchfaceViewAdapter") + } + } + } + +} diff --git a/wear/src/main/res/layout/activity_custom.xml b/wear/src/main/res/layout/activity_custom.xml index 95c231dbcb..edc2efd1d0 100644 --- a/wear/src/main/res/layout/activity_custom.xml +++ b/wear/src/main/res/layout/activity_custom.xml @@ -1,6 +1,5 @@ + android:visibility="visible" /> + android:layout_marginTop="0px" + android:orientation="vertical" + android:visibility="gone" /> + android:textColor="@color/light_grey" + android:textSize="21px" + android:visibility="gone" /> + android:textColor="@color/light_grey" + android:textSize="21px" + android:visibility="gone" /> + android:textColor="@color/light_grey" + android:textSize="21px" + android:visibility="gone" /> + android:textColor="@color/light_grey" + android:textSize="21px" + android:visibility="gone" /> @@ -153,26 +152,26 @@ android:id="@+id/uploader_battery" android:layout_width="60px" android:layout_height="32px" - android:gravity="center" - android:layout_marginTop="133px" android:layout_marginLeft="129px" - android:textSize="23px" + android:layout_marginTop="133px" android:fontFamily="@font/roboto_condensed_bold" - android:textStyle="bold" + android:gravity="center" android:textColor="@color/light_grey" + android:textSize="23px" + android:textStyle="bold" tools:text="100%" /> @@ -180,25 +179,25 @@ android:id="@+id/basalRate" android:layout_width="91px" android:layout_height="32px" - android:layout_marginTop="133px" android:layout_marginLeft="249px" - android:gravity="center" + android:layout_marginTop="133px" android:fontFamily="@font/roboto_condensed_bold" + android:gravity="center" + android:textColor="@color/light_grey" android:textSize="23px" android:textStyle="bold" - android:textColor="@color/light_grey" tools:text="@string/no_tmp_basal_u_h" /> @@ -208,11 +207,11 @@ android:layout_width="0px" android:layout_height="0px" android:layout_marginTop="151px" - android:gravity="center" android:fontFamily="@font/roboto_condensed_bold" + android:gravity="center" + android:textColor="@color/light_grey" android:textSize="70px" android:textStyle="bold" - android:textColor="@color/light_grey" android:visibility="gone" tools:text="22:00" /> @@ -221,13 +220,13 @@ android:id="@+id/hour" android:layout_width="0px" android:layout_height="0px" - android:layout_marginTop="151px" android:layout_marginLeft="119px" + android:layout_marginTop="151px" android:fontFamily="@font/roboto_condensed_bold" android:textAllCaps="true" + android:textColor="@color/light_grey" android:textSize="70px" android:textStyle="bold" - android:textColor="@color/light_grey" android:visibility="gone" tools:text="20" /> @@ -235,8 +234,8 @@ android:id="@+id/minute" android:layout_width="0px" android:layout_height="0px" - android:layout_marginTop="158px" android:layout_marginLeft="210px" + android:layout_marginTop="158px" android:fontFamily="@font/roboto_condensed_bold" android:textColor="@color/light_grey" android:textSize="46px" @@ -247,8 +246,8 @@ android:id="@+id/second" android:layout_width="0px" android:layout_height="0px" - android:layout_marginTop="158px" android:layout_marginLeft="210px" + android:layout_marginTop="158px" android:fontFamily="@font/roboto_condensed_bold" android:textColor="@color/light_grey" android:textSize="46px" @@ -265,9 +264,9 @@ android:layout_marginLeft="210px" android:layout_marginTop="205px" android:fontFamily="@font/roboto_condensed_bold" + android:textColor="@color/light_grey" android:textSize="17px" android:textStyle="bold" - android:textColor="@color/light_grey" android:visibility="gone" tools:text="AM" /> @@ -275,12 +274,12 @@ android:id="@+id/day_name" android:layout_width="56px" android:layout_height="36px" - android:layout_marginTop="172px" android:layout_marginLeft="120px" + android:layout_marginTop="172px" android:gravity="center" + android:textColor="@color/white" android:textSize="24px" android:textStyle="bold" - android:textColor="@color/white" android:visibility="visible" tools:text="day" /> @@ -288,24 +287,24 @@ android:id="@+id/day" android:layout_width="56px" android:layout_height="36px" - android:layout_marginTop="198px" android:layout_marginLeft="120px" + android:layout_marginTop="198px" android:gravity="center" - android:textStyle="bold" - android:textSize="24px" android:textColor="@color/white" + android:textSize="24px" + android:textStyle="bold" tools:text="01" /> @@ -313,60 +312,60 @@ android:id="@+id/month" android:layout_width="50px" android:layout_height="36px" - android:layout_marginTop="180px" android:layout_marginLeft="220px" + android:layout_marginTop="180px" android:gravity="center" - android:textStyle="bold" - android:textSize="24px" android:textColor="@color/white" + android:textSize="24px" + android:textStyle="bold" tools:text="févr." /> + android:visibility="visible" /> + android:src="@drawable/simplified_dial" + android:visibility="visible" /> - -