Skip to content

Commit 6664a84

Browse files
authored
Merge pull request #170 from stepstone-tech/develop
Release 4.0.0
2 parents 2007d5b + 51f9dfd commit 6664a84

File tree

65 files changed

+2105
-347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2105
-347
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6+
7+
## [4.0.0]
8+
### Added
9+
- `setEndButtonVisible` and `setBackButtonVisible` methods in `StepViewModel.Builder` for toggling button visibility (issue #104)
10+
- New stepper type `none` which shows no progress indicator for the steps (issue #154)
11+
- New stepper feedback type `disabled_content_interaction` which intercepts touch events on the steps' content and ignores them during operation.
12+
- New stepper feedback type `content_overlay` which shows a dimmed overlay over the content.
13+
- An option to specify the background drawable for `content_overlay` stepper feedback type via `ms_stepperFeedback_contentOverlayBackground`.
14+
- An option to specify the fade out alpha for `content_fade` stepper feedback type via `ms_stepperFeedback_contentFadeAlpha` attribute.
15+
16+
### Changed
17+
- **Breaking change:** Updated Android Support Library version to `25.4.0` to support vector animations without a pre-Lollipop fallback (issue #154)
18+
- **Breaking change:** Changed `setNextButtonLabel` methods in `StepViewModel.Builder` to `setEndButtonLabel` so that it works for both Next and Complete buttons (issue #107)
19+
- **Breaking change:** Split `content` stepper feedback type into `content_progress` and `content_fade`.
20+
21+
[4.0.0]: https://github.com/stepstone-tech/android-material-stepper/compare/v3.3.0...4.0.0

README.md

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,24 @@ Moreover, you can find there other examples, e.g. how to persist state on rotati
3131
- [StepperLayout attributes](#stepperlayout-attributes)
3232
- [View attributes](#view-attributes)
3333
- [StepperLayout style attributes](#stepperlayout-style-attributes)
34+
- [Changelog](#changelog)
3435
- [License](#license)
3536

3637
## Supported steppers
3738

3839
### Mobile stepper with dots <br/>
39-
<img src ="./gifs/dotted-progress-bar.gif" width="360" height="640"/>&nbsp;&nbsp;<img src ="./gifs/dotted-progress-bar-styled.gif" width="360" height="640"/>
40+
<img src ="./gifs/dotted-progress-bar.gif" width="360" />&nbsp;&nbsp;<img src ="./gifs/dotted-progress-bar-styled.gif" width="360" />
4041

4142
### Mobile stepper with progress bar <br/>
42-
<img src ="./gifs/linear-progress-bar.gif" width="360" height="640"/>&nbsp;&nbsp;<img src ="./gifs/linear-progress-bar-styled.gif" width="360" height="640"/>
43+
<img src ="./gifs/linear-progress-bar.gif" width="360" />&nbsp;&nbsp;<img src ="./gifs/linear-progress-bar-styled.gif" width="360" />
44+
45+
### Mobile stepper without a progress indicator <br/>
46+
<img src ="./gifs/none.gif" width="360" />
47+
4348
### Horizontal stepper <br/>
44-
<img src ="./gifs/tabs.gif" width="640" height="360"/>
45-
<img src ="./gifs/tabs-styled.gif" width="640" height="360"/>
49+
<img src ="./gifs/tabs.gif" width="640" />
50+
<img src ="./gifs/tabs-styled.gif" width="640" />
51+
4652

4753
## Supported features
4854
- color customisation of individual widgets inside of the stepper via View attributes or a style from a theme
@@ -57,7 +63,7 @@ Moreover, you can find there other examples, e.g. how to persist state on rotati
5763

5864
### Download (from JCenter)
5965
```groovy
60-
compile 'com.stepstone.stepper:material-stepper:3.3.0'
66+
compile 'com.stepstone.stepper:material-stepper:4.0.0'
6167
```
6268

6369
### Create layout in XML
@@ -207,7 +213,7 @@ After clicking on the Next button if the user wants to e.g.:
207213
he can perform these operations and then invoke the `goToNextStep()` method of the `StepperLayout.OnNextClickedCallback` in the current Step.
208214
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`.
209215
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`.
210-
<p><img src ="./gifs/delayed-transition.gif" width="360" height="640"/></p>
216+
<p><img src ="./gifs/delayed-transition.gif" width="360" /></p>
211217

212218
To do so the fragment/view must implement `BlockingStep` instead of `Step`.
213219
Also, make sure that `goToNextStep()` and/or `complete()` get called on the main thread.
@@ -252,10 +258,10 @@ public class DelayedTransitionStepFragmentSample extends Fragment implements Blo
252258
```
253259

254260
### Changing button labels & compound drawables per step
255-
Sometimes you might want to have different labels on the Next and/or Back navigation buttons on different steps e.g. use the default labels on the first few steps,
261+
Sometimes you might want to have different labels on the Next/Complete and/or Back navigation buttons on different steps e.g. use the default labels on the first few steps,
256262
but display 'Summary' just before the last page.
257263
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.
258-
<p><img src ="./gifs/custom-navigation-buttons.gif" width="360" height="640"/></p>
264+
<p><img src ="./gifs/custom-navigation-buttons.gif" width="360" /></p>
259265
In such case you need to override the `getViewModel(int)` method from the `StepAdapter` e.g.
260266

261267
```java
@@ -267,19 +273,21 @@ In such case you need to override the `getViewModel(int)` method from the `StepA
267273
switch (position) {
268274
case 0:
269275
builder
270-
.setNextButtonLabel("This way")
276+
.setEndButtonLabel("This way")
271277
.setBackButtonLabel("Cancel")
272278
.setNextButtonEndDrawableResId(R.drawable.ms_forward_arrow)
273279
.setBackButtonStartDrawableResId(StepViewModel.NULL_DRAWABLE);
274280
break;
275281
case 1:
276282
builder
277-
.setNextButtonLabel(R.string.go_to_summary)
283+
.setEndButtonLabel(R.string.go_to_summary)
278284
.setBackButtonLabel("Go to first")
279285
.setBackButtonStartDrawableResId(R.drawable.ms_back_arrow);
280286
break;
281287
case 2:
282-
builder.setBackButtonLabel("Go back");
288+
builder
289+
.setBackButtonLabel("Go back")
290+
.setEndButtonLabel("I'm done!");
283291
break;
284292
default:
285293
throw new IllegalArgumentException("Unsupported position: " + position);
@@ -288,14 +296,16 @@ In such case you need to override the `getViewModel(int)` method from the `StepA
288296
}
289297
```
290298

291-
NOTE: To change Complete button's label you need use `ms_completeButtonText` attribute from StepperLayout.
299+
It is also possible to hide Back/Next/Complete buttons on each step if needed.
300+
To do so you need to call `setBackButtonVisible(false)` and/or `setEndButtonVisible(false)` on
301+
`StepViewModel.Builder` in your adapter.
292302

293303
### Custom styling
294304
Basic styling can be done by choosing the active and inactive step colors.
295305
There are some additional properties which can be changed directly from StepperLayout's attributes e.g. the background of bottom navigation buttons (see [StepperLayout attributes](#stepperlayout-attributes))
296306
For advanced styling you can use `ms_stepperLayoutTheme` StepperLayout's attribute and provide your custom style to be used.
297307
See 'Custom StepperLayout theme' in the sample app for an example.
298-
<p><img src ="./gifs/custom-theme.gif" width="360" height="640"/></p>
308+
<p><img src ="./gifs/custom-theme.gif" width="360" /></p>
299309

300310
### Using same stepper styling across the application
301311
If you have many steppers in your application in different activities/fragments you might want to set a common style in a theme.
@@ -339,23 +349,26 @@ For an example of how to use it with views please see the sample app.
339349

340350
### Showing an error on tabs if step verification failed
341351
To show an error in the tabbed stepper if step verification fails you need to set `ms_showErrorStateEnabled` attribute to `true`.
342-
<p><img src ="./gifs/error-on-tabs.gif" width="640" height="360"/></p>
352+
<p><img src ="./gifs/error-on-tabs.gif" width="640" /></p>
343353

344354
If you want to keep the error displayed when going back to the previous step you need to also set `ms_showErrorStateOnBackEnabled` to `true`.
345355

346356
### Stepper feedback
347357
It is possible to show stepper feedback for ongoing operations (see [Stepper feedback](https://material.io/guidelines/components/steppers.html#steppers-types-of-steppers)).
348358
To do so you firstly need to set ```ms_stepperFeedbackType``` to one or more of:
349-
* ```tabs``` - shows a progress message instead of the tabs during operation,
350-
* ```content``` - shows a progress bar on top of the steps' content and partially fades the content out during operation,
359+
* ```tabs``` - shows a progress message instead of the tabs during operation.
360+
* ```content_progress``` - shows a progress bar on top of the steps' content.
361+
* ```content_fade``` - partially fades the content out during operation (should not be used together with ```content_overlay```). You can change the default fade amount with `ms_stepperFeedback_contentFadeAlpha` attribute.
362+
* ```content_overlay``` - shows a dimmed overlay over the content during the operation (should not be used together with ```content_fade```). You can change the overlay background with `ms_stepperFeedback_contentOverlayBackground` attribute.
351363
* ```disabled_bottom_navigation``` - disables the buttons in the bottom navigation during operation. In order to see that the buttons are disabled on the bottom navigation bar, make sure that the button colors are assigned using color selectors with a disabled state (see the sample app).
364+
* ```disabled_content_interaction``` - intercepts touch events on the steps' content and ignores them during operation.
352365

353366
The default is ```none``` which does nothing. It is possible to use multiple flags together.
354367

355368
After setting this to show the feedback you need to call ```StepperLayout#showProgress(@NonNull String progressMessage)```
356369
and do hide the progress indicator you need to call ```StepperLayout#hideProgress()```.
357370

358-
<p><img src ="./gifs/stepper-feedback.gif" width="640" height="360"/></p>
371+
<p><img src ="./gifs/stepper-feedback.gif" width="640" /></p>
359372

360373
E.g.
361374
In layout:
@@ -451,7 +464,7 @@ For advanced styling please see [StepperLayout style attributes](#stepperlayout-
451464

452465
| Attribute name | Format | Description |
453466
| --------------------------------|---------------------------------------------------------------------|-------------|
454-
| *ms_stepperType* | one of `dots`, `progress_bar` or `tabs` | **REQUIRED:** Type of the stepper |
467+
| *ms_stepperType* | one of `dots`, `progress_bar`, `tabs` or `none` | **REQUIRED:** Type of the stepper |
455468
| *ms_backButtonColor* | color or reference | BACK button's text color |
456469
| *ms_nextButtonColor* | color or reference | NEXT button's text color |
457470
| *ms_completeButtonColor* | color or reference | COMPLETE button's text color |
@@ -470,7 +483,9 @@ For advanced styling please see [StepperLayout style attributes](#stepperlayout-
470483
| *ms_showErrorStateEnabled* | boolean | Flag indicating whether to show the error state. Only applicable for 'tabs' type. False by default. |
471484
| *ms_showErrorStateOnBackEnabled*| boolean | Flag indicating whether to keep showing the error state when user moves back. Only applicable for 'tabs' type. False by default. |
472485
| *ms_tabNavigationEnabled* | boolean | Flag indicating whether step navigation is possible by clicking on the tabs directly. Only applicable for 'tabs' type. True by default. |
473-
| *ms_stepperFeedbackType* | flag(s): `none` or `tabs`, `content` & `disabled_bottom_navigation` | Type(s) of stepper feedback. Can be a combination of `tabs`, `content` & `disabled_bottom_navigation`. Default is `none`.|
486+
| *ms_stepperFeedbackType* | flag(s): `none` or `tabs`, `content_progress`, `content_fade`, `content_overlay`, `disabled_bottom_navigation` & `disabled_content_interaction` | Type(s) of stepper feedback. Can be a combination of `tabs`, `content_progress`, `content_fade`, `content_overlay`, `disabled_bottom_navigation` & `disabled_content_interaction`. Default is `none`.|
487+
| *ms_stepperFeedback_contentFadeAlpha* | float | An alpha value from 0 to 1.0f to be used for the faded out view if `content_fade` stepper feedback type is set. 0.5f by default. |
488+
| *ms_stepperFeedback_contentOverlayBackground* | reference | Background to be used for the overlay on top of the content if `content_overlay` stepper feedback type is set. |
474489
| *ms_showBottomNavigation* | boolean | Flag indicating if the Bottom Navigation bar should be shown on the layout. True by default. |
475490
| *ms_stepperLayoutTheme* | reference | Theme to use for even more custom styling of the stepper layout. It is recommended that it should extend @style/MSDefaultStepperLayoutTheme, which is the default theme used. |
476491
@@ -486,6 +501,7 @@ A list of `ms_stepperLayoutTheme` attributes responsible for styling of StepperL
486501
| *ms_completeNavigationButtonStyle*| Used by ms_stepCompleteButton in layout/ms_stepper_layout |
487502
| *ms_colorableProgressBarStyle* | Used by ms_stepProgressBar in layout/ms_stepper_layout |
488503
| *ms_stepPagerProgressBarStyle* | Used by ms_stepPagerProgressBar in layout/ms_stepper_layout |
504+
| *ms_stepPagerOverlayStyle* | Used by ms_stepPagerOverlay in layout/ms_stepper_layout |
489505
| *ms_stepTabsScrollViewStyle* | Used by ms_stepTabsScrollView in layout/ms_tabs_container |
490506
| *ms_stepTabsInnerContainerStyle* | Used by ms_stepTabsInnerContainer in layout/ms_tabs_container |
491507
| *ms_stepTabsProgressMessageStyle* | Used by ms_stepTabsProgressMessage in layout/ms_tabs_container|
@@ -495,7 +511,10 @@ A list of `ms_stepperLayoutTheme` attributes responsible for styling of StepperL
495511
| *ms_stepTabIconBackgroundStyle* | Used by ms_stepIconBackground in layout/ms_step_tab |
496512
| *ms_stepTabTitleStyle* | Used by ms_stepTitle in layout/ms_step_tab |
497513
| *ms_stepTabDividerStyle* | Used by ms_stepDivider in layout/ms_step_tab |
498-
514+
515+
## Changelog
516+
See [changelog](CHANGELOG.md)
517+
499518
## License
500519
Copyright 2016 StepStone Services
501520

build.gradle

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
buildscript {
2-
ext.gradleAndroidVersion = '2.3.2'
3-
ext.kotlinVersion = '1.1.2-3'
2+
ext.gradleAndroidVersion = '2.3.3'
3+
ext.kotlinVersion = '1.1.3-2'
44
ext.bintrayVersion = '1.4'
55
ext.mavenGradlePluginVersion = '1.4.1'
66

@@ -19,6 +19,9 @@ allprojects {
1919
repositories {
2020
jcenter()
2121
mavenCentral()
22+
maven {
23+
url "https://maven.google.com"
24+
}
2225
}
2326
}
2427

@@ -29,7 +32,7 @@ configure(allprojects) {
2932
androidTargetSdkVersion = 25
3033
androidCompileSdkVersion = 25
3134
androidBuildToolsVersion = '25.0.2'
32-
androidSupportLibraryVersion = '25.3.1'
35+
androidSupportLibraryVersion = '25.4.0'
3336

3437
junitVersion = '4.12'
3538
mockitoVersion = '2.7.21'

config/quality/quality.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ task findbugs(type: FindBugs,
5757
xml {
5858
destination "$reportsDir/findbugs/findbugs.xml"
5959
}
60-
html {
61-
destination "$reportsDir/findbugs/findbugs.html"
62-
}
6360
}
6461

6562
classpath = files()

gifs/none.gif

1.41 MB
Loading

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.3.0
22+
POM_VERSION=4.0.0

0 commit comments

Comments
 (0)