|
@@ -211,4 +211,89 @@ If you'd like to use a custom font, you'll first have to edit your project.
|
211
|
211
|
|
212
|
212
|
* iOS - follow this [guide](https://medium.com/@dabit3/adding-custom-fonts-to-react-native-b266b41bff7f)
|
213
|
213
|
|
214
|
|
-All supported styles are defined [here](https://github.com/wix/react-native-controllers#styling-navigation). There's also an example project there showcasing all the different styles.
|
|
214
|
+## Customizing screen animations
|
|
215
|
+Animation used for navigation commands that modify the layout hierarchy can be controlled in options. Animations can be modified per command and it's also possible to change the default animation for each command.
|
|
216
|
+
|
|
217
|
+## Animation properties
|
|
218
|
+
|
|
219
|
+The following properties can be animated:
|
|
220
|
+* x
|
|
221
|
+* y
|
|
222
|
+* alpha
|
|
223
|
+* scaleX
|
|
224
|
+* scaleY
|
|
225
|
+* rotationX
|
|
226
|
+* rotationY
|
|
227
|
+* rotation
|
|
228
|
+
|
|
229
|
+```js
|
|
230
|
+{
|
|
231
|
+ from: 0, // Mandatory, initial value
|
|
232
|
+ to: 1, // Mandatory, end value
|
|
233
|
+ duration: 400, // Default value is 300 ms
|
|
234
|
+ startDelay: 100, // Default value is 0
|
|
235
|
+ interpolation: 'accelerate' | 'decelerate' // Optional
|
|
236
|
+}
|
|
237
|
+```
|
|
238
|
+
|
|
239
|
+For example, changing the animation used when the app is first launched:
|
|
240
|
+```js
|
|
241
|
+Navigation.setDefaultOptions({
|
|
242
|
+ animations: {
|
|
243
|
+ startApp: {
|
|
244
|
+ y: {
|
|
245
|
+ from: 1000,
|
|
246
|
+ to: 0,
|
|
247
|
+ duration: 500,
|
|
248
|
+ interpolation: 'accelerate',
|
|
249
|
+ },
|
|
250
|
+ alpha: {
|
|
251
|
+ from: 0,
|
|
252
|
+ to: 1,
|
|
253
|
+ duration: 400,
|
|
254
|
+ startDelay: 100,
|
|
255
|
+ interpolation: 'accelerate'
|
|
256
|
+ }
|
|
257
|
+ }
|
|
258
|
+ }
|
|
259
|
+});
|
|
260
|
+```
|
|
261
|
+
|
|
262
|
+## Customizing navigation commands animation
|
|
263
|
+
|
|
264
|
+Animations for the following set of commands can be customized
|
|
265
|
+* startApp
|
|
266
|
+* push
|
|
267
|
+* pop
|
|
268
|
+* showModal
|
|
269
|
+* dismissModal
|
|
270
|
+
|
|
271
|
+## Customizing stack command animation
|
|
272
|
+
|
|
273
|
+When *pushing* and *popping* screens to and from a stack, you can control the TopBar, BottomTabs and actual content animations as separately.
|
|
274
|
+
|
|
275
|
+```js
|
|
276
|
+animations: {
|
|
277
|
+ push: {
|
|
278
|
+ topBar: {
|
|
279
|
+ id: 'TEST', // Optional, id of the TopBar we'd like to animate.
|
|
280
|
+ alpha: {
|
|
281
|
+ from: 0,
|
|
282
|
+ to: 1
|
|
283
|
+ }
|
|
284
|
+ },
|
|
285
|
+ bottomTabs: {
|
|
286
|
+ alpha: {
|
|
287
|
+ from: 0,
|
|
288
|
+ to: 1
|
|
289
|
+ }
|
|
290
|
+ },
|
|
291
|
+ content: {
|
|
292
|
+ alpha: {
|
|
293
|
+ from: 0,
|
|
294
|
+ to: 1
|
|
295
|
+ }
|
|
296
|
+ }
|
|
297
|
+ }
|
|
298
|
+}
|
|
299
|
+```
|