stepstone-tech / android-material-stepper

This library allows to use Material steppers inside Android applications.
Apache License 2.0
1.78k stars 262 forks source link

Reset material stepper on when completed. #259

Open kyao-Frndz opened 6 years ago

kyao-Frndz commented 6 years ago

Hi Could you help me with a solution to reset material stepper after the step have completed by the user. I tried setCurrentItem on the ViewPager but did not work.

Your assistance will be much appreciated.

zawadz88 commented 6 years ago

Hi, Could you explain a bit more what do you mean by resetting the stepper? Could you also explain why you would want to do it, please?

kyao-Frndz commented 6 years ago

@zawadz88 thanks for your early response. I am using the stepper for a e-commerce transaction such that the user provide data step by step and at the end a dialog pops up to ask if the user would like to perform some transaction again and if yes the stepper should go back to step 1 and clear the previous data.

zawadz88 commented 6 years ago

Hi @kyao-Frndz, Have you tried calling StepperLayout#setAdapter(StepAdapter stepAdapter, int) with a new adapter to accomplish this? I'm not 100% sure that it'll do the trick so please let me now if it helped.

kyao-Frndz commented 6 years ago

hi @zawadz88, Sorry for the late response, I resolved it by calling StepperLayout#.setCurrentStepPosition(0) and setting static boolean variables to clear data already entered. Still looking a better way to handle it though.

I will give your suggestion a try and feedback.

Thanks a bunch.

sergio-27 commented 5 years ago

does it have support for android x?

Nilpo commented 5 months ago

does it have support for android x?

It's trivial to migrate it. Android Studio will probably do it for you with the migrate command.