Skip to content
This repository has been archived by the owner on Aug 22, 2020. It is now read-only.

how to set specific active position...? #27

Open
alasari42 opened this issue Jun 24, 2019 · 1 comment
Open

how to set specific active position...? #27

alasari42 opened this issue Jun 24, 2019 · 1 comment

Comments

@alasari42
Copy link

No description provided.

@soffanma28
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants