From 2f85abbc8400c15816301e316cac48223425232c Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 2 Nov 2022 14:05:50 +0100 Subject: [PATCH] Insulin -> plugins module --- .../activities/MyPreferenceFragment.kt | 2 +- .../nightscout/androidaps/di/AppComponent.kt | 4 +++- .../androidaps/di/FragmentsModule.kt | 2 -- .../nightscout/androidaps/di/PluginsModule.kt | 8 +++---- .../main/res/layout/localprofile_fragment.xml | 2 +- .../res/layout/smscommunicator_fragment.xml | 13 ++++++++++++ app/src/main/res/values/strings.xml | 18 ---------------- .../nightscout/plugins/di/InsulinModule.kt | 12 +++++++++++ .../activities/SmsCommunicatorOtpActivity.kt | 6 +++--- .../plugins/insulin/ActivityGraph.kt | 2 +- .../plugins/insulin/InsulinFragment.kt | 6 +++--- .../plugins/insulin/InsulinLyumjevPlugin.kt | 4 ++-- .../plugins/insulin/InsulinOrefBasePlugin.kt | 4 ++-- .../insulin/InsulinOrefFreePeakPlugin.kt | 4 ++-- .../insulin/InsulinOrefRapidActingPlugin.kt | 8 +++---- .../InsulinOrefUltraRapidActingPlugin.kt | 8 +++---- .../src/main/res/layout/insulin_fragment.xml | 4 ++-- ...p.xml => smscommunicator_activity_otp.xml} | 2 +- plugins/src/main/res/values/strings.xml | 21 +++++++++++++++++++ .../main/res/xml/pref_insulinoreffreepeak.xml | 0 .../insulin/InsulinLyumjevPluginTest.kt | 4 ++-- .../insulin/InsulinOrefBasePluginTest.kt | 5 +---- .../insulin/InsulinOrefFreePeakPluginTest.kt | 6 +++--- .../InsulinOrefRapidActingPluginTest.kt | 4 ++-- .../InsulinOrefUltraRapidActingPluginTest.kt | 4 ++-- 25 files changed, 89 insertions(+), 64 deletions(-) create mode 100644 app/src/main/res/layout/smscommunicator_fragment.xml create mode 100644 plugins/src/main/java/info/nightscout/plugins/di/InsulinModule.kt rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/insulin/ActivityGraph.kt (97%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/insulin/InsulinFragment.kt (89%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/insulin/InsulinLyumjevPlugin.kt (94%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/insulin/InsulinOrefBasePlugin.kt (97%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/insulin/InsulinOrefFreePeakPlugin.kt (95%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/insulin/InsulinOrefRapidActingPlugin.kt (94%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt (94%) rename {app => plugins}/src/main/res/layout/insulin_fragment.xml (90%) rename plugins/src/main/res/layout/{activity_smscommunicator_otp.xml => smscommunicator_activity_otp.xml} (97%) rename {app => plugins}/src/main/res/xml/pref_insulinoreffreepeak.xml (100%) rename {app/src/test/java/info/nightscout/androidaps => plugins/src/test/java/info/nightscout}/plugins/insulin/InsulinLyumjevPluginTest.kt (95%) rename {app/src/test/java/info/nightscout/androidaps => plugins/src/test/java/info/nightscout}/plugins/insulin/InsulinOrefBasePluginTest.kt (95%) rename {app/src/test/java/info/nightscout/androidaps => plugins/src/test/java/info/nightscout}/plugins/insulin/InsulinOrefFreePeakPluginTest.kt (93%) rename {app/src/test/java/info/nightscout/androidaps => plugins/src/test/java/info/nightscout}/plugins/insulin/InsulinOrefRapidActingPluginTest.kt (95%) rename {app/src/test/java/info/nightscout/androidaps => plugins/src/test/java/info/nightscout}/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt (95%) diff --git a/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt index bbfe01a0e6..ce1552c575 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt @@ -36,7 +36,7 @@ import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin import info.nightscout.androidaps.plugins.general.tidepool.TidepoolPlugin import info.nightscout.androidaps.plugins.general.wear.WearPlugin import info.nightscout.androidaps.plugins.general.xdripStatusline.StatusLinePlugin -import info.nightscout.androidaps.plugins.insulin.InsulinOrefFreePeakPlugin +import info.nightscout.plugins.insulin.InsulinOrefFreePeakPlugin import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin diff --git a/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt b/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt index 642088131c..e33bcec641 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt @@ -23,6 +23,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.implementation.di.CommandQueueModule +import info.nightscout.plugins.di.InsulinModule import info.nightscout.plugins.di.SMSCommunicatorModule import info.nightscout.shared.di.SharedModule import info.nightscout.ui.di.UiModule @@ -69,7 +70,8 @@ import javax.inject.Singleton DiaconnG8Module::class, OpenHumansModule::class, SharedModule::class, - UiModule::class + UiModule::class, + InsulinModule::class ] ) interface AppComponent : AndroidInjector { diff --git a/app/src/main/java/info/nightscout/androidaps/di/FragmentsModule.kt b/app/src/main/java/info/nightscout/androidaps/di/FragmentsModule.kt index 9b63bce462..e272765167 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/FragmentsModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/FragmentsModule.kt @@ -43,7 +43,6 @@ import info.nightscout.androidaps.plugins.general.overview.OverviewFragment import info.nightscout.androidaps.plugins.general.overview.dialogs.EditQuickWizardDialog import info.nightscout.androidaps.plugins.general.tidepool.TidepoolFragment import info.nightscout.androidaps.plugins.general.wear.WearFragment -import info.nightscout.androidaps.plugins.insulin.InsulinFragment import info.nightscout.androidaps.plugins.profile.local.LocalProfileFragment import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpFragment import info.nightscout.androidaps.plugins.source.BGSourceFragment @@ -63,7 +62,6 @@ abstract class FragmentsModule { @ContributesAndroidInjector abstract fun contributesConfigBuilderFragment(): ConfigBuilderFragment @ContributesAndroidInjector abstract fun contributesFoodFragment(): FoodFragment - @ContributesAndroidInjector abstract fun contributesInsulinFragment(): InsulinFragment @ContributesAndroidInjector abstract fun contributesLocalProfileFragment(): LocalProfileFragment @ContributesAndroidInjector abstract fun contributesObjectivesFragment(): ObjectivesFragment @ContributesAndroidInjector abstract fun contributesOpenAPSFragment(): OpenAPSFragment diff --git a/app/src/main/java/info/nightscout/androidaps/di/PluginsModule.kt b/app/src/main/java/info/nightscout/androidaps/di/PluginsModule.kt index 9e5077d1fb..cf02ad8bf9 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/PluginsModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/PluginsModule.kt @@ -37,10 +37,10 @@ import info.nightscout.androidaps.plugins.general.themes.ThemeSwitcherPlugin import info.nightscout.androidaps.plugins.general.tidepool.TidepoolPlugin import info.nightscout.androidaps.plugins.general.wear.WearPlugin import info.nightscout.androidaps.plugins.general.xdripStatusline.StatusLinePlugin -import info.nightscout.androidaps.plugins.insulin.InsulinLyumjevPlugin -import info.nightscout.androidaps.plugins.insulin.InsulinOrefFreePeakPlugin -import info.nightscout.androidaps.plugins.insulin.InsulinOrefRapidActingPlugin -import info.nightscout.androidaps.plugins.insulin.InsulinOrefUltraRapidActingPlugin +import info.nightscout.plugins.insulin.InsulinLyumjevPlugin +import info.nightscout.plugins.insulin.InsulinOrefFreePeakPlugin +import info.nightscout.plugins.insulin.InsulinOrefRapidActingPlugin +import info.nightscout.plugins.insulin.InsulinOrefUltraRapidActingPlugin import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin import info.nightscout.androidaps.plugins.profile.local.LocalProfilePlugin import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin diff --git a/app/src/main/res/layout/localprofile_fragment.xml b/app/src/main/res/layout/localprofile_fragment.xml index ff453c53e0..f07eaa4184 100644 --- a/app/src/main/res/layout/localprofile_fragment.xml +++ b/app/src/main/res/layout/localprofile_fragment.xml @@ -198,7 +198,7 @@ - + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1ee1afa804..9b42467f8d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -32,7 +32,6 @@ smscommunicator protection absorption_category_settings - insulin_oref_peak_settings ns_temporary_target_last_sync temporary_target_new_data_id ns_glucose_value_last_sync @@ -70,10 +69,6 @@ Used for configuring the active plugins Learning program Displays the food presets defined in Nightscout - Insulin preset for Humalog and NovoRapid / NovoLog - Insulin preset for Fiasp - Insulin preset for Lyumjev - Allows you to define the peak of the insulin activity and should only be used by advanced users Activate or deactivate the implementation triggering the loop. Synchronizes your data with Nightscout State of the algorithm in 2017 @@ -225,7 +220,6 @@ Button 3 Units: Units - DIA Range for Visualization High and low mark for the charts in Overview and Smartwatch LOW mark @@ -335,9 +329,6 @@ Log app start to NS Exiting application to apply settings. Which type of insulin are you using? - Novorapid, Novolog, Humalog - Fiasp - INS key_usersuperbolus Enable superbolus in wizard Enable superbolus functionality in wizard. Do not enable until you learn what it really does. IT MAY CAUSE INSULIN OVERDOSE IF USED BLINDLY! @@ -437,15 +428,6 @@ Enable SMB Use Super Micro Boluses instead of temp basal for faster action Detection of Unannounced meals - insulin_oref_peak - IOB Curve Peak Time - Peak Time [min] - Peak - Free-Peak Oref - Rapid-Acting Oref - Ultra-Rapid Oref - Lyumjev - DIA of %1$f too short - using %2$f instead! Activate profile INVALID wizard_include_cob diff --git a/plugins/src/main/java/info/nightscout/plugins/di/InsulinModule.kt b/plugins/src/main/java/info/nightscout/plugins/di/InsulinModule.kt new file mode 100644 index 0000000000..42cce3d1f1 --- /dev/null +++ b/plugins/src/main/java/info/nightscout/plugins/di/InsulinModule.kt @@ -0,0 +1,12 @@ +package info.nightscout.plugins.di + +import dagger.Module +import dagger.android.ContributesAndroidInjector +import info.nightscout.plugins.insulin.InsulinFragment + +@Module +@Suppress("unused") +abstract class InsulinModule { + + @ContributesAndroidInjector abstract fun contributesInsulinFragment(): InsulinFragment +} \ No newline at end of file diff --git a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt index 6236eabbf9..a1bea14b29 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt @@ -21,7 +21,7 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.plugins.R -import info.nightscout.plugins.databinding.ActivitySmscommunicatorOtpBinding +import info.nightscout.plugins.databinding.SmscommunicatorActivityOtpBinding import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePasswordValidationResult import net.glxn.qrgen.android.QRCode @@ -34,13 +34,13 @@ class SmsCommunicatorOtpActivity : NoSplashAppCompatActivity() { @Inject lateinit var otp: OneTimePassword @Inject lateinit var uel: UserEntryLogger - private lateinit var binding: ActivitySmscommunicatorOtpBinding + private lateinit var binding: SmscommunicatorActivityOtpBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) window.setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE) - binding = ActivitySmscommunicatorOtpBinding.inflate(layoutInflater) + binding = SmscommunicatorActivityOtpBinding.inflate(layoutInflater) setContentView(binding.root) binding.otpVerifyEdit.addTextChangedListener(object : TextWatcher { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/ActivityGraph.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/ActivityGraph.kt similarity index 97% rename from app/src/main/java/info/nightscout/androidaps/plugins/insulin/ActivityGraph.kt rename to plugins/src/main/java/info/nightscout/plugins/insulin/ActivityGraph.kt index 7662100e49..05cb3b1556 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/ActivityGraph.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/ActivityGraph.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.insulin +package info.nightscout.plugins.insulin import android.content.Context import android.graphics.Color diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinFragment.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinFragment.kt similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinFragment.kt rename to plugins/src/main/java/info/nightscout/plugins/insulin/InsulinFragment.kt index 3302f21a51..15bbe3320d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinFragment.kt @@ -1,14 +1,14 @@ -package info.nightscout.androidaps.plugins.insulin +package info.nightscout.plugins.insulin import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.R -import info.nightscout.androidaps.databinding.InsulinFragmentBinding import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.plugins.R +import info.nightscout.plugins.databinding.InsulinFragmentBinding import javax.inject.Inject class InsulinFragment : DaggerFragment() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinLyumjevPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinLyumjevPlugin.kt similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinLyumjevPlugin.kt rename to plugins/src/main/java/info/nightscout/plugins/insulin/InsulinLyumjevPlugin.kt index e13bb47b6f..c297f74233 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinLyumjevPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinLyumjevPlugin.kt @@ -1,7 +1,6 @@ -package info.nightscout.androidaps.plugins.insulin +package info.nightscout.plugins.insulin import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction @@ -9,6 +8,7 @@ import info.nightscout.shared.logging.AAPSLogger import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.plugins.R import org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefBasePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt similarity index 97% rename from app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefBasePlugin.kt rename to plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt index f84d23f531..e6756ca712 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefBasePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.plugins.insulin +package info.nightscout.plugins.insulin import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R +import info.nightscout.plugins.R import info.nightscout.androidaps.data.Iob import info.nightscout.androidaps.database.embedments.InsulinConfiguration import info.nightscout.androidaps.database.entities.Bolus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefFreePeakPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPlugin.kt similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefFreePeakPlugin.kt rename to plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPlugin.kt index 3b3150cca7..e14a2c8522 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefFreePeakPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPlugin.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.plugins.insulin +package info.nightscout.plugins.insulin import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R +import info.nightscout.plugins.R import info.nightscout.androidaps.extensions.putInt import info.nightscout.androidaps.extensions.storeInt import info.nightscout.androidaps.interfaces.Config diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefRapidActingPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPlugin.kt similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefRapidActingPlugin.kt rename to plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPlugin.kt index 76bceef9f2..999d52610d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefRapidActingPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPlugin.kt @@ -1,14 +1,14 @@ -package info.nightscout.androidaps.plugins.insulin +package info.nightscout.plugins.insulin import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.logging.AAPSLogger -import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.plugins.R +import info.nightscout.shared.logging.AAPSLogger import org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt rename to plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt index 631d495943..93ca0c175e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt @@ -1,14 +1,14 @@ -package info.nightscout.androidaps.plugins.insulin +package info.nightscout.plugins.insulin import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.logging.AAPSLogger -import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.plugins.R +import info.nightscout.shared.logging.AAPSLogger import org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/res/layout/insulin_fragment.xml b/plugins/src/main/res/layout/insulin_fragment.xml similarity index 90% rename from app/src/main/res/layout/insulin_fragment.xml rename to plugins/src/main/res/layout/insulin_fragment.xml index ef70d617c9..7733829b41 100644 --- a/app/src/main/res/layout/insulin_fragment.xml +++ b/plugins/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.androidaps.plugins.insulin.InsulinFragment"> + tools:context=".insulin.InsulinFragment"> - + tools:context=".general.smsCommunicator.activities.SmsCommunicatorOtpActivity"> TBR duration must be a multiple of %1$d minutes and greater than 0. QR Code for setup one time password + + insulin_oref_peak + insulin_oref_peak_settings + + DIA + Lyumjev + Insulin preset for Humalog and NovoRapid / NovoLog + Insulin preset for Fiasp + Insulin preset for Lyumjev + Allows you to define the peak of the insulin activity and should only be used by advanced users + INS + IOB Curve Peak Time + Peak Time [min] + Peak + Free-Peak Oref + Rapid-Acting Oref + Ultra-Rapid Oref + DIA of %1$f too short - using %2$f instead! + Novorapid, Novolog, Humalog + Fiasp + \ No newline at end of file diff --git a/app/src/main/res/xml/pref_insulinoreffreepeak.xml b/plugins/src/main/res/xml/pref_insulinoreffreepeak.xml similarity index 100% rename from app/src/main/res/xml/pref_insulinoreffreepeak.xml rename to plugins/src/main/res/xml/pref_insulinoreffreepeak.xml diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinLyumjevPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinLyumjevPluginTest.kt similarity index 95% rename from app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinLyumjevPluginTest.kt rename to plugins/src/test/java/info/nightscout/plugins/insulin/InsulinLyumjevPluginTest.kt index 27f3b16011..409ac5c3eb 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinLyumjevPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinLyumjevPluginTest.kt @@ -1,14 +1,14 @@ -package info.nightscout.androidaps.plugins.insulin +package info.nightscout.plugins.insulin import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.plugins.R import info.nightscout.shared.logging.AAPSLogger import org.junit.Assert.assertEquals import org.junit.Before diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefBasePluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt similarity index 95% rename from app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefBasePluginTest.kt rename to plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt index 254974283b..16801b1c5e 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefBasePluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt @@ -1,11 +1,9 @@ -package info.nightscout.androidaps.plugins.insulin +package info.nightscout.plugins.insulin import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.Constants -import info.nightscout.androidaps.data.Iob import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction @@ -65,7 +63,6 @@ class InsulinOrefBasePluginTest { @Mock lateinit var profileFunction: ProfileFunction @Mock lateinit var rxBus: RxBus @Mock lateinit var aapsLogger: AAPSLogger - @Mock lateinit var activePlugin: ActivePlugin @Mock lateinit var config: Config @Mock lateinit var hardLimits: HardLimits diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefFreePeakPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPluginTest.kt similarity index 93% rename from app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefFreePeakPluginTest.kt rename to plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPluginTest.kt index 75d996285d..d2877bc236 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefFreePeakPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPluginTest.kt @@ -1,8 +1,7 @@ -package info.nightscout.androidaps.plugins.insulin +package info.nightscout.plugins.insulin import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin @@ -10,6 +9,7 @@ import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.plugins.R import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert.assertEquals import org.junit.Before @@ -25,7 +25,7 @@ import org.mockito.Mockito.`when` class InsulinOrefFreePeakPluginTest : TestBase() { - lateinit var sut: InsulinOrefFreePeakPlugin + private lateinit var sut: InsulinOrefFreePeakPlugin @Mock lateinit var sp: SP @Mock lateinit var rh: ResourceHelper diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefRapidActingPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPluginTest.kt similarity index 95% rename from app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefRapidActingPluginTest.kt rename to plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPluginTest.kt index 317ccabf5f..ea33cc534e 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefRapidActingPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPluginTest.kt @@ -1,14 +1,14 @@ -package info.nightscout.androidaps.plugins.insulin +package info.nightscout.plugins.insulin import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.plugins.R import info.nightscout.shared.logging.AAPSLogger import org.junit.Assert.assertEquals import org.junit.Before diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt similarity index 95% rename from app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt rename to plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt index 1944d0a0f0..704254f041 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt @@ -1,14 +1,14 @@ -package info.nightscout.androidaps.plugins.insulin +package info.nightscout.plugins.insulin import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.plugins.R import info.nightscout.shared.logging.AAPSLogger import org.junit.Assert.assertEquals import org.junit.Before