Refactored baoyachi's StepView to use better code inheritance, a cleaner data structure applicable for both HorizontalStepView and VerticalStepView and Javadoc for all publicly available methods.
Quick intro/migration guide to the lib:
- Include HorizontalStepView or VerticalStepView in your layout XML
<com.vinay.stepview.HorizontalStepView
android:id="@+id/horizontal_step_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<!-- OR -->
<com.vinay.stepview.VerticalStepView
android:id="@+id/vertical_step_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
- Create a list of steps
List<Step> stepList = new ArrayList<Step>();
stepList.add(new Step("Step title goes here", State.CURRENT);
stepList.add(new Step("Step title goes here", State.NOT_COMPLETED);
mStepView.setSteps(stepList);
- Change step state as the user navigates/completes steps.
mStepView.setStepState(Step.State.COMPLETED, 0); // Marks the first step as completed
mStepView.setStepState(Step.State.CURRENT, 1); // Marks the second step as current
The demo app is available here as an APK and on the Play Store