react-native-reanimated 2.3.0-alpha.3 → 2.3.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp +15 -8
  2. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +176 -154
  3. package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +49 -33
  4. package/Common/cpp/Registries/EventHandlerRegistry.cpp +14 -7
  5. package/Common/cpp/Registries/MapperRegistry.cpp +24 -20
  6. package/Common/cpp/Registries/WorkletsCache.cpp +19 -9
  7. package/Common/cpp/SharedItems/FrozenObject.cpp +17 -8
  8. package/Common/cpp/SharedItems/MutableValue.cpp +38 -25
  9. package/Common/cpp/SharedItems/MutableValueSetterProxy.cpp +11 -7
  10. package/Common/cpp/SharedItems/RemoteObject.cpp +9 -5
  11. package/Common/cpp/SharedItems/ShareableValue.cpp +211 -160
  12. package/Common/cpp/Tools/FeaturesConfig.cpp +5 -0
  13. package/Common/cpp/Tools/JSIStoreValueUser.cpp +25 -6
  14. package/Common/cpp/Tools/Mapper.cpp +30 -30
  15. package/Common/cpp/Tools/RuntimeDecorator.cpp +124 -86
  16. package/Common/cpp/Tools/Scheduler.cpp +6 -5
  17. package/Common/cpp/Tools/WorkletEventHandler.cpp +4 -2
  18. package/Common/cpp/headers/LayoutAnimations/LayoutAnimationsProxy.h +12 -11
  19. package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +50 -31
  20. package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +34 -16
  21. package/Common/cpp/headers/Registries/EventHandlerRegistry.h +15 -8
  22. package/Common/cpp/headers/Registries/MapperRegistry.h +5 -4
  23. package/Common/cpp/headers/Registries/WorkletsCache.h +9 -7
  24. package/Common/cpp/headers/SharedItems/FrozenObject.h +19 -11
  25. package/Common/cpp/headers/SharedItems/HostFunctionHandler.h +8 -4
  26. package/Common/cpp/headers/SharedItems/MutableValue.h +23 -12
  27. package/Common/cpp/headers/SharedItems/MutableValueSetterProxy.h +12 -7
  28. package/Common/cpp/headers/SharedItems/RemoteObject.h +19 -8
  29. package/Common/cpp/headers/SharedItems/RuntimeManager.h +26 -25
  30. package/Common/cpp/headers/SharedItems/ShareableValue.h +32 -27
  31. package/Common/cpp/headers/SharedItems/SharedParent.h +10 -7
  32. package/Common/cpp/headers/SharedItems/ValueWrapper.h +95 -72
  33. package/Common/cpp/headers/SpecTools/ErrorHandler.h +18 -19
  34. package/Common/cpp/headers/Tools/FeaturesConfig.h +19 -0
  35. package/Common/cpp/headers/Tools/JSIStoreValueUser.h +13 -16
  36. package/Common/cpp/headers/Tools/Mapper.h +19 -16
  37. package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +17 -7
  38. package/Common/cpp/headers/Tools/ReanimatedHiddenHeaders.h +7 -11
  39. package/Common/cpp/headers/Tools/RuntimeDecorator.h +36 -27
  40. package/Common/cpp/headers/Tools/Scheduler.h +30 -35
  41. package/Common/cpp/headers/Tools/WorkletEventHandler.h +11 -8
  42. package/Common/cpp/hidden_headers/Logger.h +14 -14
  43. package/Common/cpp/hidden_headers/LoggerInterface.h +8 -9
  44. package/Common/cpp/hidden_headers/SpeedChecker.h +7 -8
  45. package/README.md +1 -1
  46. package/RNReanimated.podspec +24 -6
  47. package/android/build.gradle +38 -29
  48. package/android/react-native-reanimated-63-hermes.aar +0 -0
  49. package/android/react-native-reanimated-63-jsc.aar +0 -0
  50. package/android/react-native-reanimated-64-hermes.aar +0 -0
  51. package/android/react-native-reanimated-64-jsc.aar +0 -0
  52. package/android/react-native-reanimated-65-hermes.aar +0 -0
  53. package/android/react-native-reanimated-65-jsc.aar +0 -0
  54. package/android/react-native-reanimated-66-hermes.aar +0 -0
  55. package/android/react-native-reanimated-66-jsc.aar +0 -0
  56. package/android/react-native-reanimated-67-hermes.aar +0 -0
  57. package/android/react-native-reanimated-67-jsc.aar +0 -0
  58. package/ios/LayoutReanimation/REAAnimationsManager.h +10 -8
  59. package/ios/LayoutReanimation/REAAnimationsManager.m +91 -87
  60. package/ios/LayoutReanimation/REASnapshot.h +2 -2
  61. package/ios/LayoutReanimation/REASnapshot.m +8 -7
  62. package/ios/LayoutReanimation/REAUIManager.h +4 -4
  63. package/ios/LayoutReanimation/REAUIManager.mm +116 -70
  64. package/ios/Nodes/REAAlwaysNode.m +14 -15
  65. package/ios/Nodes/REABezierNode.m +8 -7
  66. package/ios/Nodes/REABlockNode.m +1 -1
  67. package/ios/Nodes/REACallFuncNode.h +0 -1
  68. package/ios/Nodes/REACallFuncNode.m +10 -8
  69. package/ios/Nodes/REAClockNodes.m +22 -20
  70. package/ios/Nodes/REAConcatNode.h +0 -1
  71. package/ios/Nodes/REAConcatNode.m +2 -2
  72. package/ios/Nodes/REACondNode.m +7 -5
  73. package/ios/Nodes/READebugNode.m +5 -4
  74. package/ios/Nodes/REAEventNode.m +1 -1
  75. package/ios/Nodes/REAFunctionNode.h +0 -1
  76. package/ios/Nodes/REAFunctionNode.m +2 -2
  77. package/ios/Nodes/REAJSCallNode.m +4 -5
  78. package/ios/Nodes/REANode.h +3 -4
  79. package/ios/Nodes/REANode.m +9 -11
  80. package/ios/Nodes/REAOperatorNode.m +68 -67
  81. package/ios/Nodes/REAParamNode.h +1 -3
  82. package/ios/Nodes/REAParamNode.m +15 -17
  83. package/ios/Nodes/REAPropsNode.h +1 -3
  84. package/ios/Nodes/REAPropsNode.m +19 -22
  85. package/ios/Nodes/REASetNode.h +0 -1
  86. package/ios/Nodes/REASetNode.m +7 -5
  87. package/ios/Nodes/REAStyleNode.h +0 -1
  88. package/ios/Nodes/REAStyleNode.m +2 -4
  89. package/ios/Nodes/REATransformNode.h +0 -1
  90. package/ios/Nodes/REATransformNode.m +3 -5
  91. package/ios/Nodes/REAValueNode.m +5 -7
  92. package/ios/REAEventDispatcher.m +4 -4
  93. package/ios/REAModule.h +0 -2
  94. package/ios/REAModule.m +29 -38
  95. package/ios/REANodesManager.h +11 -19
  96. package/ios/REANodesManager.m +106 -130
  97. package/ios/REAUtils.h +5 -3
  98. package/ios/RNGestureHandlerStateManager.h +5 -0
  99. package/ios/Transitioning/RCTConvert+REATransition.m +45 -29
  100. package/ios/Transitioning/REAAllTransitions.h +2 -2
  101. package/ios/Transitioning/REAAllTransitions.m +14 -25
  102. package/ios/Transitioning/REATransition.h +8 -7
  103. package/ios/Transitioning/REATransition.m +19 -16
  104. package/ios/Transitioning/REATransitionAnimation.h +1 -1
  105. package/ios/Transitioning/REATransitionAnimation.m +2 -3
  106. package/ios/Transitioning/REATransitionManager.m +3 -3
  107. package/ios/native/NativeMethods.h +20 -5
  108. package/ios/native/NativeMethods.mm +14 -6
  109. package/ios/native/NativeProxy.h +4 -2
  110. package/ios/native/NativeProxy.mm +84 -63
  111. package/ios/native/REAIOSErrorHandler.h +13 -10
  112. package/ios/native/REAIOSErrorHandler.mm +19 -15
  113. package/ios/native/REAIOSLogger.h +8 -8
  114. package/ios/native/REAIOSLogger.mm +10 -6
  115. package/ios/native/REAIOSScheduler.h +5 -5
  116. package/ios/native/REAIOSScheduler.mm +17 -10
  117. package/ios/native/REAInitializer.h +5 -7
  118. package/ios/native/REAInitializer.mm +43 -31
  119. package/ios/native/UIResponder+Reanimated.mm +2 -2
  120. package/lib/Animated.js +9 -1
  121. package/lib/ConfigHelper.js +121 -138
  122. package/lib/ReanimatedEventEmitter.js +0 -1
  123. package/lib/ReanimatedModule.js +0 -1
  124. package/lib/ReanimatedModule.macos.js +0 -1
  125. package/lib/ReanimatedModule.native.js +5 -6
  126. package/lib/ReanimatedModule.windows.js +0 -1
  127. package/lib/ReanimatedModuleCompat.js +64 -35
  128. package/lib/createAnimatedComponent.js +468 -487
  129. package/lib/index.js +9 -1
  130. package/lib/reanimated2/NativeMethods.js +7 -12
  131. package/lib/reanimated2/NativeReanimated/NativeReanimated.js +37 -0
  132. package/lib/reanimated2/NativeReanimated/index.js +15 -0
  133. package/lib/reanimated2/PropAdapters.js +0 -1
  134. package/lib/reanimated2/UpdateProps.js +6 -7
  135. package/lib/reanimated2/ViewDescriptorsSet.js +4 -4
  136. package/lib/reanimated2/WorkletEventHandler.js +15 -13
  137. package/lib/reanimated2/animation/delay.js +8 -2
  138. package/lib/reanimated2/animation/spring.js +2 -0
  139. package/lib/reanimated2/animation/styleAnimation.js +7 -3
  140. package/lib/reanimated2/animation/util.js +25 -2
  141. package/lib/reanimated2/core.js +41 -17
  142. package/lib/reanimated2/globals.d.ts +21 -1
  143. package/lib/reanimated2/hook/useAnimatedRef.js +1 -1
  144. package/lib/reanimated2/hook/useAnimatedStyle.js +3 -3
  145. package/lib/reanimated2/index.js +1 -0
  146. package/lib/reanimated2/interpolation.js +95 -87
  147. package/lib/reanimated2/js-reanimated/JSReanimated.js +13 -10
  148. package/lib/reanimated2/js-reanimated/Mapper.js +4 -3
  149. package/lib/reanimated2/js-reanimated/MapperRegistry.js +3 -6
  150. package/lib/reanimated2/js-reanimated/MutableValue.js +0 -2
  151. package/lib/reanimated2/js-reanimated/index.js +10 -8
  152. package/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.js +33 -2
  153. package/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +27 -124
  154. package/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +125 -0
  155. package/lib/reanimated2/layoutReanimation/animationBuilder/index.js +1 -2
  156. package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +115 -45
  157. package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +7 -2
  158. package/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.js +21 -21
  159. package/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.js +25 -25
  160. package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +19 -17
  161. package/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +5 -5
  162. package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +9 -9
  163. package/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +17 -17
  164. package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +19 -19
  165. package/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +9 -9
  166. package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +33 -33
  167. package/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +78 -0
  168. package/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +128 -0
  169. package/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +37 -0
  170. package/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +41 -0
  171. package/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +34 -0
  172. package/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +46 -0
  173. package/lib/reanimated2/layoutReanimation/defaultTransitions/index.js +6 -0
  174. package/lib/reanimated2/layoutReanimation/index.js +1 -0
  175. package/lib/reanimated2/mock.js +3 -1
  176. package/lib/reanimated2/utils.js +9 -0
  177. package/lib/setAndForwardRef.js +14 -48
  178. package/libSo/fbjni/jni/arm64-v8a/libfbjni.so +0 -0
  179. package/libSo/fbjni/jni/armeabi-v7a/libfbjni.so +0 -0
  180. package/libSo/fbjni/jni/x86/libfbjni.so +0 -0
  181. package/libSo/fbjni/jni/x86_64/libfbjni.so +0 -0
  182. package/mock.js +1 -1
  183. package/package.json +28 -17
  184. package/plugin.js +220 -39
  185. package/react-native-reanimated.d.ts +542 -547
  186. package/src/Animated.js +9 -1
  187. package/src/{ConfigHelper.js → ConfigHelper.ts} +15 -7
  188. package/src/{ReanimatedEventEmitter.js → ReanimatedEventEmitter.ts} +0 -0
  189. package/src/{ReanimatedModule.js → ReanimatedModule.macos.ts} +0 -0
  190. package/src/{ReanimatedModule.native.js → ReanimatedModule.native.ts} +0 -0
  191. package/src/{ReanimatedModule.macos.js → ReanimatedModule.ts} +0 -0
  192. package/src/{ReanimatedModule.windows.js → ReanimatedModule.windows.ts} +0 -0
  193. package/src/ReanimatedModuleCompat.ts +51 -0
  194. package/src/{createAnimatedComponent.js → createAnimatedComponent.tsx} +285 -126
  195. package/src/reanimated2/NativeMethods.ts +34 -13
  196. package/src/reanimated2/NativeReanimated/NativeReanimated.ts +72 -0
  197. package/src/reanimated2/NativeReanimated/index.ts +18 -0
  198. package/src/reanimated2/PropAdapters.ts +0 -1
  199. package/src/reanimated2/UpdateProps.ts +31 -15
  200. package/src/reanimated2/ViewDescriptorsSet.ts +15 -12
  201. package/src/reanimated2/WorkletEventHandler.ts +41 -23
  202. package/src/reanimated2/animation/commonTypes.ts +4 -4
  203. package/src/reanimated2/animation/decay.ts +2 -2
  204. package/src/reanimated2/animation/delay.ts +11 -5
  205. package/src/reanimated2/animation/index.ts +7 -7
  206. package/src/reanimated2/animation/repeat.ts +4 -4
  207. package/src/reanimated2/animation/sequence.ts +2 -2
  208. package/src/reanimated2/animation/spring.ts +6 -5
  209. package/src/reanimated2/animation/styleAnimation.ts +27 -15
  210. package/src/reanimated2/animation/timing.ts +5 -5
  211. package/src/reanimated2/animation/util.ts +47 -8
  212. package/src/reanimated2/commonTypes.ts +3 -0
  213. package/src/reanimated2/core.ts +80 -34
  214. package/src/reanimated2/globals.d.ts +21 -1
  215. package/src/reanimated2/hook/useAnimatedGestureHandler.ts +1 -1
  216. package/src/reanimated2/hook/useAnimatedRef.ts +13 -15
  217. package/src/reanimated2/hook/useAnimatedScrollHandler.ts +3 -3
  218. package/src/reanimated2/hook/useAnimatedStyle.ts +7 -7
  219. package/src/reanimated2/hook/utils.ts +4 -3
  220. package/src/reanimated2/index.ts +1 -0
  221. package/src/reanimated2/interpolation.ts +170 -103
  222. package/src/reanimated2/js-reanimated/JSReanimated.ts +37 -23
  223. package/src/reanimated2/js-reanimated/Mapper.ts +22 -9
  224. package/src/reanimated2/js-reanimated/MapperRegistry.ts +22 -19
  225. package/src/reanimated2/js-reanimated/MutableValue.ts +11 -11
  226. package/src/reanimated2/js-reanimated/index.ts +31 -14
  227. package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.ts +75 -0
  228. package/src/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.ts +29 -159
  229. package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +169 -0
  230. package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +2 -2
  231. package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +3 -9
  232. package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +1 -5
  233. package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +162 -82
  234. package/src/reanimated2/layoutReanimation/defaultAnimations/Default.ts +7 -2
  235. package/src/reanimated2/layoutReanimation/defaultAnimations/Fade.ts +32 -32
  236. package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +38 -38
  237. package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +34 -32
  238. package/src/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.ts +8 -8
  239. package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +14 -14
  240. package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +26 -26
  241. package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +28 -28
  242. package/src/reanimated2/layoutReanimation/defaultAnimations/Stretch.ts +14 -14
  243. package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +50 -50
  244. package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +104 -0
  245. package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +213 -0
  246. package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +60 -0
  247. package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +58 -0
  248. package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +41 -0
  249. package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +78 -0
  250. package/src/reanimated2/layoutReanimation/defaultTransitions/index.ts +6 -0
  251. package/src/reanimated2/layoutReanimation/index.ts +1 -0
  252. package/src/reanimated2/mock.ts +3 -1
  253. package/src/reanimated2/utils.ts +21 -0
  254. package/src/{setAndForwardRef.js → setAndForwardRef.ts} +12 -2
  255. package/android/react-native-reanimated-62-hermes.aar +0 -0
  256. package/android/react-native-reanimated-62-jsc.aar +0 -0
  257. package/lib/reanimated2/NativeReanimated.js +0 -48
  258. package/lib/reanimated2/layoutReanimation/animationBuilder/BaseBounceAnimationBuilder.js +0 -55
  259. package/lib/reanimated2/layoutReanimation/animationBuilder/LayoutAnimationBuilder.js +0 -165
  260. package/src/ReanimatedModuleCompat.js +0 -37
  261. package/src/reanimated2/NativeReanimated.ts +0 -70
  262. package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.tsx +0 -41
  263. package/src/reanimated2/layoutReanimation/animationBuilder/BaseBounceAnimationBuilder.ts +0 -82
  264. package/src/reanimated2/layoutReanimation/animationBuilder/LayoutAnimationBuilder.ts +0 -217
