MaterialStepperView icon indicating copy to clipboard operation
MaterialStepperView copied to clipboard

how to set specific active position...?

Open alasari42 opened this issue 6 years ago • 1 comments

alasari42 avatar Jun 24 '19 03:06 alasari42

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
                    }
                }
            }
        }

soffanma28 avatar Aug 21 '20 23:08 soffanma28