()
| 6 | const {height, width} = Dimensions.get('window'); |
| 7 | |
| 8 | export const initializeAnimations = () => { |
| 9 | // Since react-native-animatable applies by default a margin of 100 to its |
| 10 | // sliding animation, we reset them here overriding the margin to 0. |
| 11 | const animationDefinitions: Record<string, CustomAnimation> = { |
| 12 | slideInDown: makeSlideTranslation('translateY', -height, 0), |
| 13 | slideInUp: makeSlideTranslation('translateY', height, 0), |
| 14 | slideInLeft: makeSlideTranslation('translateX', -width, 0), |
| 15 | slideInRight: makeSlideTranslation('translateX', width, 0), |
| 16 | slideOutDown: makeSlideTranslation('translateY', 0, height), |
| 17 | slideOutUp: makeSlideTranslation('translateY', 0, -height), |
| 18 | slideOutLeft: makeSlideTranslation('translateX', 0, -width), |
| 19 | slideOutRight: makeSlideTranslation('translateX', 0, width), |
| 20 | }; |
| 21 | |
| 22 | animatable.initializeRegistryWithDefinitions(animationDefinitions); |
| 23 | }; |
| 24 | |
| 25 | export const makeSlideTranslation = ( |
| 26 | translationType: string, |
no test coverage detected
searching dependent graphs…