Skip to content

Commit e6cee02

Browse files
stelianzawadz88
authored andcommitted
Update README.md with OnCompleteClickedCallback
1 parent 8b33cf8 commit e6cee02

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ In order to set that color:
210210

211211
### Make an IO operation before going to the next step (optional)
212212
If the user wants to e.g. save something in the database or make a network call on a separate Thread after clicking on the Next button
213-
he can perform these operations and then invoke the `goToNextStep()` method of the `StepperLayout.OnNextClickedCallback` in the current Step.
213+
he can perform these operations and then invoke the `goToNextStep()` method of the `StepperLayout.OnNextClickedCallback` in the current Step. If the user wants to perform
214+
the blocking operations on the final step, when clicking on the Complete button, he needs to invoke the `complete()` method of the `StepperLayout.OnCompleteClickedCallback`.
214215
While operations are performed, and the user would like to go back you can cancel them and then invoke `onBackClicked()` method of the `StepperLayout.OnBackClickedCallback`.
215216
<p><img src ="./gifs/delayed-transition.gif" width="360" height="640"/></p>
216217
The fragment must implement `BlockingStep` instead of `Step`.
@@ -234,6 +235,17 @@ public class DelayedTransitionStepFragmentSample extends Fragment implements Blo
234235
}, 2000L);
235236
}
236237

238+
@Override
239+
@UiThread
240+
public void onCompleteClicked(final StepperLayout.OnCompleteClickedCallback callback) {
241+
new Handler().postDelayed(new Runnable() {
242+
@Override
243+
public void run() {
244+
callback.complete();
245+
}
246+
}, 2000L);
247+
}
248+
237249
@Override
238250
@UiThread
239251
public void onBackClicked(StepperLayout.OnBackClickedCallback callback) {

0 commit comments

Comments
 (0)