From 34891f3fda6aabcdf9426ab3ce71ccbb0c6a52b4 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Mon, 22 Feb 2021 11:02:40 +0100 Subject: [PATCH] Add @inject annotated constructors to Omnipod view model implementations --- .../plugins/pump/omnipod/eros/dagger/OmnipodErosModule.kt | 5 +++-- ...sWizardModule.kt => OmnipodErosWizardViewModelsModule.kt} | 2 +- .../activation/viewmodel/info/ErosAttachPodViewModel.kt | 3 ++- .../activation/viewmodel/info/ErosPodActivatedViewModel.kt | 3 ++- .../viewmodel/info/ErosStartPodActivationViewModel.kt | 3 ++- .../viewmodel/info/ErosPodDeactivatedViewModel.kt | 3 ++- .../deactivation/viewmodel/info/ErosPodDiscardedViewModel.kt | 3 ++- .../viewmodel/info/ErosStartPodDeactivationViewModel.kt | 3 ++- 8 files changed, 16 insertions(+), 9 deletions(-) rename omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/{OmnipodErosWizardModule.kt => OmnipodErosWizardViewModelsModule.kt} (98%) diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodErosModule.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodErosModule.kt index b5ff81b446..336f123ce3 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodErosModule.kt +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodErosModule.kt @@ -4,6 +4,7 @@ import dagger.Module import dagger.Provides import dagger.android.ContributesAndroidInjector import info.nightscout.androidaps.plugins.pump.omnipod.common.dagger.ActivityScope +import info.nightscout.androidaps.plugins.pump.omnipod.common.dagger.OmnipodWizardModule import info.nightscout.androidaps.plugins.pump.omnipod.eros.data.RLHistoryItemOmnipod import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsErosPodStateManager @@ -19,11 +20,11 @@ abstract class OmnipodErosModule { // ACTIVITIES @ActivityScope - @ContributesAndroidInjector(modules = [OmnipodErosWizardModule::class]) + @ContributesAndroidInjector(modules = [OmnipodWizardModule::class, OmnipodErosWizardViewModelsModule::class]) abstract fun contributesActivationWizardActivity(): ErosPodActivationWizardActivity @ActivityScope - @ContributesAndroidInjector(modules = [OmnipodErosWizardModule::class]) + @ContributesAndroidInjector(modules = [OmnipodWizardModule::class, OmnipodErosWizardViewModelsModule::class]) abstract fun contributesDeactivationWizardActivity(): ErosPodDeactivationWizardActivity @ContributesAndroidInjector diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodErosWizardModule.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodErosWizardViewModelsModule.kt similarity index 98% rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodErosWizardModule.kt rename to omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodErosWizardViewModelsModule.kt index bad2588f96..8158c44887 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodErosWizardModule.kt +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/dagger/OmnipodErosWizardViewModelsModule.kt @@ -26,7 +26,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivati @Module @Suppress("unused") -abstract class OmnipodErosWizardModule { +abstract class OmnipodErosWizardViewModelsModule { // #### VIEW MODELS ############################################################################ // POD ACTIVATION diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/info/ErosAttachPodViewModel.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/info/ErosAttachPodViewModel.kt index c87d147bf1..25682be094 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/info/ErosAttachPodViewModel.kt +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/info/ErosAttachPodViewModel.kt @@ -3,8 +3,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activatio import androidx.annotation.StringRes import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.info.AttachPodViewModel import info.nightscout.androidaps.plugins.pump.omnipod.eros.R +import javax.inject.Inject -class ErosAttachPodViewModel : AttachPodViewModel() { +class ErosAttachPodViewModel @Inject constructor() : AttachPodViewModel() { @StringRes override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_attach_pod_title diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/info/ErosPodActivatedViewModel.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/info/ErosPodActivatedViewModel.kt index 32af064039..2aea673ea7 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/info/ErosPodActivatedViewModel.kt +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/info/ErosPodActivatedViewModel.kt @@ -3,8 +3,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activatio import androidx.annotation.StringRes import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.info.PodActivatedViewModel import info.nightscout.androidaps.plugins.pump.omnipod.eros.R +import javax.inject.Inject -class ErosPodActivatedViewModel : PodActivatedViewModel() { +class ErosPodActivatedViewModel @Inject constructor() : PodActivatedViewModel() { @StringRes override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_pod_activated_title diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/info/ErosStartPodActivationViewModel.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/info/ErosStartPodActivationViewModel.kt index 67561847b4..95d7cd2b08 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/info/ErosStartPodActivationViewModel.kt +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/info/ErosStartPodActivationViewModel.kt @@ -3,8 +3,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activatio import androidx.annotation.StringRes import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.info.StartPodActivationViewModel import info.nightscout.androidaps.plugins.pump.omnipod.eros.R +import javax.inject.Inject -class ErosStartPodActivationViewModel : StartPodActivationViewModel() { +class ErosStartPodActivationViewModel @Inject constructor() : StartPodActivationViewModel() { @StringRes override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_start_pod_activation_title diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/info/ErosPodDeactivatedViewModel.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/info/ErosPodDeactivatedViewModel.kt index f0ff370bc0..908d8c76e3 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/info/ErosPodDeactivatedViewModel.kt +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/info/ErosPodDeactivatedViewModel.kt @@ -3,8 +3,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivat import androidx.annotation.StringRes import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.info.PodDeactivatedViewModel import info.nightscout.androidaps.plugins.pump.omnipod.eros.R +import javax.inject.Inject -class ErosPodDeactivatedViewModel : PodDeactivatedViewModel() { +class ErosPodDeactivatedViewModel @Inject constructor() : PodDeactivatedViewModel() { @StringRes override fun getTitleId(): Int = R.string.omnipod_common_pod_deactivation_wizard_pod_deactivated_title diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/info/ErosPodDiscardedViewModel.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/info/ErosPodDiscardedViewModel.kt index bae50104b3..3c843bec57 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/info/ErosPodDiscardedViewModel.kt +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/info/ErosPodDiscardedViewModel.kt @@ -3,8 +3,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivat import androidx.annotation.StringRes import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.info.PodDiscardedViewModel import info.nightscout.androidaps.plugins.pump.omnipod.eros.R +import javax.inject.Inject -class ErosPodDiscardedViewModel : PodDiscardedViewModel() { +class ErosPodDiscardedViewModel @Inject constructor() : PodDiscardedViewModel() { @StringRes override fun getTitleId(): Int = R.string.omnipod_common_pod_deactivation_wizard_pod_discarded_title diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/info/ErosStartPodDeactivationViewModel.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/info/ErosStartPodDeactivationViewModel.kt index a4754103ef..8644c36fb0 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/info/ErosStartPodDeactivationViewModel.kt +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/info/ErosStartPodDeactivationViewModel.kt @@ -3,8 +3,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivat import androidx.annotation.StringRes import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.info.StartPodDeactivationViewModel import info.nightscout.androidaps.plugins.pump.omnipod.eros.R +import javax.inject.Inject -class ErosStartPodDeactivationViewModel : StartPodDeactivationViewModel() { +class ErosStartPodDeactivationViewModel @Inject constructor() : StartPodDeactivationViewModel() { @StringRes override fun getTitleId(): Int = R.string.omnipod_common_pod_deactivation_wizard_start_pod_deactivation_title