Skip to content

Commit 65030c6

Browse files
Piotr Zawadzkizawadz88
authored andcommitted
- Updated version to 3.1.0
- Extended the description for when to use a BlockingStep
1 parent e6cee02 commit 65030c6

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

README.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Quoting the [documentation](https://www.google.com/design/spec/components/steppe
1313
1414
## Download (from JCenter)
1515
```groovy
16-
compile 'com.stepstone.stepper:material-stepper:3.0.0'
16+
compile 'com.stepstone.stepper:material-stepper:3.1.0'
1717
```
1818

1919
## Supported steppers
@@ -181,16 +181,17 @@ In order to set that color:
181181

182182
1. Create a new color selector in `res/color`
183183

184-
```xml
184+
```xml
185185
<?xml version="1.0" encoding="utf-8"?>
186186
<selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
187187
<item app:state_verification_failed="true" android:color="#30BDBDBD"/>
188188
<item android:color="@color/ms_white"/>
189189
</selector>
190-
```
190+
```
191+
191192
2. Change button's (text) color in layout file
192193

193-
```xml
194+
```xml
194195
<?xml version="1.0" encoding="utf-8"?>
195196
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
196197
xmlns:app="http://schemas.android.com/apk/res-auto"
@@ -200,23 +201,28 @@ In order to set that color:
200201
app:ms_stepperType="dots"
201202
app:ms_nextButtonColor="@color/ms_custom_button_text_color"
202203
app:ms_completeButtonColor="@color/ms_custom_button_text_color" />
203-
```
204+
```
205+
204206
3. Toggle the state in code
205207

206-
```java
208+
```java
207209
mStepperLayout.setNextButtonVerificationFailed(!enabled);
208210
mStepperLayout.setCompleteButtonVerificationFailed(!enabled);
209-
```
211+
```
210212

211-
### Make an IO operation before going to the next step (optional)
212-
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. 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`.
213+
### Make extra operations before going to the next step (optional)
214+
After clicking on the Next button if the user wants to e.g.:
215+
* save something in the database
216+
* make a network call on a separate Thread
217+
* simply save the data from the current step to some other component or parent Activity
218+
219+
he can perform these operations and then invoke the `goToNextStep()` method of the `StepperLayout.OnNextClickedCallback` in the current Step.
220+
If the user wants to perform these operations on the final step, when clicking on the Complete button, he needs to invoke the `complete()` method of the `StepperLayout.OnCompleteClickedCallback`.
215221
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`.
216222
<p><img src ="./gifs/delayed-transition.gif" width="360" height="640"/></p>
217-
The fragment must implement `BlockingStep` instead of `Step`.
218-
Also, make sure that `goToNextStep()` gets called on the main thread.
219-
**Note:** the `onNextClicked(StepperLayout.OnNextClickedCallback)` method gets invoked after step verification.
223+
To do so the fragment/view must implement `BlockingStep` instead of `Step`.
224+
Also, make sure that `goToNextStep()` and/or `complete()` get called on the main thread.
225+
**Note:** `onNextClicked(StepperLayout.OnNextClickedCallback)` and ``onCompleteClicked(StepperLayout.OnCompleteClickedCallback)`` methods get invoked after step verification.
220226
E.g.:
221227

222228
```java
@@ -262,6 +268,7 @@ but display 'Summary' just before the last page.
262268
You might also want to use your custom icons instead of the default navigation button compound drawables or not show the compound drawables for some of the buttons.
263269
<p><img src ="./gifs/custom-navigation-buttons.gif" width="360" height="640"/></p>
264270
In such case you need to override the `getViewModel(int)` method from the `StepAdapter` e.g.
271+
265272
```java
266273
@NonNull
267274
@Override

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919

2020
POM_GROUP_ID=com.stepstone.stepper
2121
POM_ARTIFACT_ID=material-stepper
22-
POM_VERSION=3.0.0
22+
POM_VERSION=3.1.0

0 commit comments

Comments
 (0)