Pārlūkot izejas kodu

Document Snackbar

Guy Carmeli 7 gadus atpakaļ
vecāks
revīzija
ec90050ee4
1 mainītis faili ar 15 papildinājumiem un 0 dzēšanām
  1. 15
    0
      docs/android-specific-use-cases.md

+ 15
- 0
docs/android-specific-use-cases.md Parādīt failu

@@ -70,6 +70,21 @@ public class MyApplication extends NavigationApplication {
70 70
 ## Splash screen
71 71
 Override `getSplashLayout` or `createSplashLayout` in `MainActivity` to provide a splash layout which will be displayed while Js context initialises.
72 72
 
73
+## Snackbar
74
+Snackbars provide lightweight feedback about an operation. They show a brief message at the bottom of the screen. Snackbars appear above all other elements on screen and only one can be displayed at a time.
75
+
76
+```js
77
+this.props.navigator.showSnackbar({
78
+  text: 'Hello from Snackbar',
79
+  actionText: 'done', // optional
80
+  actionId: 'fabClicked', // Mandatory if you've set actionText
81
+  actionColor: 'green', // optional
82
+  textColor: 'red', // optional
83
+  backgroundColor: 'blue', // optional
84
+  duration: 'indefinite' // default is `short`. Available options: short, long, indefinite
85
+});
86
+```
87
+
73 88
 ## Collapsing React header
74 89
 A screen can have a header, either an image or a react component, that collapses as the screen is scrolled.
75 90