diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dagger/OmnipodWizardModule.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dagger/OmnipodWizardModule.kt index 4421900b15..338534da78 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dagger/OmnipodWizardModule.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dagger/OmnipodWizardModule.kt @@ -25,6 +25,7 @@ import javax.inject.Provider abstract class OmnipodWizardModule { companion object { + @Provides @OmnipodPluginQualifier fun providesViewModelFactory(@OmnipodPluginQualifier viewModels: MutableMap, @JvmSuppressWildcards Provider>): ViewModelProvider.Factory { diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/OmnipodManager.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/OmnipodManager.java index 963aaa1535..7158e9f98d 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/OmnipodManager.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/manager/OmnipodManager.java @@ -50,7 +50,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PodFault import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PodProgressStatusVerificationFailedException; import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PrecedingCommandFailedUncertainlyException; import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.manager.OmnipodRileyLinkCommunicationManager; -import info.nightscout.androidaps.utils.sharedPreferences.SP; import io.reactivex.Completable; import io.reactivex.Flowable; import io.reactivex.Single; @@ -62,17 +61,16 @@ public class OmnipodManager { private static final int ACTION_VERIFICATION_TRIES = 1; private final OmnipodRileyLinkCommunicationManager communicationService; - private PodStateManager podStateManager; + private final PodStateManager podStateManager; private ActiveBolusData activeBolusData; private SingleSubject bolusCommandExecutionSubject; private final Object bolusDataMutex = new Object(); - private AAPSLogger aapsLogger; + private final AAPSLogger aapsLogger; public OmnipodManager(AAPSLogger aapsLogger, - SP sp, OmnipodRileyLinkCommunicationManager communicationService, PodStateManager podStateManager) { if (communicationService == null) { diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java index efee56da0c..fec5c84cac 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/manager/AapsOmnipodManager.java @@ -143,7 +143,7 @@ public class AapsOmnipodManager { this.nsUpload = nsUpload; this.profileFunction = profileFunction; - delegate = new OmnipodManager(aapsLogger, sp, communicationService, podStateManager); + delegate = new OmnipodManager(aapsLogger, communicationService, podStateManager); reloadSettings(); } diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/PodActivationWizardActivity.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/PodActivationWizardActivity.kt index eccc00eb94..b5f4ee3114 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/PodActivationWizardActivity.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/PodActivationWizardActivity.kt @@ -10,6 +10,7 @@ import javax.inject.Inject class PodActivationWizardActivity : OmnipodWizardActivityBase() { companion object { + const val KEY_START_DESTINATION = "startDestination" } diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/AttachPodInfoFragment.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/AttachPodInfoFragment.kt index 2bad054984..8fc2d30b65 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/AttachPodInfoFragment.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/AttachPodInfoFragment.kt @@ -11,6 +11,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.fragment import kotlinx.android.synthetic.main.omnipod_wizard_nav_buttons.* class AttachPodInfoFragment : InfoFragmentBase() { + @StringRes override fun getTitleId(): Int = R.string.omnipod_pod_activation_wizard_attach_pod_title diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/FillPodInfoFragment.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/FillPodInfoFragment.kt index 425ff1e7ea..f7a1053785 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/FillPodInfoFragment.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/FillPodInfoFragment.kt @@ -6,6 +6,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.R import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.fragment.InfoFragmentBase class FillPodInfoFragment : InfoFragmentBase() { + @StringRes override fun getTitleId(): Int = R.string.omnipod_pod_activation_wizard_fill_pod_title diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/InitializePodActionFragment.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/InitializePodActionFragment.kt index bc10c3daf1..82af74414f 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/InitializePodActionFragment.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/InitializePodActionFragment.kt @@ -11,6 +11,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.activation.view import javax.inject.Inject class InitializePodActionFragment : PodActivationActionFragmentBase() { + @Inject @OmnipodPluginQualifier lateinit var viewModelFactory: ViewModelProvider.Factory diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/InsertCannulaActionFragment.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/InsertCannulaActionFragment.kt index 009318c60d..76a470ee3a 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/InsertCannulaActionFragment.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/InsertCannulaActionFragment.kt @@ -11,6 +11,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.activation.view import javax.inject.Inject class InsertCannulaActionFragment : PodActivationActionFragmentBase() { + @Inject @OmnipodPluginQualifier lateinit var viewModelFactory: ViewModelProvider.Factory diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/PodActivatedInfoFragment.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/PodActivatedInfoFragment.kt index 455a8063a3..d0c807a4e3 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/PodActivatedInfoFragment.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/PodActivatedInfoFragment.kt @@ -6,6 +6,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.R import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.fragment.InfoFragmentBase class PodActivatedInfoFragment : InfoFragmentBase() { + @StringRes override fun getTitleId(): Int = R.string.omnipod_pod_activation_wizard_pod_activated_title diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/PodActivationActionFragmentBase.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/PodActivationActionFragmentBase.kt index db2b828467..40c8e9fbc9 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/PodActivationActionFragmentBase.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/fragment/PodActivationActionFragmentBase.kt @@ -11,6 +11,7 @@ import kotlinx.android.synthetic.main.omnipod_wizard_action_page_fragment.* import javax.inject.Inject abstract class PodActivationActionFragmentBase : ActionFragmentBase() { + @Inject protected lateinit var podStateManager: PodStateManager diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/viewmodel/InitializePodActionViewModel.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/viewmodel/InitializePodActionViewModel.kt index 429b1170d2..674ca9f8a7 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/viewmodel/InitializePodActionViewModel.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/viewmodel/InitializePodActionViewModel.kt @@ -6,5 +6,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.viewmode import javax.inject.Inject class InitializePodActionViewModel @Inject constructor(private val aapsOmnipodManager: AapsOmnipodManager) : ActionViewModelBase() { + override fun doExecuteAction(): PumpEnactResult = aapsOmnipodManager.initializePod() } \ No newline at end of file diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/viewmodel/InsertCannulaActionViewModel.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/viewmodel/InsertCannulaActionViewModel.kt index fe042a4a03..1b1bd126dc 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/viewmodel/InsertCannulaActionViewModel.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/activation/viewmodel/InsertCannulaActionViewModel.kt @@ -7,5 +7,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.viewmode import javax.inject.Inject class InsertCannulaActionViewModel @Inject constructor(private val aapsOmnipodManager: AapsOmnipodManager, private val profileFunction: ProfileFunction) : ActionViewModelBase() { + override fun doExecuteAction(): PumpEnactResult = aapsOmnipodManager.insertCannula(profileFunction.getProfile()) } \ No newline at end of file diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/common/activity/OmnipodWizardActivityBase.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/common/activity/OmnipodWizardActivityBase.kt index 9f0f878b04..0621cd02d5 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/common/activity/OmnipodWizardActivityBase.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/common/activity/OmnipodWizardActivityBase.kt @@ -7,6 +7,7 @@ import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.plugins.pump.omnipod.R abstract class OmnipodWizardActivityBase : NoSplashAppCompatActivity() { + override fun onBackPressed() { exitActivityAfterConfirmation() } diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/common/fragment/ActionFragmentBase.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/common/fragment/ActionFragmentBase.kt index 1b0d8e41f6..a8167c4568 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/common/fragment/ActionFragmentBase.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/common/fragment/ActionFragmentBase.kt @@ -12,6 +12,7 @@ import kotlinx.android.synthetic.main.omnipod_wizard_action_page_fragment.* import kotlinx.android.synthetic.main.omnipod_wizard_nav_buttons.* abstract class ActionFragmentBase : WizardFragmentBase() { + protected lateinit var viewModel: ActionViewModelBase override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/common/fragment/WizardFragmentBase.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/common/fragment/WizardFragmentBase.kt index cd6f135f08..b2a002470e 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/common/fragment/WizardFragmentBase.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/common/fragment/WizardFragmentBase.kt @@ -19,6 +19,7 @@ import kotlinx.android.synthetic.main.omnipod_wizard_progress_indication.* import kotlin.math.roundToInt abstract class WizardFragmentBase : DaggerFragment() { + override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/PodDeactivationWizardActivity.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/PodDeactivationWizardActivity.kt index 892d85a97e..dafba7fb4d 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/PodDeactivationWizardActivity.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/PodDeactivationWizardActivity.kt @@ -5,6 +5,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.R import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.activity.OmnipodWizardActivityBase class PodDeactivationWizardActivity : OmnipodWizardActivityBase() { + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/fragment/DeactivatePodActionFragment.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/fragment/DeactivatePodActionFragment.kt index 595bda103e..59843bc180 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/fragment/DeactivatePodActionFragment.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/fragment/DeactivatePodActionFragment.kt @@ -18,6 +18,7 @@ import kotlinx.android.synthetic.main.omnipod_wizard_action_page_fragment.* import javax.inject.Inject class DeactivatePodActionFragment : ActionFragmentBase() { + @Inject @OmnipodPluginQualifier lateinit var viewModelFactory: ViewModelProvider.Factory diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/fragment/DeactivatePodInfoFragment.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/fragment/DeactivatePodInfoFragment.kt index 5fefcfc549..8a24e2767b 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/fragment/DeactivatePodInfoFragment.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/fragment/DeactivatePodInfoFragment.kt @@ -6,6 +6,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.R import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.fragment.InfoFragmentBase class DeactivatePodInfoFragment : InfoFragmentBase() { + @StringRes override fun getTitleId(): Int = R.string.omnipod_pod_deactivation_wizard_deactivate_pod_title diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/fragment/PodDeactivatedInfoFragment.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/fragment/PodDeactivatedInfoFragment.kt index 3b1c80cbb1..240efe4735 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/fragment/PodDeactivatedInfoFragment.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/fragment/PodDeactivatedInfoFragment.kt @@ -6,6 +6,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.R import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.fragment.InfoFragmentBase class PodDeactivatedInfoFragment : InfoFragmentBase() { + @StringRes override fun getTitleId(): Int = R.string.omnipod_pod_deactivation_wizard_pod_deactivated_title diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/fragment/PodDiscardedInfoFragment.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/fragment/PodDiscardedInfoFragment.kt index 7b53f4abc4..ebbfa0b3fd 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/fragment/PodDiscardedInfoFragment.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/fragment/PodDiscardedInfoFragment.kt @@ -6,6 +6,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.R import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.common.fragment.InfoFragmentBase class PodDiscardedInfoFragment : InfoFragmentBase() { + @StringRes override fun getTitleId(): Int = R.string.omnipod_pod_deactivation_wizard_pod_discarded_title diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/viewmodel/DeactivatePodActionViewModel.kt b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/viewmodel/DeactivatePodActionViewModel.kt index 80296603f2..9e0b75f2e3 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/viewmodel/DeactivatePodActionViewModel.kt +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/ui/wizard/deactivation/viewmodel/DeactivatePodActionViewModel.kt @@ -10,6 +10,7 @@ import io.reactivex.subjects.SingleSubject import javax.inject.Inject class DeactivatePodActionViewModel @Inject constructor(private val aapsOmnipodManager: AapsOmnipodManager, private val commandQueueProvider: CommandQueueProvider) : ActionViewModelBase() { + override fun doExecuteAction(): PumpEnactResult { val singleSubject = SingleSubject.create() commandQueueProvider.customCommand(CommandDeactivatePod(), object : Callback() {