stepstone-tech / android-material-stepper

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

invoke within a fragmet onNextClicked ? #233

Closed aymenhs closed 6 years ago

aymenhs commented 6 years ago

I check some answers but didn't find how to invoke from a Fragment the onNextClicked if a user make a selection for example. No need that he pushed the button next . Is it possible?

my fragment: public class OneFragmentCreation extends Fragment implements BlockingStep { ...

=>>> for the stepper to go to next step

@Override public void onNextClicked(final StepperLayout.OnNextClickedCallback callback) { ...} }

thanks

zawadz88 commented 6 years ago

Hi @aymenhs, It is possible. Please see the Fragment https://github.com/stepstone-tech/android-material-stepper/blob/master/sample/src/main/java/com/stepstone/stepper/sample/step/fragment/FormStepFragment.kt and the containing Activity https://github.com/stepstone-tech/android-material-stepper/blob/master/sample/src/main/java/com/stepstone/stepper/sample/ProceedProgrammaticallyActivity.kt There is a method in StepperLayout called proceed() which you can use.

aymenhs commented 6 years ago

thank you very much it works fine !