Add @inject annotated constructors to Omnipod view model implementations

This commit is contained in:
Bart Sopers 2021-02-22 11:02:40 +01:00
parent b3cc8e86bf
commit 34891f3fda
8 changed files with 16 additions and 9 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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