File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,34 @@ export function fromLeft(duration = 300) {
27
27
} ;
28
28
}
29
29
30
+ export function fromRight ( duration = 300 ) {
31
+ return {
32
+ transitionSpec : {
33
+ duration,
34
+ easing : Easing . out ( Easing . poly ( 4 ) ) ,
35
+ timing : Animated . timing ,
36
+ useNativeDriver : true
37
+ } ,
38
+ screenInterpolator : ( { layout, position, scene } ) => {
39
+ const { index } = scene
40
+ const { initWidth } = layout
41
+
42
+ const translateX = position . interpolate ( {
43
+ inputRange : [ index - 1 , index , index + 1 ] ,
44
+ outputRange : [ initWidth , 0 , 0 ]
45
+ } )
46
+
47
+ const opacity = position . interpolate ( {
48
+ inputRange : [ index - 1 , index - 0.99 , index ] ,
49
+ outputRange : [ 0 , 0 , 1 ]
50
+ } )
51
+
52
+ return { opacity, transform : [ { translateX } ] }
53
+ }
54
+ }
55
+ }
56
+
57
+
30
58
export function fromTop ( duration = 300 ) {
31
59
return {
32
60
transitionSpec : {
You can’t perform that action at this time.
0 commit comments