From c3cc4728e3f10898a3ef02585ed453a6ea3623b3 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Sat, 20 Feb 2021 01:09:03 +0100 Subject: [PATCH] Pass wizard type to pod activation wizard --- .../pump/omnipod/eros/ui/ErosPodManagementActivity.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt index 64a10d0ff9..b283e6ac58 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt @@ -63,7 +63,16 @@ class ErosPodManagementActivity : NoSplashAppCompatActivity() { setContentView(binding.root) binding.buttonActivatePod.setOnClickListener { - startActivity(Intent(this, PodActivationWizardActivity::class.java)) + val type: PodActivationWizardActivity.Type = if (podStateManager.isPodInitialized + and podStateManager.activationProgress.isAtLeast(ActivationProgress.PRIMING_COMPLETED)) { + PodActivationWizardActivity.Type.SHORT + } else { + PodActivationWizardActivity.Type.LONG + } + + val intent = Intent(this, PodActivationWizardActivity::class.java) + intent.putExtra(PodActivationWizardActivity.KEY_TYPE, type) + startActivity(intent) } binding.buttonDeactivatePod.setOnClickListener {