diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/FragmentsModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/FragmentsModule.kt index 3424fc9872..965e57496b 100644 --- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/FragmentsModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/FragmentsModule.kt @@ -36,7 +36,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyL import info.nightscout.androidaps.plugins.pump.insight.LocalInsightFragment import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicFragment import info.nightscout.androidaps.plugins.pump.medtronic.dialog.RileyLinkStatusDeviceMedtronic -import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.OmnipodOverviewFragment +import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.OmnipodErosOverviewFragment import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpFragment import info.nightscout.androidaps.plugins.source.BGSourceFragment import info.nightscout.androidaps.plugins.treatments.TreatmentsFragment @@ -68,7 +68,7 @@ abstract class FragmentsModule { @ContributesAndroidInjector abstract fun contributesLoopFragment(): LoopFragment @ContributesAndroidInjector abstract fun contributesMaintenanceFragment(): MaintenanceFragment @ContributesAndroidInjector abstract fun contributesMedtronicFragment(): MedtronicFragment - @ContributesAndroidInjector abstract fun contributesOmnipodFragment(): OmnipodOverviewFragment + @ContributesAndroidInjector abstract fun contributesOmnipodFragment(): OmnipodErosOverviewFragment @ContributesAndroidInjector abstract fun contributesNSProfileFragment(): NSProfileFragment @ContributesAndroidInjector abstract fun contributesNSClientFragment(): NSClientFragment @ContributesAndroidInjector diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt index 1c6a8e088a..ac9ce8438c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt @@ -633,7 +633,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList } pump.isSuspended -> { - binding.infoLayout.apsMode.setImageResource(if (pump.pumpDescription.pumpType == PumpType.Insulet_Omnipod) { + binding.infoLayout.apsMode.setImageResource(if (pump.pumpDescription.pumpType == PumpType.Omnipod_Eros) { // For Omnipod, indicate the pump as disconnected when it's suspended. // The only way to 'reconnect' it, is through the Omnipod tab R.drawable.ic_loop_disconnected diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt index 82362908b7..f2cbd11ebb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt @@ -40,7 +40,7 @@ class StatusLightHandler @Inject constructor( handleAge(careportal_pb_age, CareportalEvent.PUMPBATTERYCHANGE, R.string.key_statuslights_bage_warning, 216.0, R.string.key_statuslights_bage_critical, 240.0) } if (!config.NSCLIENT) { - if (pump.model() == PumpType.Insulet_Omnipod) { + if (pump.model() == PumpType.Omnipod_Eros) { handleOmnipodReservoirLevel(careportal_reservoir_level, R.string.key_statuslights_res_critical, 10.0, R.string.key_statuslights_res_warning, 80.0, pump.reservoirLevel, "U") } else { handleLevel(careportal_reservoir_level, R.string.key_statuslights_res_critical, 10.0, R.string.key_statuslights_res_warning, 80.0, pump.reservoirLevel, "U") @@ -52,7 +52,7 @@ class StatusLightHandler @Inject constructor( } if (!config.NSCLIENT) { - if (pump.model() == PumpType.Insulet_Omnipod && pump is OmnipodErosPumpPlugin) { // instance of check is needed because at startup, pump can still be VirtualPumpPlugin and that will cause a crash because of the class cast below + if (pump.model() == PumpType.Omnipod_Eros && pump is OmnipodErosPumpPlugin) { // instance of check is needed because at startup, pump can still be VirtualPumpPlugin and that will cause a crash because of the class cast below handleOmnipodBatteryLevel(careportal_battery_level, R.string.key_statuslights_bat_critical, 26.0, R.string.key_statuslights_bat_warning, 51.0, pump.batteryLevel.toDouble(), "%", pump.isUseRileyLinkBatteryLevel) } else if (pump.model() != PumpType.AccuChekCombo) { handleLevel(careportal_battery_level, R.string.key_statuslights_bat_critical, 26.0, R.string.key_statuslights_bat_warning, 51.0, pump.batteryLevel.toDouble(), "%") diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.java index 90c6aadd70..670ec3fae1 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.java +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.java @@ -98,12 +98,19 @@ public enum PumpType { // Insulet - Insulet_Omnipod("Insulet Omnipod", ManufacturerType.Insulet, "Omnipod (Eros)", 0.05d, null, // + Omnipod_Eros("Omnipod", ManufacturerType.Insulet, "Eros", 0.05d, null, // new DoseSettings(0.05d, 30, 8 * 60, 0.05d), // PumpTempBasalType.Absolute, // new DoseSettings(0.05d, 30, 12 * 60, 0d, 30.0d), PumpCapability.BasalRate_Duration30minAllowed, // 0.05d, null, 0.05d, null, PumpCapability.OmnipodCapabilities, true), + Omnipod_Dash("Omnipod", ManufacturerType.Insulet, "Dash", 0.05d, null, // + new DoseSettings(0.05d, 30, 8 * 60, 0.05d), // + PumpTempBasalType.Absolute, // + new DoseSettings(0.05d, 30, 12 * 60, 0d, 30.0d), PumpCapability.BasalRate_Duration30minAllowed, // + 0.05d, null, 0.05d, null, PumpCapability.OmnipodCapabilities, false), + + // Medtronic Medtronic_512_712("Medtronic 512/712", ManufacturerType.Medtronic, "512/712", 0.1d, null, // new DoseSettings(0.05d, 30, 8 * 60, 0.05d), // diff --git a/omnipod-common/build.gradle b/omnipod-common/build.gradle index 85797f8d35..78e07d2236 100644 --- a/omnipod-common/build.gradle +++ b/omnipod-common/build.gradle @@ -45,6 +45,7 @@ dependencies { annotationProcessor "com.google.dagger:dagger-android-processor:$dagger_version" kapt "com.google.dagger:dagger-android-processor:$dagger_version" kapt "com.google.dagger:dagger-compiler:$dagger_version" + testImplementation "junit:junit:$junit_version" androidTestImplementation "androidx.test.ext:junit:$androidx_junit" } \ No newline at end of file diff --git a/omnipod-common/src/main/AndroidManifest.xml b/omnipod-common/src/main/AndroidManifest.xml index 2ad7b616f1..24a9e72c49 100644 --- a/omnipod-common/src/main/AndroidManifest.xml +++ b/omnipod-common/src/main/AndroidManifest.xml @@ -2,4 +2,8 @@ + + + + \ No newline at end of file diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/PlaceHolder.java b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/PlaceHolder.java deleted file mode 100644 index 4053d8f105..0000000000 --- a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/PlaceHolder.java +++ /dev/null @@ -1,4 +0,0 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.common; - -public class PlaceHolder { -} diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandAcknowledgeAlerts.java b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandAcknowledgeAlerts.java new file mode 100644 index 0000000000..ea8aa4fba3 --- /dev/null +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandAcknowledgeAlerts.java @@ -0,0 +1,11 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command; + +import org.jetbrains.annotations.NotNull; + +import info.nightscout.androidaps.queue.commands.CustomCommand; + +public final class CommandAcknowledgeAlerts implements CustomCommand { + @NotNull @Override public String getStatusDescription() { + return "ACKNOWLEDGE ALERTS"; + } +} diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandDeactivatePod.java b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandDeactivatePod.java new file mode 100644 index 0000000000..b3300b15ef --- /dev/null +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandDeactivatePod.java @@ -0,0 +1,11 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command; + +import org.jetbrains.annotations.NotNull; + +import info.nightscout.androidaps.queue.commands.CustomCommand; + +public final class CommandDeactivatePod implements CustomCommand { + @NotNull @Override public String getStatusDescription() { + return "DEACTIVATE POD"; + } +} diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandHandleTimeChange.java b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandHandleTimeChange.java new file mode 100644 index 0000000000..5dfdcdcab6 --- /dev/null +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandHandleTimeChange.java @@ -0,0 +1,21 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command; + +import org.jetbrains.annotations.NotNull; + +import info.nightscout.androidaps.queue.commands.CustomCommand; + +public final class CommandHandleTimeChange implements CustomCommand { + private final boolean requestedByUser; + + public CommandHandleTimeChange(boolean requestedByUser) { + this.requestedByUser = requestedByUser; + } + + public boolean isRequestedByUser() { + return requestedByUser; + } + + @NotNull @Override public String getStatusDescription() { + return "HANDLE TIME CHANGE"; + } +} diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandPlayTestBeep.java b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandPlayTestBeep.java new file mode 100644 index 0000000000..d62d59d726 --- /dev/null +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandPlayTestBeep.java @@ -0,0 +1,11 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command; + +import org.jetbrains.annotations.NotNull; + +import info.nightscout.androidaps.queue.commands.CustomCommand; + +public class CommandPlayTestBeep implements CustomCommand { + @NotNull @Override public String getStatusDescription() { + return "PLAY TEST BEEP"; + } +} diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandResumeDelivery.java b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandResumeDelivery.java new file mode 100644 index 0000000000..2d8af85bdd --- /dev/null +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandResumeDelivery.java @@ -0,0 +1,11 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command; + +import org.jetbrains.annotations.NotNull; + +import info.nightscout.androidaps.queue.commands.CustomCommand; + +public final class CommandResumeDelivery implements CustomCommand { + @NotNull @Override public String getStatusDescription() { + return "RESUME DELIVERY"; + } +} diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandSuspendDelivery.java b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandSuspendDelivery.java new file mode 100644 index 0000000000..f3478e7d50 --- /dev/null +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandSuspendDelivery.java @@ -0,0 +1,11 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command; + +import org.jetbrains.annotations.NotNull; + +import info.nightscout.androidaps.queue.commands.CustomCommand; + +public final class CommandSuspendDelivery implements CustomCommand { + @NotNull @Override public String getStatusDescription() { + return "SUSPEND DELIVERY"; + } +} diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandUpdateAlertConfiguration.java b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandUpdateAlertConfiguration.java new file mode 100644 index 0000000000..be1f7549ae --- /dev/null +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandUpdateAlertConfiguration.java @@ -0,0 +1,11 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command; + +import org.jetbrains.annotations.NotNull; + +import info.nightscout.androidaps.queue.commands.CustomCommand; + +public final class CommandUpdateAlertConfiguration implements CustomCommand { + @NotNull @Override public String getStatusDescription() { + return "UPDATE ALERT CONFIGURATION"; + } +} diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/PodActivationWizardActivity.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/PodActivationWizardActivity.kt similarity index 79% rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/PodActivationWizardActivity.kt rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/PodActivationWizardActivity.kt index 723f990c60..c941e94147 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/PodActivationWizardActivity.kt +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/PodActivationWizardActivity.kt @@ -1,11 +1,9 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation import android.os.Bundle import androidx.annotation.IdRes -import info.nightscout.androidaps.plugins.pump.omnipod.eros.R -import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress -import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager -import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.activity.OmnipodWizardActivityBase +import info.nightscout.androidaps.plugins.pump.omnipod.common.R +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.activity.OmnipodWizardActivityBase import javax.inject.Inject class PodActivationWizardActivity : OmnipodWizardActivityBase() { diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/AttachPodInfoFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/AttachPodInfoFragment.kt similarity index 60% rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/AttachPodInfoFragment.kt rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/AttachPodInfoFragment.kt index 13c091f04f..42ea98a971 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/AttachPodInfoFragment.kt +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/AttachPodInfoFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment import android.os.Bundle import android.view.View @@ -7,16 +7,16 @@ import androidx.annotation.IdRes import androidx.annotation.StringRes import androidx.appcompat.app.AlertDialog import androidx.navigation.fragment.findNavController -import info.nightscout.androidaps.plugins.pump.omnipod.eros.R -import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment.InfoFragmentBase +import info.nightscout.androidaps.plugins.pump.omnipod.common.R +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.InfoFragmentBase class AttachPodInfoFragment : InfoFragmentBase() { @StringRes - override fun getTitleId(): Int = R.string.omnipod_pod_activation_wizard_attach_pod_title + override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_attach_pod_title @StringRes - override fun getTextId(): Int = R.string.omnipod_pod_activation_wizard_attach_pod_text + override fun getTextId(): Int = R.string.omnipod_common_pod_activation_wizard_attach_pod_text @IdRes override fun getNextPageActionId(): Int = R.id.action_attachPodInfoFragment_to_insertCannulaActionFragment @@ -31,9 +31,9 @@ class AttachPodInfoFragment : InfoFragmentBase() { AlertDialog.Builder(it) .setIcon(android.R.drawable.ic_dialog_alert) .setTitle(getString(getTitleId())) - .setMessage(getString(R.string.omnipod_pod_activation_wizard_attach_pod_confirm_insert_cannula_text)) - .setPositiveButton(getString(R.string.omnipod_ok)) { _, _ -> findNavController().navigate(getNextPageActionId()) } - .setNegativeButton(getString(R.string.omnipod_cancel), null) + .setMessage(getString(R.string.omnipod_common_pod_activation_wizard_attach_pod_confirm_insert_cannula_text)) + .setPositiveButton(getString(R.string.omnipod_common_ok)) { _, _ -> findNavController().navigate(getNextPageActionId()) } + .setNegativeButton(getString(R.string.omnipod_common_cancel), null) .show() } } diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/FillPodInfoFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/FillPodInfoFragment.kt similarity index 52% rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/FillPodInfoFragment.kt rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/FillPodInfoFragment.kt index d6f3316deb..26dd0b2e54 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/FillPodInfoFragment.kt +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/FillPodInfoFragment.kt @@ -1,14 +1,14 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment import androidx.annotation.IdRes import androidx.annotation.StringRes -import info.nightscout.androidaps.plugins.pump.omnipod.eros.R -import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment.InfoFragmentBase +import info.nightscout.androidaps.plugins.pump.omnipod.common.R +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.InfoFragmentBase class FillPodInfoFragment : InfoFragmentBase() { @StringRes - override fun getTitleId(): Int = R.string.omnipod_pod_activation_wizard_fill_pod_title + override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_fill_pod_title @StringRes override fun getTextId(): Int = R.string.omnipod_pod_activation_wizard_fill_pod_text diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/InitializePodActionFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/InitializePodActionFragment.kt similarity index 65% rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/InitializePodActionFragment.kt rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/InitializePodActionFragment.kt index 23914c1e96..848d7f5064 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/InitializePodActionFragment.kt +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/InitializePodActionFragment.kt @@ -1,13 +1,12 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment import android.os.Bundle import androidx.annotation.IdRes import androidx.annotation.StringRes import androidx.fragment.app.viewModels import androidx.lifecycle.ViewModelProvider -import info.nightscout.androidaps.plugins.pump.omnipod.eros.R -import info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger.OmnipodPluginQualifier -import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.viewmodel.InitializePodActionViewModel +import info.nightscout.androidaps.plugins.pump.omnipod.common.R +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.InitializePodActionViewModel import javax.inject.Inject class InitializePodActionFragment : PodActivationActionFragmentBase() { @@ -24,7 +23,7 @@ class InitializePodActionFragment : PodActivationActionFragmentBase() { } @StringRes - override fun getTitleId(): Int = R.string.omnipod_pod_activation_wizard_initialize_pod_title + override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_initialize_pod_title @StringRes override fun getTextId(): Int = R.string.omnipod_pod_activation_wizard_initialize_pod_text diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/InsertCannulaActionFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/InsertCannulaActionFragment.kt similarity index 58% rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/InsertCannulaActionFragment.kt rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/InsertCannulaActionFragment.kt index ec56cedab2..fffaa1d930 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/InsertCannulaActionFragment.kt +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/InsertCannulaActionFragment.kt @@ -1,13 +1,12 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment import android.os.Bundle import androidx.annotation.IdRes import androidx.annotation.StringRes import androidx.fragment.app.viewModels import androidx.lifecycle.ViewModelProvider -import info.nightscout.androidaps.plugins.pump.omnipod.eros.R -import info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger.OmnipodPluginQualifier -import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.viewmodel.InsertCannulaActionViewModel +import info.nightscout.androidaps.plugins.pump.omnipod.common.R +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.InsertCannulaActionViewModel import javax.inject.Inject class InsertCannulaActionFragment : PodActivationActionFragmentBase() { @@ -24,10 +23,10 @@ class InsertCannulaActionFragment : PodActivationActionFragmentBase() { } @StringRes - override fun getTitleId(): Int = R.string.omnipod_pod_activation_wizard_insert_cannula_title + override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_insert_cannula_title @StringRes - override fun getTextId(): Int = R.string.omnipod_pod_activation_wizard_insert_cannula_text + override fun getTextId(): Int = R.string.omnipod_common_pod_activation_wizard_insert_cannula_text @IdRes override fun getNextPageActionId(): Int = R.id.action_insertCannulaActionFragment_to_PodActivatedInfoFragment diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/PodActivatedInfoFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/PodActivatedInfoFragment.kt new file mode 100644 index 0000000000..387646d015 --- /dev/null +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/PodActivatedInfoFragment.kt @@ -0,0 +1,20 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment + +import androidx.annotation.IdRes +import androidx.annotation.StringRes +import info.nightscout.androidaps.plugins.pump.omnipod.common.R +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.InfoFragmentBase + +class PodActivatedInfoFragment : InfoFragmentBase() { + + @StringRes + override fun getTitleId(): Int = R.string.omnipod_common_pod_activation_wizard_pod_activated_title + + @StringRes + override fun getTextId(): Int = R.string.omnipod_common_pod_activation_wizard_pod_activated_text + + @IdRes + override fun getNextPageActionId(): Int? = null + + override fun getIndex(): Int = 5 +} \ No newline at end of file diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/PodActivationActionFragmentBase.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/PodActivationActionFragmentBase.kt similarity index 68% rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/PodActivationActionFragmentBase.kt rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/PodActivationActionFragmentBase.kt index f94ffd38a2..99e1a6da4e 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/fragment/PodActivationActionFragmentBase.kt +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/fragment/PodActivationActionFragmentBase.kt @@ -1,14 +1,12 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.fragment +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.fragment import android.content.Intent import android.os.Bundle import android.view.View import android.widget.Button -import info.nightscout.androidaps.plugins.pump.omnipod.eros.R -import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress -import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager -import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment.ActionFragmentBase -import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.PodDeactivationWizardActivity +import info.nightscout.androidaps.plugins.pump.omnipod.common.R +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.ActionFragmentBase +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.PodDeactivationWizardActivity import javax.inject.Inject abstract class PodActivationActionFragmentBase : ActionFragmentBase() { diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/InitializePodActionViewModel.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/InitializePodActionViewModel.kt similarity index 66% rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/InitializePodActionViewModel.kt rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/InitializePodActionViewModel.kt index a1316b51d6..0eb2c9436e 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/InitializePodActionViewModel.kt +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/InitializePodActionViewModel.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.viewmodel +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel import info.nightscout.androidaps.data.PumpEnactResult +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.viewmodel.ActionViewModelBase import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodManager -import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.viewmodel.ActionViewModelBase import javax.inject.Inject class InitializePodActionViewModel @Inject constructor(private val aapsOmnipodManager: AapsOmnipodManager) : ActionViewModelBase() { diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/InsertCannulaActionViewModel.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/InsertCannulaActionViewModel.kt similarity index 72% rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/InsertCannulaActionViewModel.kt rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/InsertCannulaActionViewModel.kt index 87e34c28f7..ad5f366fc7 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/InsertCannulaActionViewModel.kt +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/InsertCannulaActionViewModel.kt @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.viewmodel +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel import info.nightscout.androidaps.data.PumpEnactResult import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.viewmodel.ActionViewModelBase import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodManager -import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.viewmodel.ActionViewModelBase import javax.inject.Inject class InsertCannulaActionViewModel @Inject constructor(private val aapsOmnipodManager: AapsOmnipodManager, private val profileFunction: ProfileFunction) : ActionViewModelBase() { diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/activity/OmnipodWizardActivityBase.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/activity/OmnipodWizardActivityBase.kt similarity index 76% rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/activity/OmnipodWizardActivityBase.kt rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/activity/OmnipodWizardActivityBase.kt index ec00555995..039e047bfa 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/activity/OmnipodWizardActivityBase.kt +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/activity/OmnipodWizardActivityBase.kt @@ -1,10 +1,10 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.activity +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.activity import androidx.appcompat.app.AlertDialog import androidx.navigation.NavController import androidx.navigation.fragment.NavHostFragment import info.nightscout.androidaps.activities.NoSplashAppCompatActivity -import info.nightscout.androidaps.plugins.pump.omnipod.eros.R +import info.nightscout.androidaps.plugins.pump.omnipod.common.R abstract class OmnipodWizardActivityBase : NoSplashAppCompatActivity() { @@ -20,8 +20,8 @@ abstract class OmnipodWizardActivityBase : NoSplashAppCompatActivity() { .setIcon(android.R.drawable.ic_dialog_alert) .setTitle(getString(R.string.omnipod_common_wizard_exit_confirmation_title)) .setMessage(getString(R.string.omnipod_common_wizard_exit_confirmation_text)) - .setPositiveButton(getString(R.string.omnipod_yes)) { _, _ -> finish() } - .setNegativeButton(getString(R.string.omnipod_no), null) + .setPositiveButton(getString(R.string.omnipod_common_yes)) { _, _ -> finish() } + .setNegativeButton(getString(R.string.omnipod_common_no), null) .show() } } diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/ActionFragmentBase.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/ActionFragmentBase.kt similarity index 92% rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/ActionFragmentBase.kt rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/ActionFragmentBase.kt index d1bd2f9f0b..9abbd9e8cf 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/ActionFragmentBase.kt +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/ActionFragmentBase.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment import android.annotation.SuppressLint import android.os.Bundle @@ -6,8 +6,8 @@ import android.view.View import android.widget.Button import androidx.annotation.LayoutRes import androidx.annotation.StringRes -import info.nightscout.androidaps.plugins.pump.omnipod.eros.R -import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.viewmodel.ActionViewModelBase +import info.nightscout.androidaps.plugins.pump.omnipod.common.R +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.viewmodel.ActionViewModelBase import info.nightscout.androidaps.utils.extensions.toVisibility abstract class ActionFragmentBase : WizardFragmentBase() { diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/InfoFragmentBase.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/InfoFragmentBase.kt similarity index 80% rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/InfoFragmentBase.kt rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/InfoFragmentBase.kt index 664e373539..6193e64d86 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/InfoFragmentBase.kt +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/InfoFragmentBase.kt @@ -1,11 +1,11 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment import android.os.Bundle import android.view.View import android.widget.TextView import androidx.annotation.LayoutRes import androidx.annotation.StringRes -import info.nightscout.androidaps.plugins.pump.omnipod.eros.R +import info.nightscout.androidaps.plugins.pump.omnipod.common.R abstract class InfoFragmentBase : WizardFragmentBase() { diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/WizardFragmentBase.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/WizardFragmentBase.kt similarity index 88% rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/WizardFragmentBase.kt rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/WizardFragmentBase.kt index f687bb9b04..6cbb24aeed 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/fragment/WizardFragmentBase.kt +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/WizardFragmentBase.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment import android.content.res.ColorStateList import android.os.Bundle @@ -10,9 +10,8 @@ import androidx.annotation.LayoutRes import androidx.annotation.StringRes import androidx.navigation.fragment.findNavController import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.plugins.pump.omnipod.eros.R -import info.nightscout.androidaps.plugins.pump.omnipod.eros.databinding.OmnipodWizardBaseFragmentBinding -import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.activity.OmnipodWizardActivityBase +import info.nightscout.androidaps.plugins.pump.omnipod.common.R +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.activity.OmnipodWizardActivityBase import kotlin.math.roundToInt abstract class WizardFragmentBase : DaggerFragment() { diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/viewmodel/ActionViewModelBase.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt similarity index 86% rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/viewmodel/ActionViewModelBase.kt rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt index 65f29dd3f5..d41b0725d1 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/common/viewmodel/ActionViewModelBase.kt +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.viewmodel +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.viewmodel import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData @@ -17,7 +17,7 @@ abstract class ActionViewModelBase : ViewModel() { fun executeAction() { _isActionExecutingLiveData.postValue(true) - SingleSubject.fromCallable(this::doExecuteAction) + SingleSubject.fromCallable(this::doExecuteAction) .subscribeOn(Schedulers.io()) .doOnSuccess { result -> _isActionExecutingLiveData.postValue(false) diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/PodDeactivationWizardActivity.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/PodDeactivationWizardActivity.kt similarity index 59% rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/PodDeactivationWizardActivity.kt rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/PodDeactivationWizardActivity.kt index 895a7c4c8e..4107469ce4 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/PodDeactivationWizardActivity.kt +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/PodDeactivationWizardActivity.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation import android.os.Bundle -import info.nightscout.androidaps.plugins.pump.omnipod.eros.R -import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.activity.OmnipodWizardActivityBase +import info.nightscout.androidaps.plugins.pump.omnipod.common.R +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.activity.OmnipodWizardActivityBase class PodDeactivationWizardActivity : OmnipodWizardActivityBase() { diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/fragment/DeactivatePodActionFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/DeactivatePodActionFragment.kt similarity index 64% rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/fragment/DeactivatePodActionFragment.kt rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/DeactivatePodActionFragment.kt index dab6389965..d2bcb71c99 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/fragment/DeactivatePodActionFragment.kt +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/DeactivatePodActionFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.fragment +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.fragment import android.os.Bundle import android.view.View @@ -9,11 +9,9 @@ import androidx.appcompat.app.AlertDialog import androidx.fragment.app.viewModels import androidx.lifecycle.ViewModelProvider import androidx.navigation.fragment.findNavController -import info.nightscout.androidaps.plugins.pump.omnipod.eros.R -import info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger.OmnipodPluginQualifier -import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodManager -import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.fragment.ActionFragmentBase -import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.viewmodel.DeactivatePodActionViewModel +import info.nightscout.androidaps.plugins.pump.omnipod.common.R +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.ActionFragmentBase +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.DeactivatePodActionViewModel import info.nightscout.androidaps.utils.extensions.toVisibility import javax.inject.Inject @@ -37,18 +35,18 @@ class DeactivatePodActionFragment : ActionFragmentBase() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - buttonDiscardPod = view.findViewById(R.id.button_discard_pod) + buttonDiscardPod = view.findViewById(R.id.omnipod_wizard_button_discard_pod) buttonDiscardPod.setOnClickListener { context?.let { AlertDialog.Builder(it) .setIcon(android.R.drawable.ic_dialog_alert) - .setTitle(getString(R.string.omnipod_pod_deactivation_wizard_discard_pod)) - .setMessage(getString(R.string.omnipod_pod_deactivation_wizard_discard_pod_confirmation)) - .setPositiveButton(getString(R.string.omnipod_yes)) { _, _ -> + .setTitle(getString(R.string.omnipod_common_pod_deactivation_wizard_discard_pod)) + .setMessage(getString(R.string.omnipod_common_pod_deactivation_wizard_discard_pod_confirmation)) + .setPositiveButton(getString(R.string.omnipod_common_yes)) { _, _ -> aapsOmnipodManager.discardPodState() findNavController().navigate(R.id.action_deactivatePodActionFragment_to_podDiscardedInfoFragment) } - .setNegativeButton(getString(R.string.omnipod_no), null) + .setNegativeButton(getString(R.string.omnipod_common_no), null) .show() } } @@ -59,10 +57,10 @@ class DeactivatePodActionFragment : ActionFragmentBase() { } @StringRes - override fun getTitleId(): Int = R.string.omnipod_pod_deactivation_wizard_deactivating_pod_title + override fun getTitleId(): Int = R.string.omnipod_common_pod_deactivation_wizard_deactivating_pod_title @StringRes - override fun getTextId(): Int = R.string.omnipod_pod_deactivation_wizard_deactivating_pod_text + override fun getTextId(): Int = R.string.omnipod_common_pod_deactivation_wizard_deactivating_pod_text @IdRes override fun getNextPageActionId(): Int = R.id.action_deactivatePodActionFragment_to_podDeactivatedInfoFragment diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/DeactivatePodInfoFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/DeactivatePodInfoFragment.kt new file mode 100644 index 0000000000..185eaf2f61 --- /dev/null +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/DeactivatePodInfoFragment.kt @@ -0,0 +1,20 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.fragment + +import androidx.annotation.IdRes +import androidx.annotation.StringRes +import info.nightscout.androidaps.plugins.pump.omnipod.common.R +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.InfoFragmentBase + +class DeactivatePodInfoFragment : InfoFragmentBase() { + + @StringRes + override fun getTitleId(): Int = R.string.omnipod_common_pod_deactivation_wizard_deactivate_pod_title + + @StringRes + override fun getTextId(): Int = R.string.omnipod_common_pod_deactivation_wizard_deactivate_pod_text + + @IdRes + override fun getNextPageActionId(): Int = R.id.action_deactivatePodInfoFragment_to_deactivatePodActionFragment + + override fun getIndex(): Int = 1 +} \ No newline at end of file diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/PodDeactivatedInfoFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/PodDeactivatedInfoFragment.kt new file mode 100644 index 0000000000..50d6ec5173 --- /dev/null +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/PodDeactivatedInfoFragment.kt @@ -0,0 +1,20 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.fragment + +import androidx.annotation.IdRes +import androidx.annotation.StringRes +import info.nightscout.androidaps.plugins.pump.omnipod.common.R +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.InfoFragmentBase + +class PodDeactivatedInfoFragment : InfoFragmentBase() { + + @StringRes + override fun getTitleId(): Int = R.string.omnipod_common_pod_deactivation_wizard_pod_deactivated_title + + @StringRes + override fun getTextId(): Int = R.string.omnipod_common_pod_deactivation_wizard_pod_deactivated_text + + @IdRes + override fun getNextPageActionId(): Int? = null + + override fun getIndex(): Int = 3 +} \ No newline at end of file diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/PodDiscardedInfoFragment.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/PodDiscardedInfoFragment.kt new file mode 100644 index 0000000000..4bc0cc1214 --- /dev/null +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/fragment/PodDiscardedInfoFragment.kt @@ -0,0 +1,20 @@ +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.fragment + +import androidx.annotation.IdRes +import androidx.annotation.StringRes +import info.nightscout.androidaps.plugins.pump.omnipod.common.R +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.InfoFragmentBase + +class PodDiscardedInfoFragment : InfoFragmentBase() { + + @StringRes + override fun getTitleId(): Int = R.string.omnipod_common_pod_deactivation_wizard_pod_discarded_title + + @StringRes + override fun getTextId(): Int = R.string.omnipod_common_pod_deactivation_wizard_pod_discarded_text + + @IdRes + override fun getNextPageActionId(): Int? = null + + override fun getIndex(): Int = 3 +} \ No newline at end of file diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/DeactivatePodActionViewModel.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/viewmodel/DeactivatePodActionViewModel.kt similarity index 82% rename from omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/DeactivatePodActionViewModel.kt rename to omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/viewmodel/DeactivatePodActionViewModel.kt index 24530b6c70..2108a08a5b 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/DeactivatePodActionViewModel.kt +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/viewmodel/DeactivatePodActionViewModel.kt @@ -1,10 +1,10 @@ -package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.viewmodel +package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel import info.nightscout.androidaps.data.PumpEnactResult import info.nightscout.androidaps.interfaces.CommandQueueProvider +import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.viewmodel.ActionViewModelBase import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodManager import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandDeactivatePod -import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.common.viewmodel.ActionViewModelBase import info.nightscout.androidaps.queue.Callback import io.reactivex.subjects.SingleSubject import javax.inject.Inject diff --git a/omnipod-eros/src/main/res/layout/omnipod_overview.xml b/omnipod-common/src/main/res/layout/omnipod_overview.xml similarity index 95% rename from omnipod-eros/src/main/res/layout/omnipod_overview.xml rename to omnipod-common/src/main/res/layout/omnipod_overview.xml index f627579beb..034f2d3065 100644 --- a/omnipod-eros/src/main/res/layout/omnipod_overview.xml +++ b/omnipod-common/src/main/res/layout/omnipod_overview.xml @@ -106,7 +106,7 @@ android:gravity="end" android:paddingStart="5dp" android:paddingEnd="5dp" - android:text="@string/omnipod_overview_pod_address" + android:text="@string/omnipod_common_overview_pod_unique_id" android:textSize="14sp" /> + android:text="@string/omnipod_common_overview_button_pod_management" />