@@ -2,27 +2,27 @@
2
2
 
3
3
  #import <React/RCTConvert.h>
4
4
 
5
+ #import <React/RCTShadowView.h>
6
+ #import "Nodes/REAAlwaysNode.h"
7
+ #import "Nodes/REABezierNode.h"
8
+ #import "Nodes/REABlockNode.h"
9
+ #import "Nodes/REACallFuncNode.h"
10
+ #import "Nodes/REAClockNodes.h"
11
+ #import "Nodes/REAConcatNode.h"
12
+ #import "Nodes/REACondNode.h"
13
+ #import "Nodes/READebugNode.h"
14
+ #import "Nodes/REAEventNode.h"
15
+ #import "Nodes/REAFunctionNode.h"
16
+ #import "Nodes/REAJSCallNode.h"
5
17
  #import "Nodes/REANode.h"
18
+ #import "Nodes/REAOperatorNode.h"
19
+ #import "Nodes/REAParamNode.h"
6
20
  #import "Nodes/REAPropsNode.h"
21
+ #import "Nodes/REASetNode.h"
7
22
  #import "Nodes/REAStyleNode.h"
8
23
  #import "Nodes/REATransformNode.h"
9
24
  #import "Nodes/REAValueNode.h"
10
- #import "Nodes/REABlockNode.h"
11
- #import "Nodes/REACondNode.h"
12
- #import "Nodes/REAOperatorNode.h"
13
- #import "Nodes/REASetNode.h"
14
- #import "Nodes/READebugNode.h"
15
- #import "Nodes/REAClockNodes.h"
16
- #import "Nodes/REAJSCallNode.h"
17
- #import "Nodes/REABezierNode.h"
18
- #import "Nodes/REAEventNode.h"
19
25
  #import "REAModule.h"
