stepstone-tech / android-material-stepper

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

call goToNextStep() in fragment button click listener - question #230

Closed mrzslr closed 6 years ago

mrzslr commented 6 years ago

is there any way to call goToNextStep() in button click listener in the fragment?

fragment onCreateView

 btnSelect.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

              // how can I call goToNextStep() here ?

            }
        });
zawadz88 commented 6 years ago

Hi, Yes, you can do it. Please see the sample: https://github.com/stepstone-tech/android-material-stepper/blob/master/sample/src/main/java/com/stepstone/stepper/sample/ProceedProgrammaticallyActivity.kt and https://github.com/stepstone-tech/android-material-stepper/blob/master/sample/src/main/java/com/stepstone/stepper/sample/step/fragment/FormStepFragment.kt

mrzslr commented 6 years ago

there is no implements for OnProceedListener in StepperLayout.

zawadz88 commented 6 years ago

Hi @mohammadreza, OnProceedListener is actually an interface defined in the sample app and implemented by https://github.com/stepstone-tech/android-material-stepper/blob/master/sample/src/main/java/com/stepstone/stepper/sample/ProceedProgrammaticallyActivity.kt in the sample app.