From f77636e2062a43624fe553373256706444e43399 Mon Sep 17 00:00:00 2001 From: Sergey Solovyev Date: Tue, 18 Jun 2013 20:20:45 +0400 Subject: [PATCH] wizard added --- .../calculator/wizard/AppWizardFlow.java | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 android-app/src/main/java/org/solovyev/android/calculator/wizard/AppWizardFlow.java diff --git a/android-app/src/main/java/org/solovyev/android/calculator/wizard/AppWizardFlow.java b/android-app/src/main/java/org/solovyev/android/calculator/wizard/AppWizardFlow.java new file mode 100644 index 00000000..30c6b143 --- /dev/null +++ b/android-app/src/main/java/org/solovyev/android/calculator/wizard/AppWizardFlow.java @@ -0,0 +1,55 @@ +package org.solovyev.android.calculator.wizard; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.List; + +import static org.solovyev.android.calculator.wizard.WizardStep.welcome; + +/** + * User: serso + * Date: 6/16/13 + * Time: 9:25 PM + */ +final class AppWizardFlow implements WizardFlow { + + public static final String NAME = "app-wizard"; + + @Nonnull + private final ListWizardFlow listWizardFlow; + + AppWizardFlow() { + final List wizardSteps = new ArrayList(); + for (WizardStep wizardStep : WizardStep.values()) { + if (wizardStep != welcome) { + wizardSteps.add(wizardStep); + } + } + this.listWizardFlow = new ListWizardFlow(NAME, wizardSteps); + } + + @Nonnull + @Override + public String getName() { + return listWizardFlow.getName(); + } + + @Nullable + @Override + public WizardStep getNextStep(@Nonnull WizardStep step) { + return listWizardFlow.getNextStep(step); + } + + @Nullable + @Override + public WizardStep getPrevStep(@Nonnull WizardStep step) { + return listWizardFlow.getPrevStep(step); + } + + @Nonnull + @Override + public WizardStep getFirstStep() { + return listWizardFlow.getFirstStep(); + } +}