20
- #import "Nodes/REAAlwaysNode.h"
21
- #import "Nodes/REAConcatNode.h"
22
- #import "Nodes/REAParamNode.h"
23
- #import "Nodes/REAFunctionNode.h"
24
- #import "Nodes/REACallFuncNode.h"
25
- #import <React/RCTShadowView.h>
26
26
 
27
27
  // Interface below has been added in order to use private methods of RCTUIManager,
28
28
  // RCTUIManager#UpdateView is a React Method which is exported to JS but in
@@ -32,9 +32,7 @@
32
32
 
33
33
  @interface RCTUIManager ()
34
34
 
35
- - (void)updateView:(nonnull NSNumber *)reactTag
36
- viewName:(NSString *)viewName
37
- props:(NSDictionary *)props;
35
+ - (void)updateView:(nonnull NSNumber *)reactTag viewName:(NSString *)viewName props:(NSDictionary *)props;
38
36
 
39
37
  - (void)setNeedsLayout;
40
38
 
@@ -84,13 +82,11 @@
84
82
 
85
83
  @end
86
84
 
87
- @interface REANodesManager() <RCTUIManagerObserver>
85
+ @interface REANodesManager () <RCTUIManagerObserver>
88
86
 
89
87
  @end
90
88
 
91
-
92
- @implementation REANodesManager
93
- {
89
+ @implementation REANodesManager {
94
90
  NSMutableDictionary<REANodeID, REANode *> *_nodes;
95
91
  NSMapTable<NSString *, REANode *> *_eventMapping;
96
92
  NSMutableArray<id<RCTEvent>> *_eventQueue;
@@ -105,8 +101,7 @@
105
101
  volatile void (^_mounting)(void);
106
102
  }
107
103
 
108
- - (instancetype)initWithModule:(REAModule *)reanimatedModule
109
- uiManager:(RCTUIManager *)uiManager
104
+ - (instancetype)initWithModule:(REAModule *)reanimatedModule uiManager:(RCTUIManager *)uiManager
110
105
  {
111
106
  if ((self = [super init])) {
112
107
  _reanimatedModule = reanimatedModule;
@@ -119,8 +114,9 @@
119
114
  _onAnimationCallbacks = [NSMutableArray new];
120
115
  _operationsInBatch = [NSMutableArray new];
121
116
  }
122
-
117
+
123
118
  _displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(onAnimationFrame:)];
119
+ _displayLink.preferredFramesPerSecond = 120; // will fallback to 60 fps for devices without Pro Motion display
124
120
  [_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
125
121
  [_displayLink setPaused:true];
126
122
  return self;
@@ -172,14 +168,14 @@
172
168
 
173
169
  - (void)startUpdatingOnAnimationFrame
174
170
  {
175
- // Setting _currentAnimationTimestamp here is connected with manual triggering of performOperations
176
- // in operationsBatchDidComplete. If new node has been created and clock has not been started,
177
- // _displayLink won't be initialized soon enough and _displayLink.timestamp will be 0.
178
- // However, CADisplayLink is using CACurrentMediaTime so if there's need to perform one more
179
- // evaluation, it could be used it here. In usual case, CACurrentMediaTime is not being used in
180
- // favor of setting it with _displayLink.timestamp in onAnimationFrame method.
181
- _currentAnimationTimestamp = CACurrentMediaTime();
182
- [_displayLink setPaused:false];
171
+ // Setting _currentAnimationTimestamp here is connected with manual triggering of performOperations
172
+ // in operationsBatchDidComplete. If new node has been created and clock has not been started,
173
+ // _displayLink won't be initialized soon enough and _displayLink.timestamp will be 0.
174
+ // However, CADisplayLink is using CACurrentMediaTime so if there's need to perform one more
175
+ // evaluation, it could be used it here. In usual case, CACurrentMediaTime is not being used in
176
+ // favor of setting it with _displayLink.timestamp in onAnimationFrame method.
177
+ _currentAnimationTimestamp = CACurrentMediaTime();
178
+ [_displayLink setPaused:false];
183
179
  }
184
180
 
185
181
  - (void)stopUpdatingOnAnimationFrame
@@ -217,7 +213,8 @@
217
213
  }
218
214
  }
