Skip to content

Android Library to create simple stepper activities

License

Notifications You must be signed in to change notification settings

TangGSen/MaterialStepper

Repository files navigation

Material Stepper

Preview

textstepper textstepper textstepper textstepper

Use

Extend one of this classes TextStepper, ProgressStepper, DotStepper, TabStepper

public class TabSample extends TabStepper {

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        // programatically set colors
        setColorPrimary(Color.parseColor("#795548"));
        setColorPrimaryDark(Color.parseColor("#5d4037"));

        setErrorTimeout(1500);

        // only TabStepper
        setLinear(true);
        
        // alternative tab style
        setAlternativeTab(true);

        setTitle("Stepper Title");

        addStep(new Step());
        addStep(new Step());
        addStep(new Step());

        super.onCreate(savedInstanceState);
    }

Extend AbstractStep

public class StepSample extends AbstractStep {

   ...

    // step name
    @Override
    public String name() {
        return "Step title";
    }

    // step optional title
    @Override
    public String optional() {
        return "Optional subtitle";
    }

    // override only if step is limited by condition
    @Override
    public boolean nextIf() {
        return i > 5;
    }

    // error showed on change next step ( see nextIf )
    @Override
    public String error() {
        return "<b>Condition</b>";
    }
}

Save data returned in onActivityResult

Bundle data = mStepper.getExtras();

About

Android Library to create simple stepper activities

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages