|
@@ -0,0 +1,35 @@
|
|
1
|
+# Animations
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+## Shared element
|
|
5
|
+In order to animate shared element between two screens you need to wrap your element with `Navigation.Element` in both screens with different `elementId`.
|
|
6
|
+For example, to animate `Image` element wrap it in your first screen like this:
|
|
7
|
+```jsx
|
|
8
|
+<Navigation.Element elementId='image1'>
|
|
9
|
+ <Image source={require('img/icon.png')} />
|
|
10
|
+</Navigation.Element>
|
|
11
|
+```
|
|
12
|
+
|
|
13
|
+And in your second screen:
|
|
14
|
+```jsx
|
|
15
|
+<Navigation.Element elementId='image2'>
|
|
16
|
+ <Image source={require('img/icon.png')} />
|
|
17
|
+</Navigation.Element>
|
|
18
|
+```
|
|
19
|
+
|
|
20
|
+Then call `push` or `showModal` with `customTransition.animations` options:
|
|
21
|
+```js
|
|
22
|
+Navigation.push(this.props.componentId, {
|
|
23
|
+ component: {
|
|
24
|
+ name: 'second.screen',
|
|
25
|
+ options: {
|
|
26
|
+ customTransition: {
|
|
27
|
+ animations: [
|
|
28
|
+ { type: 'sharedElement', fromId: 'image1', toId: 'image2', startDelay: 0, springVelocity: 0.2, duration: 0.5 }
|
|
29
|
+ ],
|
|
30
|
+ duration: 0.8
|
|
31
|
+ }
|
|
32
|
+ }
|
|
33
|
+ }
|
|
34
|
+});
|
|
35
|
+```
|