219
215
 
220
- - (BOOL)uiManager:(RCTUIManager *)manager performMountingWithBlock:(RCTUIManagerMountingBlock)block {
216
+ - (BOOL)uiManager:(RCTUIManager *)manager performMountingWithBlock:(RCTUIManagerMountingBlock)block
217
+ {
221
218
  RCTAssert(_mounting == nil, @"Mouting block is expected to not be set");
222
219
  _mounting = block;
223
220
  return YES;
@@ -234,7 +231,7 @@
234
231
 
235
232
  BOOL trySynchronously = _tryRunBatchUpdatesSynchronously;
236
233
  _tryRunBatchUpdatesSynchronously = NO;
237
-
234
+
238
235
  __weak typeof(self) weakSelf = self;
239
236
  dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
240
237
  RCTExecuteOnUIManagerQueue(^{
@@ -243,27 +240,27 @@
243
240
  return;
244
241
  }
245
242
  BOOL canUpdateSynchronously = trySynchronously && ![strongSelf.uiManager hasEnqueuedUICommands];
246
-
243
+
247
244
  if (!canUpdateSynchronously) {
248
245
  dispatch_semaphore_signal(semaphore);
249
246
  }
250
-
247
+
251
248
  for (int i = 0; i < copiedOperationsQueue.count; i++) {
252
249
  copiedOperationsQueue[i](strongSelf.uiManager);
253
250
  }
254
-
251
+
255
252
  if (canUpdateSynchronously) {
256
253
  [strongSelf.uiManager runSyncUIUpdatesWithObserver:self];
257
254
  dispatch_semaphore_signal(semaphore);
258
255
  }
259
- //In case canUpdateSynchronously=true we still have to send uiManagerWillPerformMounting event
260
- //to observers because some components (e.g. TextInput) update their UIViews only on that event.
256
+ // In case canUpdateSynchronously=true we still have to send uiManagerWillPerformMounting event
257
+ // to observers because some components (e.g. TextInput) update their UIViews only on that event.
261
258
  [strongSelf.uiManager setNeedsLayout];
262
259
  });
263
260
  if (trySynchronously) {
264
261
  dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
265
262
  }
266
-
263
+
267
264
  if (_mounting) {
268
265
  _mounting();
269
266
  _mounting = nil;
@@ -273,9 +270,10 @@
273
270
  }
274
271
 
275
272
  - (void)enqueueUpdateViewOnNativeThread:(nonnull NSNumber *)reactTag
276
- viewName:(NSString *) viewName
273
+ viewName:(NSString *)viewName
277
274
  nativeProps:(NSMutableDictionary *)nativeProps
278
- trySynchronously:(BOOL)trySync {
275
+ trySynchronously:(BOOL)trySync
276
+ {
279
277
  if (trySync) {
280
278
  _tryRunBatchUpdatesSynchronously = YES;
281
279
  }
@@ -284,49 +282,48 @@
284
282
  }];
285
283
  }
