MaterialStepperView
MaterialStepperView copied to clipboard
how to set specific active position...?
you can change the stepper state with mSteppers[0]?.state = VerticalStepperItemView.STATE_SELECTED
or you can use loop so each step you click will change it's active position
for example, i have 7 step
mSteppers[0] = view.findViewById(R.id.stepper_0)
mSteppers[1] = view.findViewById(R.id.stepper_1)
mSteppers[2] = view.findViewById(R.id.stepper_2)
mSteppers[3] = view.findViewById(R.id.stepper_3)
mSteppers[4] = view.findViewById(R.id.stepper_4)
mSteppers[5] = view.findViewById(R.id.stepper_5)
mSteppers[6] = view.findViewById(R.id.stepper_6)
VerticalStepperItemView.bindSteppers(*mSteppers)
for (stepper in mSteppers) {
stepper?.setActivatedColorResource(R.color.material_deep_purple_500)
stepper?.setOnClickListener {
for (step in mSteppers){
if (stepper == step) {
step.state = VerticalStepperItemView.STATE_SELECTED
} else {
step?.state = VerticalStepperItemView.STATE_NORMAL
}
}
}
}