You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- embedding the stepper anywhere in the view hierarchy and changing the stepper type for various device configurations, e.g. phone/tablet, portrait/landscape
31
31
- step validation
32
32
- use with Fragments or Views
33
+
- showing errors in tabs
34
+
- showing stepper feedback for ongoing operations (see [Stepper feedback](https://material.io/guidelines/components/steppers.html#steppers-types-of-steppers))
33
35
34
36
## Getting started
35
37
@@ -341,10 +343,60 @@ For an example of how to use it with views please see the sample app.
341
343
342
344
### Showing an error on tabs if step verification failed
343
345
To show an error in the tabbed stepper if step verification fails you need to set `ms_showErrorStateEnabled` attribute to `true`.
If you want to keep the error displayed when going back to the previous step you need to also set `ms_showErrorStateOnBackEnabled` to `true`.
347
349
350
+
### Stepper feedback
351
+
It is possible to show stepper feedback for ongoing operations (see [Stepper feedback](https://material.io/guidelines/components/steppers.html#steppers-types-of-steppers)).
352
+
To do so you firstly need to set ```ms_stepperFeedbackType``` to one or more of:
353
+
*```tabs``` - shows a progress message instead of the tabs during operation,
354
+
*```content``` - shows a progress bar on top of the steps' content and partially fades the content out during operation,
355
+
*```disabled_bottom_navigation``` - disables the buttons in the bottom navigation during operation.
356
+
The default is ```none``` which does nothing. It is possible to use multiple flags together.
357
+
358
+
After setting this to show the feedback you need to call ```StepperLayout#showProgress(@NonNull String progressMessage)```
359
+
and do hide the progress indicator you need to call ```StepperLayout#hideProgress()```.
callback.getStepperLayout().showProgress("Operation in progress, please wait...");
387
+
newHandler().postDelayed(newRunnable() {
388
+
@Override
389
+
publicvoidrun() {
390
+
callback.goToNextStep();
391
+
callback.getStepperLayout().hideProgress();
392
+
}
393
+
}, 2000L);
394
+
}
395
+
396
+
//...
397
+
398
+
```
399
+
348
400
### Custom styling
349
401
Basic styling can be done by choosing the active and inactive step colors.
350
402
There are some additional properties which can be changed directly from StepperLayout's attributes e.g. the background of bottom navigation buttons (see <a href="#stepperlayout-attributes">StepperLayout attributes</a>)
@@ -356,28 +408,29 @@ See 'Custom StepperLayout theme' in the sample app for an example.
356
408
For other examples, e.g. persisting state on rotation, displaying errors, changing whether the user can go to the next step, etc. check out the sample app.
|*ms_backButtonText*| string or reference | BACK button's text |
372
-
|*ms_nextButtonText*| string or reference | NEXT button's text |
373
-
|*ms_completeButtonText*| string or reference | COMPLETE button's text |
374
-
|*ms_tabStepDividerWidth*| dimension or reference | The width of the horizontal tab divider used in tabs stepper type |
375
-
|*ms_showBackButtonOnFirstStep*| boolean | Flag indicating if the Back (Previous step) button should be shown on the first step. False by default. |
376
-
|*ms_errorColor*| color or reference | Error color in Tabs stepper |
377
-
|*ms_showErrorStateEnabled*| boolean | Flag indicating whether to show the error state. Only applicable for 'tabs' type. False by default. |
378
-
|*ms_showErrorStateOnBackEnabled*| boolean | Flag indicating whether to keep showing the error state when user moves back. Only applicable for 'tabs' type. False by default. |
379
-
|*ms_tabNavigationEnabled*| boolean | Flag indicating whether step navigation is possible by clicking on the tabs directly. Only applicable for 'tabs' type. True by default. |
380
-
|*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. |
|*ms_backButtonText*| string or reference |BACK button's text |
424
+
| *ms_nextButtonText* | string or reference | NEXT button's text |
425
+
|*ms_completeButtonText*| string or reference |COMPLETE button's text |
426
+
| *ms_tabStepDividerWidth* | dimension or reference | The width of the horizontal tab divider used in tabs stepper type |
427
+
| *ms_showBackButtonOnFirstStep* | boolean | Flag indicating if the Back (Previous step) button should be shown on the first step. False by default. |
428
+
| *ms_errorColor* | color or reference | Error color in Tabs stepper |
429
+
| *ms_showErrorStateEnabled* | boolean | Flag indicating whether to show the error state. Only applicable for 'tabs' type. False by default. |
430
+
| *ms_showErrorStateOnBackEnabled*| boolean | Flag indicating whether to keep showing the error state when user moves back. Only applicable for 'tabs' type. False by default. |
431
+
| *ms_tabNavigationEnabled* | boolean | Flag indicating whether step navigation is possible by clicking on the tabs directly. Only applicable for 'tabs' type. True by default. |
432
+
| *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`.|
433
+
| *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. |
381
434
382
435
### StepperLayout style attributes
383
436
A list of `ms_stepperLayoutTheme` attributes responsible for styling of StepperLayout's child views.
@@ -390,8 +443,10 @@ A list of `ms_stepperLayoutTheme` attributes responsible for styling of StepperL
390
443
|*ms_nextNavigationButtonStyle*|Used by ms_stepNextButton in layout/ms_stepper_layout |
391
444
|*ms_completeNavigationButtonStyle*|Used by ms_stepCompleteButton in layout/ms_stepper_layout |
392
445
|*ms_colorableProgressBarStyle*|Used by ms_stepProgressBar in layout/ms_stepper_layout |
446
+
|*ms_stepPagerProgressBarStyle*|Used by ms_stepPagerProgressBar in layout/ms_stepper_layout |
393
447
|*ms_stepTabsScrollViewStyle*|Used by ms_stepTabsScrollView in layout/ms_tabs_container |
394
448
|*ms_stepTabsInnerContainerStyle*|Used by ms_stepTabsInnerContainer in layout/ms_tabs_container |
449
+
|*ms_stepTabsProgressMessageStyle*|Used by ms_stepTabsProgressMessage in layout/ms_tabs_container|
395
450
|*ms_stepTabContainerStyle*|Used in layout/ms_step_tab_container |
396
451
|*ms_stepTabNumberStyle*|Used by ms_stepNumber in layout/ms_step_tab |
397
452
|*ms_stepTabDoneIndicatorStyle*|Used by ms_stepDoneIndicator in layout/ms_step_tab |
0 commit comments