286
284
 
287
- - (void)getValue:(REANodeID)nodeID
288
- callback:(RCTResponseSenderBlock)callback
285
+ - (void)getValue:(REANodeID)nodeID callback:(RCTResponseSenderBlock)callback
289
286
  {
290
287
  id val = _nodes[nodeID].value;
291
288
  if (val) {
292
- callback(@[val]);
289
+ callback(@[ val ]);
293
290
  } else {
294
291
  // NULL is not an object and it's not possible to pass it as callback's argument
295
- callback(@[[NSNull null]]);
292
+ callback(@[ [NSNull null] ]);
296
293
  }
297
294
  }
298
295
 
299
- #pragma mark -- Graph
296
+ #pragma mark-- Graph
300
297
 
301
- - (void)createNode:(REANodeID)nodeID
302
- config:(NSDictionary<NSString *, id> *)config
298
+ - (void)createNode:(REANodeID)nodeID config:(NSDictionary<NSString *, id> *)config
303
299
  {
304
300
  static NSDictionary *map;
305
301
  static dispatch_once_t mapToken;
306
302
  dispatch_once(&mapToken, ^{
307
- map = @{@"props": [REAPropsNode class],
308
- @"style": [REAStyleNode class],
309
- @"transform": [REATransformNode class],
310
- @"value": [REAValueNode class],
311
- @"block": [REABlockNode class],
312
- @"cond": [REACondNode class],
313
- @"op": [REAOperatorNode class],
314
- @"set": [REASetNode class],
315
- @"debug": [READebugNode class],
316
- @"clock": [REAClockNode class],
317
- @"clockStart": [REAClockStartNode class],
318
- @"clockStop": [REAClockStopNode class],
319
- @"clockTest": [REAClockTestNode class],
320
- @"call": [REAJSCallNode class],
321
- @"bezier": [REABezierNode class],
322
- @"event": [REAEventNode class],
323
- @"always": [REAAlwaysNode class],
324
- @"concat": [REAConcatNode class],
325
- @"param": [REAParamNode class],
326
- @"func": [REAFunctionNode class],
327
- @"callfunc": [REACallFuncNode class]
328
- // @"listener": nil,
329
- };
303
+ map = @{
304
+ @"props" : [REAPropsNode class],
305
+ @"style" : [REAStyleNode class],
306
+ @"transform" : [REATransformNode class],
307
+ @"value" : [REAValueNode class],
308
+ @"block" : [REABlockNode class],
309
+ @"cond" : [REACondNode class],
310
+ @"op" : [REAOperatorNode class],
311
+ @"set" : [REASetNode class],
312
+ @"debug" : [READebugNode class],
313
+ @"clock" : [REAClockNode class],
314
+ @"clockStart" : [REAClockStartNode class],
315
+ @"clockStop" : [REAClockStopNode class],
316
+ @"clockTest" : [REAClockTestNode class],
317
+ @"call" : [REAJSCallNode class],
318
+ @"bezier" : [REABezierNode class],
319
+ @"event" : [REAEventNode class],
320
+ @"always" : [REAAlwaysNode class],
321
+ @"concat" : [REAConcatNode class],
322
+ @"param" : [REAParamNode class],
323
+ @"func" : [REAFunctionNode class],
324
+ @"callfunc" : [REACallFuncNode class]
325
+ // @"listener": nil,
326
+ };
330
327
  });
331
328
 
332
329
  NSString *nodeType = [RCTConvert NSString:config[@"type"]];
@@ -378,9 +375,7 @@
378
375
  [parentNode removeChild:childNode];
379
376
  }
380
377
 
381
- - (void)connectNodeToView:(REANodeID)nodeID
382
- viewTag:(NSNumber *)viewTag
383
- viewName:(NSString *)viewName
378
+ - (void)connectNodeToView:(REANodeID)nodeID viewTag:(NSNumber *)viewTag viewName:(NSString *)viewName
384
379
  {
385
380
  RCTAssertParam(nodeID);
386
381
  REANode *node = _nodes[nodeID];
@@ -391,8 +386,7 @@
391
386
  }
392
387
  }
393
388
 
394
- - (void)disconnectNodeFromView:(REANodeID)nodeID
395
- viewTag:(NSNumber *)viewTag
389
+ - (void)disconnectNodeFromView:(REANodeID)nodeID viewTag:(NSNumber *)viewTag
396
390
  {
397
391
  RCTAssertParam(nodeID);
398
392
  REANode *node = _nodes[nodeID];
@@ -403,36 +397,26 @@
403
397
  }
404
398
  }
405
399
 
