- privateList stepsBeanList;
- private HorizontalStepView mHorizontalStepView;
- mHorizontalStepView=(HorizontalStepView)findViewById(R.id.hsv_step_view);
- stepsBeanList =newArrayList<>();
- StepBean stepBean0=null;
- StepBean stepBean1=null;
- StepBean stepBean2=null;
- StepBean stepBean3=null;
- switch (stepIndex){
- case1:
- stepBean0 =newStepBean("手机绑定",1);
- stepBean1 =newStepBean("实名认证",0);
- stepBean2 =newStepBean("学时充值",-1);
- stepBean3 =newStepBean("开始用车",3);
- break;
- case2:
- stepBean0 =newStepBean("手机绑定",1);
- stepBean1 =newStepBean("实名认证",1);
- stepBean2 =newStepBean("学时充值",0);
- stepBean3 =newStepBean("开始用车",3);
- break;
- case3:
- stepBean0 =newStepBean("手机绑定",1);
- stepBean1 =newStepBean("实名认证",1);
- stepBean2 =newStepBean("学时充值",1);
- stepBean3 =newStepBean("开始用车",2);
- break;
- }
- stepsBeanList.add(stepBean0);
- stepsBeanList.add(stepBean1);
- stepsBeanList.add(stepBean2);
- stepsBeanList.add(stepBean3);
- mHorizontalStepView.setStepViewTexts(stepsBeanList);
来源: http://www.cnblogs.com/Joanna-Yan/p/6552712.html