This commit is contained in:
serso 2015-02-08 18:09:19 +01:00
parent c7af20f127
commit eecfd57be4
3 changed files with 30 additions and 9 deletions

View File

@ -0,0 +1,22 @@
package org.solovyev.android.calculator.release;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import javax.annotation.Nonnull;
public class ChooseThemeReleaseNoteStep extends ReleaseNoteStep {
public ChooseThemeReleaseNoteStep(Integer version) {
super(version);
}
public ChooseThemeReleaseNoteStep(@Nonnull Bundle arguments) {
super(arguments);
}
@Nonnull
@Override
public Class<? extends Fragment> getFragmentClass() {
return ChooseThemeReleaseNoteFragment.class;
}
}

View File

@ -3,8 +3,7 @@ package org.solovyev.android.calculator.wizard;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import org.solovyev.android.calculator.release.ChooseThemeReleaseNoteFragment;
import org.solovyev.android.calculator.release.ChooseThemeReleaseNoteStep;
import org.solovyev.android.calculator.release.ReleaseNoteStep;
import org.solovyev.android.calculator.release.ReleaseNotes;
import org.solovyev.android.wizard.*;
@ -90,13 +89,7 @@ public class CalculatorWizards implements Wizards {
for (Integer version : versions) {
switch (version) {
case 136:
wizardSteps.add(new ReleaseNoteStep(version) {
@Nonnull
@Override
public Class<? extends Fragment> getFragmentClass() {
return ChooseThemeReleaseNoteFragment.class;
}
});
wizardSteps.add(new ChooseThemeReleaseNoteStep(version));
break;
default:
wizardSteps.add(new ReleaseNoteStep(version));

View File

@ -9,6 +9,8 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import org.solovyev.android.calculator.R;
import org.solovyev.android.calculator.release.ChooseThemeReleaseNoteFragment;
import org.solovyev.android.calculator.release.ChooseThemeReleaseNoteStep;
import org.solovyev.android.calculator.release.ReleaseNoteFragment;
import org.solovyev.android.calculator.release.ReleaseNoteStep;
import org.solovyev.android.wizard.Wizard;
@ -41,6 +43,10 @@ public abstract class WizardFragment extends Fragment implements View.OnClickLis
return new ReleaseNoteStep(getArguments());
}
if(this instanceof ChooseThemeReleaseNoteFragment) {
return new ChooseThemeReleaseNoteStep(getArguments());
}
for (CalculatorWizardStep step : CalculatorWizardStep.values()) {
if (step.getFragmentClass().equals(getClass())) {
return step;