406
- - (void)attachEvent:(NSNumber *)viewTag
407
- eventName:(NSString *)eventName
408
- eventNodeID:(REANodeID)eventNodeID
400
+ - (void)attachEvent:(NSNumber *)viewTag eventName:(NSString *)eventName eventNodeID:(REANodeID)eventNodeID
409
401
  {
410
402
  RCTAssertParam(eventNodeID);
411
403
  REANode *eventNode = _nodes[eventNodeID];
412
404
  RCTAssert([eventNode isKindOfClass:[REAEventNode class]], @"Event node is of an invalid type");
413
405
 
414
- NSString *key = [NSString stringWithFormat:@"%@%@",
415
- viewTag,
416
- RCTNormalizeInputEventName(eventName)];
406
+ NSString *key = [NSString stringWithFormat:@"%@%@", viewTag, RCTNormalizeInputEventName(eventName)];
417
407
  RCTAssert([_eventMapping objectForKey:key] == nil, @"Event handler already set for the given view and event type");
418
408
  [_eventMapping setObject:eventNode forKey:key];
419
409
  }
420
410
 
421
- - (void)detachEvent:(NSNumber *)viewTag
422
- eventName:(NSString *)eventName
423
- eventNodeID:(REANodeID)eventNodeID
411
+ - (void)detachEvent:(NSNumber *)viewTag eventName:(NSString *)eventName eventNodeID:(REANodeID)eventNodeID
424
412
  {
425
- NSString *key = [NSString stringWithFormat:@"%@%@",
426
- viewTag,
427
- RCTNormalizeInputEventName(eventName)];
413
+ NSString *key = [NSString stringWithFormat:@"%@%@", viewTag, RCTNormalizeInputEventName(eventName)];
428
414
  [_eventMapping removeObjectForKey:key];
429
415
  }
430
416
 
431
417
  - (void)processEvent:(id<RCTEvent>)event
432
418
  {
433
- NSString *key = [NSString stringWithFormat:@"%@%@",
434
- event.viewTag,
435
- RCTNormalizeInputEventName(event.eventName)];
419
+ NSString *key = [NSString stringWithFormat:@"%@%@", event.viewTag, RCTNormalizeInputEventName(event.eventName)];
436
420
  REAEventNode *eventNode = [_eventMapping objectForKey:key];
437
421
  [eventNode processEvent:event];
438
422
  }
@@ -465,18 +449,14 @@
465
449
 
466
450
  - (void)dispatchEvent:(id<RCTEvent>)event
