|
@@ -1,9 +1,13 @@
|
1
|
1
|
const { Navigation } = require('react-native-navigation');
|
2
|
2
|
const Colors = require('./Colors');
|
3
|
|
-const { Dimensions, PixelRatio } = require('react-native');
|
|
3
|
+const { Dimensions } = require('react-native');
|
4
|
4
|
const height = Math.round(Dimensions.get('window').height) * 0.7;
|
5
|
|
-const { useSlowOpenScreenAnimations } = require('../flags');
|
6
|
|
-const SHOW_DURATION = 230 * 8;
|
|
5
|
+const width = Math.round(Dimensions.get('window').width);
|
|
6
|
+const {
|
|
7
|
+ useSlowOpenScreenAnimations,
|
|
8
|
+ useSlideAnimation: useSlideAnimation
|
|
9
|
+} = require('../flags');
|
|
10
|
+const SHOW_DURATION = 230 * 3;
|
7
|
11
|
|
8
|
12
|
const setDefaultOptions = () => Navigation.setDefaultOptions({
|
9
|
13
|
layout: {
|
|
@@ -19,11 +23,47 @@ const setDefaultOptions = () => Navigation.setDefaultOptions({
|
19
|
23
|
selectedTextColor: Colors.primary
|
20
|
24
|
},
|
21
|
25
|
animations: {
|
22
|
|
- ...useSlowOpenScreenAnimations ? slowOpenScreenAnimations : {}
|
|
26
|
+ ...useSlideAnimation ?
|
|
27
|
+ slideAnimations :
|
|
28
|
+ useSlowOpenScreenAnimations ?
|
|
29
|
+ slowOpenScreenAnimations :
|
|
30
|
+ {}
|
23
|
31
|
},
|
24
|
32
|
modalPresentationStyle: 'fullScreen'
|
25
|
33
|
});
|
26
|
34
|
|
|
35
|
+const slideAnimations = {
|
|
36
|
+ push: {
|
|
37
|
+ waitForRender: true,
|
|
38
|
+ content: {
|
|
39
|
+ translationX: {
|
|
40
|
+ from: width,
|
|
41
|
+ to: 0,
|
|
42
|
+ duration: useSlowOpenScreenAnimations ? SHOW_DURATION : 300
|
|
43
|
+ },
|
|
44
|
+ alpha: {
|
|
45
|
+ from: 0.7,
|
|
46
|
+ to: 1,
|
|
47
|
+ duration: useSlowOpenScreenAnimations ? SHOW_DURATION : 300
|
|
48
|
+ }
|
|
49
|
+ }
|
|
50
|
+ },
|
|
51
|
+ pop: {
|
|
52
|
+ content: {
|
|
53
|
+ translationX: {
|
|
54
|
+ from: 0,
|
|
55
|
+ to: width,
|
|
56
|
+ duration: useSlowOpenScreenAnimations ? SHOW_DURATION : 300
|
|
57
|
+ },
|
|
58
|
+ alpha: {
|
|
59
|
+ from: 1,
|
|
60
|
+ to: 0.3,
|
|
61
|
+ duration: useSlowOpenScreenAnimations ? SHOW_DURATION : 300
|
|
62
|
+ }
|
|
63
|
+ }
|
|
64
|
+ }
|
|
65
|
+}
|
|
66
|
+
|
27
|
67
|
const slowOpenScreenAnimations = {
|
28
|
68
|
showModal: {
|
29
|
69
|
waitForRender: true,
|