467
451
  {
468
- NSString *key = [NSString stringWithFormat:@"%@%@",
469
- event.viewTag,
470
- RCTNormalizeInputEventName(event.eventName)];
452
+ NSString *key = [NSString stringWithFormat:@"%@%@", event.viewTag, RCTNormalizeInputEventName(event.eventName)];
471
453
 
472
- NSString *eventHash = [NSString stringWithFormat:@"%@%@",
473
- event.viewTag,
474
- event.eventName];
454
+ NSString *eventHash = [NSString stringWithFormat:@"%@%@", event.viewTag, event.eventName];
475
455
 
476
456
  if (_eventHandler != nil) {
477
457
  __weak REAEventHandler eventHandler = _eventHandler;
478
458
  __weak typeof(self) weakSelf = self;
479
- RCTExecuteOnMainQueue(^void(){
459
+ RCTExecuteOnMainQueue(^void() {
480
460
  __typeof__(self) strongSelf = weakSelf;
481
461
  if (strongSelf == nil) {
482
462
  return;
@@ -506,8 +486,7 @@
506
486
  }
507
487
  }
508
488
 
509
- - (void)configureProps:(NSSet<NSString *> *)nativeProps
510
- uiProps:(NSSet<NSString *> *)uiProps
489
+ - (void)configureProps:(NSSet<NSString *> *)nativeProps uiProps:(NSSet<NSString *> *)uiProps
511
490
  {
512
491
  _uiProps = uiProps;
513
492
  _nativeProps = nativeProps;
@@ -532,7 +511,7 @@
532
511
  NSMutableDictionary *nativeProps = [NSMutableDictionary new];
533
512
  NSMutableDictionary *jsProps = [NSMutableDictionary new];
534
513
 
535
- void (^addBlock)(NSString *key, id obj, BOOL * stop) = ^(NSString *key, id obj, BOOL * stop){
514
+ void (^addBlock)(NSString *key, id obj, BOOL *stop) = ^(NSString *key, id obj, BOOL *stop) {
536
515
  if ([self.uiProps containsObject:key]) {
537
516
  uiProps[key] = obj;
538
517
  } else if ([self.nativeProps containsObject:key]) {
@@ -545,36 +524,33 @@
545
524
  [props enumerateKeysAndObjectsUsingBlock:addBlock];
546
525
 
547
526
  if (uiProps.count > 0) {
548
- [self.uiManager
549
- synchronouslyUpdateViewOnUIThread:viewTag
550
- viewName:viewName
551
- props:uiProps];
552
- }
553
- if (nativeProps.count > 0) {
554
- [self enqueueUpdateViewOnNativeThread:viewTag viewName:viewName nativeProps:nativeProps trySynchronously:YES];
555
- }
556
- if (jsProps.count > 0) {
557
- [self.reanimatedModule sendEventWithName:@"onReanimatedPropsChange"
558
- body:@{@"viewTag": viewTag, @"props": jsProps }];
559
- }
527
+ [self.uiManager synchronouslyUpdateViewOnUIThread:viewTag viewName:viewName props:uiProps];
528
+ }
529
+ if (nativeProps.count > 0) {
530
+ [self enqueueUpdateViewOnNativeThread:viewTag viewName:viewName nativeProps:nativeProps trySynchronously:YES];
531
+ }
532
+ if (jsProps.count > 0) {
533
+ [self.reanimatedModule sendEventWithName:@"onReanimatedPropsChange"
534
+ body:@{@"viewTag" : viewTag, @"props" : jsProps}];
535
+ }
560
536
  }
561
537
 
562
- - (NSString*)obtainProp:(nonnull NSNumber *)viewTag
563
- propName:(nonnull NSString *)propName
538
+ - (NSString *)obtainProp:(nonnull NSNumber *)viewTag propName:(nonnull NSString *)propName
564
539
  {
565
- UIView* view = [self.uiManager viewForReactTag:viewTag];
566
-
567
- NSString* result = [NSString stringWithFormat:@"error: unknown propName %@, currently supported: opacity, zIndex", propName];
568
-
569
- if ([propName isEqualToString:@"opacity"]) {
570
- CGFloat alpha = view.alpha;
571
- result = [@(alpha) stringValue];
572
- } else if ([propName isEqualToString:@"zIndex"]) {
573
- NSInteger zIndex = view.reactZIndex;
574
- result = [@(zIndex) stringValue];
575
- }
576
-
577
- return result;
540
+ UIView *view = [self.uiManager viewForReactTag:viewTag];
541
+
542
+ NSString *result =
543
+ [NSString stringWithFormat:@"error: unknown propName %@, currently supported: opacity, zIndex", propName];
544
+
545
+ if ([propName isEqualToString:@"opacity"]) {
546
+ CGFloat alpha = view.alpha;
547
+ result = [@(alpha) stringValue];
548
+ } else if ([propName isEqualToString:@"zIndex"]) {
549
+ NSInteger zIndex = view.reactZIndex;
550
+ result = [@(zIndex) stringValue];
551
+ }
552
+
553
+ return result;
578
554
  }
579
555
 
580
556
  @end
package/ios/REAUtils.h CHANGED
@@ -1,5 +1,7 @@
1
1
  #import <Foundation/Foundation.h>
2
2
 
3
- #define REA_LOG_ERROR_IF_NIL(value, errorMsg) ({\
4
- if (value == nil) RCTLogError(errorMsg);\
5
- })
3
+ #define REA_LOG_ERROR_IF_NIL(value, errorMsg) \
4
+ ({ \
5
+ if (value == nil) \
6
+ RCTLogError(errorMsg); \
7
+ })
@@ -0,0 +1,5 @@
1
+ @protocol RNGestureHandlerStateManager
2
+
3
+ - (void)setGestureState:(int)state forHandler:(int)handlerTag;
4
+
5
+ @end
@@ -2,36 +2,52 @@
2
2
 
3
3
  @implementation RCTConvert (REATransition)
4
4
 
5
- RCT_ENUM_CONVERTER(REATransitionType, (@{
6
- @"none": @(REATransitionTypeNone),
7
- @"group": @(REATransitionTypeGroup),
8
- @"in": @(REATransitionTypeIn),
9
- @"out": @(REATransitionTypeOut),
10
- @"change": @(REATransitionTypeChange),
11
- }), REATransitionTypeNone, integerValue)
5
+ RCT_ENUM_CONVERTER(
6
+ REATransitionType,
7
+ (@{
8
+ @"none" : @(REATransitionTypeNone),
9
+ @"group" : @(REATransitionTypeGroup),
10
+ @"in" : @(REATransitionTypeIn),
11
+ @"out" : @(REATransitionTypeOut),
12
+ @"change" : @(REATransitionTypeChange),
13
+ }),
14
+ REATransitionTypeNone,
15
+ integerValue)
12
16
 
13
- RCT_ENUM_CONVERTER(REATransitionAnimationType, (@{
14
- @"none": @(REATransitionAnimationTypeNone),
15
- @"fade": @(REATransitionAnimationTypeFade),
16
- @"scale": @(REATransitionAnimationTypeScale),
17
- @"slide-top": @(REATransitionAnimationTypeSlideTop),
18
- @"slide-bottom": @(REATransitionAnimationTypeSlideBottom),
19
- @"slide-right": @(REATransitionAnimationTypeSlideRight),
20
- @"slide-left": @(REATransitionAnimationTypeSlideLeft)
21
- }), REATransitionAnimationTypeNone, integerValue)
17
+ RCT_ENUM_CONVERTER(
18
+ REATransitionAnimationType,
19
+ (@{
20
+ @"none" : @(REATransitionAnimationTypeNone),
21
+ @"fade" : @(REATransitionAnimationTypeFade),
22
+ @"scale" : @(REATransitionAnimationTypeScale),
23
+ @"slide-top" : @(REATransitionAnimationTypeSlideTop),
24
+ @"slide-bottom" : @(REATransitionAnimationTypeSlideBottom),
25
+ @"slide-right" : @(REATransitionAnimationTypeSlideRight),
26
+ @"slide-left" : @(REATransitionAnimationTypeSlideLeft)
27
+ }),
28
+ REATransitionAnimationTypeNone,
29
+ integerValue)
22
30
 
23
- RCT_ENUM_CONVERTER(REATransitionInterpolationType, (@{
24
- @"linear": @(REATransitionInterpolationLinear),
25
- @"easeIn": @(REATransitionInterpolationEaseIn),
26
- @"easeOut": @(REATransitionInterpolationEaseOut),
27
- @"easeInOut": @(REATransitionInterpolationEaseInOut),
28
- }), REATransitionInterpolationLinear, integerValue)
31
+ RCT_ENUM_CONVERTER(
32
+ REATransitionInterpolationType,
33
+ (@{
34
+ @"linear" : @(REATransitionInterpolationLinear),
35
+ @"easeIn" : @(REATransitionInterpolationEaseIn),
36
+ @"easeOut" : @(REATransitionInterpolationEaseOut),
37
+ @"easeInOut" : @(REATransitionInterpolationEaseInOut),
38
+ }),
39
+ REATransitionInterpolationLinear,
40
+ integerValue)
29
41
 
30
- RCT_ENUM_CONVERTER(REATransitionPropagationType, (@{
31
- @"none": @(REATransitionPropagationNone),
32
- @"top": @(REATransitionPropagationTop),
33
- @"bottom": @(REATransitionPropagationBottom),
34
- @"left": @(REATransitionPropagationLeft),
35
- @"right": @(REATransitionPropagationRight)
36
- }), REATransitionPropagationNone, integerValue)
42
+ RCT_ENUM_CONVERTER(
43
+ REATransitionPropagationType,
44
+ (@{
45
+ @"none" : @(REATransitionPropagationNone),
46
+ @"top" : @(REATransitionPropagationTop),
47
+ @"bottom" : @(REATransitionPropagationBottom),
48
+ @"left" : @(REATransitionPropagationLeft),
49
+ @"right" : @(REATransitionPropagationRight)
50
+ }),
51
+ REATransitionPropagationNone,
52
+ integerValue)
37
53
  @end
@@ -8,8 +8,8 @@
8
8
 
9
9
  @interface REAVisibilityTransition : REATransition
10
10
  @property (nonatomic) REATransitionAnimationType animationType;
11
- - (REATransitionAnimation *)appearView:(UIView*)view inParent:(UIView*)parent;
12
- - (REATransitionAnimation *)disappearView:(UIView*)view fromParent:(UIView*)parent;
11
+ - (REATransitionAnimation *)appearView:(UIView *)view inParent:(UIView *)parent;
12
+ - (REATransitionAnimation *)disappearView:(UIView *)view fromParent:(UIView *)parent;
13
13
  - (instancetype)initWithConfig:(NSDictionary *)config;
14
14
  @end
15
15
 
@@ -1,7 +1,7 @@
1
1
  #import <React/RCTViewManager.h>
2
2
 
3
- #import "REAAllTransitions.h"
4
3
  #import "RCTConvert+REATransition.h"
4
+ #import "REAAllTransitions.h"
5
5
 
6
6
  @interface REASnapshotRemover : NSObject <CAAnimationDelegate>
7
7
  @end
@@ -33,7 +33,7 @@
33
33
  if (self = [super initWithConfig:config]) {
34
34
  _sequence = [RCTConvert BOOL:config[@"sequence"]];
35
35
  NSArray *transitions = [RCTConvert NSArray:config[@"transitions"]];
36
- NSMutableArray<REATransition*> *inflated = [NSMutableArray new];
36
+ NSMutableArray<REATransition *> *inflated = [NSMutableArray new];
37
37
  for (NSDictionary *transitionConfig in transitions) {
38
38
  [inflated addObject:[REATransition inflate:transitionConfig]];
39
39
  inflated.lastObject.parent = self;
@@ -51,9 +51,10 @@
51
51
  return self;
52
52
  }
53
53
 
54
- - (NSArray<REATransitionAnimation *> *)animationsForTransitioning:(NSMutableDictionary<NSNumber *,REATransitionValues *> *)startValues
55
- endValues:(NSMutableDictionary<NSNumber *,REATransitionValues *> *)endValues
56
- forRoot:(UIView *)root
54
+ - (NSArray<REATransitionAnimation *> *)
55
+ animationsForTransitioning:(NSMutableDictionary<NSNumber *, REATransitionValues *> *)startValues
56
+ endValues:(NSMutableDictionary<NSNumber *, REATransitionValues *> *)endValues
57
+ forRoot:(UIView *)root
57
58
  {
58
59
  CFTimeInterval delay = self.delay;
59
60
  NSMutableArray *animations = [NSMutableArray new];
@@ -74,7 +75,6 @@
74
75
 
75
76
  @end
76
77
 
77
-
78
78
  @implementation REAVisibilityTransition
79
79
 
80
80
  - (instancetype)initWithConfig:(NSDictionary *)config
@@ -85,23 +85,19 @@
85
85
  return self;
86
86
  }
87
87
 
88
- - (REATransitionAnimation *)appearView:(UIView *)view
89
- inParent:(UIView *)parent
90
- forRoot:(UIView *)root
88
+ - (REATransitionAnimation *)appearView:(UIView *)view inParent:(UIView *)parent forRoot:(UIView *)root
91
89
  {
92
90
  return nil;
93
91
  }
94
92
 
95
- - (REATransitionAnimation *)disappearView:(UIView *)view
96
- fromParent:(UIView *)parent
97
- forRoot:(UIView *)root
93
+ - (REATransitionAnimation *)disappearView:(UIView *)view fromParent:(UIView *)parent forRoot:(UIView *)root
98
94
  {
99
95
  return nil;
100
96
  }
101
97
 
102
98
  - (REATransitionAnimation *)animationForTransitioning:(REATransitionValues *)startValues
103
- endValues:(REATransitionValues *)endValues
104
- forRoot:(UIView *)root
99
+ endValues:(REATransitionValues *)endValues
100
+ forRoot:(UIView *)root
105
101
  {
106
102
  BOOL isViewAppearing = (startValues == nil);
107
103
  if (isViewAppearing && !IS_LAYOUT_ONLY(endValues.view)) {
@@ -123,7 +119,6 @@
123
119
 
124
120
  @end
125
121
 
126
-
127
122
  @implementation REAInTransition
128
123
  - (instancetype)initWithConfig:(NSDictionary *)config
129
124
  {
@@ -132,9 +127,7 @@
132
127
  return self;
133
128
  }
134
129
 
135
- - (REATransitionAnimation *)appearView:(UIView *)view
136
- inParent:(UIView *)parent
137
- forRoot:(UIView *)root
130
+ - (REATransitionAnimation *)appearView:(UIView *)view inParent:(UIView *)parent forRoot:(UIView *)root
138
131
  {
139
132
  CABasicAnimation *animation;
140
133
  switch (self.animationType) {
@@ -186,7 +179,6 @@
186
179
  }
187
180
  @end
188
181
 
189
-
190
182
  @implementation REAOutTransition
191
183
  - (instancetype)initWithConfig:(NSDictionary *)config
192
184
  {
@@ -195,9 +187,7 @@
195
187
  return self;
196
188
  }
197
189
 
198
- - (REATransitionAnimation *)disappearView:(UIView *)view
199
- fromParent:(UIView *)parent
200
- forRoot:(UIView *)root
190
+ - (REATransitionAnimation *)disappearView:(UIView *)view fromParent:(UIView *)parent forRoot:(UIView *)root
201
191
  {
202
192
  if (self.animationType == REATransitionAnimationTypeNone) {
203
193
  return nil;
@@ -262,12 +252,11 @@
262
252
  }
263
253
  @end
264
254
 
265
-
266
255
  @implementation REAChangeTransition
267
256
 
268
257
  - (REATransitionAnimation *)animationForTransitioning:(REATransitionValues *)startValues
269
- endValues:(REATransitionValues *)endValues
270
- forRoot:(UIView *)root
258
+ endValues:(REATransitionValues *)endValues
259
+ forRoot:(UIView *)root
271
260
  {
272
261
  if (startValues == nil || endValues == nil || endValues.view.window == nil) {
273
262
  return nil;