react-native-navigation 8.1.0-alpha01 → 8.1.0-rc01-snapshot.1685

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 (185) hide show
  1. package/autolink/postlink/__snapshots__/appDelegateLinker.test.js.snap +12 -12
  2. package/index.e2e.js +2 -1
  3. package/lib/Mock/Components/ComponentScreen.tsx +2 -1
  4. package/lib/Mock/Components/LayoutComponent.tsx +9 -0
  5. package/lib/Mock/Components/SideMenu.tsx +27 -0
  6. package/lib/Mock/Layouts/BottomTabsNode.ts +4 -2
  7. package/lib/Mock/Layouts/LayoutNodeFactory.ts +14 -1
  8. package/lib/Mock/Layouts/ParentNode.ts +4 -0
  9. package/lib/Mock/Layouts/SideMenu.ts +87 -0
  10. package/lib/Mock/Stores/LayoutStore.ts +42 -10
  11. package/lib/Mock/actions/layoutActions.ts +11 -0
  12. package/lib/Mock/mocks/NativeCommandsSender.tsx +1 -0
  13. package/lib/android/app/build.gradle +22 -125
  14. package/lib/android/app/src/main/java/com/reactnativenavigation/FeatureToggles.kt +4 -2
  15. package/lib/android/app/src/main/java/com/reactnativenavigation/NavigationActivity.java +2 -2
  16. package/lib/android/app/src/main/java/com/reactnativenavigation/NavigationApplication.java +1 -1
  17. package/lib/android/app/src/main/java/com/reactnativenavigation/options/LayoutFactory.java +4 -4
  18. package/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationPackage.kt +27 -13
  19. package/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationReactInitializer.java +2 -14
  20. package/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationTurboModule.kt +291 -0
  21. package/lib/android/app/src/{reactNative71 → main}/java/com/reactnativenavigation/react/ReactGateway.java +23 -23
  22. package/lib/android/app/src/main/java/com/reactnativenavigation/react/ReactView.java +6 -6
  23. package/lib/android/app/src/main/java/com/reactnativenavigation/utils/ColorUtils.java +11 -0
  24. package/lib/android/app/src/main/java/com/reactnativenavigation/utils/MotionEvent.kt +4 -9
  25. package/lib/android/app/src/main/java/com/reactnativenavigation/utils/SystemUiUtils.kt +12 -17
  26. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabPresenter.java +0 -1
  27. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsController.java +20 -13
  28. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/component/ComponentPresenter.java +18 -0
  29. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/component/ComponentViewController.java +5 -17
  30. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackController.java +28 -13
  31. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackPresenter.java +13 -6
  32. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/TopBarController.kt +35 -2
  33. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/statusbar/StatusBarPresenter.kt +212 -0
  34. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/Presenter.java +10 -178
  35. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/StatusBarColorAnimator.kt +28 -0
  36. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/ViewController.java +34 -7
  37. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/ViewControllerVisibilityInfo.kt +5 -0
  38. package/lib/android/build.gradle +27 -15
  39. package/lib/dist/Mock/Components/ComponentScreen.js +2 -1
  40. package/lib/dist/Mock/Components/LayoutComponent.js +9 -0
  41. package/lib/dist/Mock/Components/SideMenu.d.ts +58 -0
  42. package/lib/dist/Mock/Components/SideMenu.js +25 -0
  43. package/lib/dist/Mock/Layouts/BottomTabsNode.d.ts +1 -1
  44. package/lib/dist/Mock/Layouts/BottomTabsNode.js +3 -2
  45. package/lib/dist/Mock/Layouts/LayoutNodeFactory.d.ts +2 -1
  46. package/lib/dist/Mock/Layouts/LayoutNodeFactory.js +10 -1
  47. package/lib/dist/Mock/Layouts/ParentNode.d.ts +1 -0
  48. package/lib/dist/Mock/Layouts/ParentNode.js +3 -0
  49. package/lib/dist/Mock/Layouts/SideMenu.d.ts +31 -0
  50. package/lib/dist/Mock/Layouts/SideMenu.js +80 -0
  51. package/lib/dist/Mock/Stores/LayoutStore.js +38 -9
  52. package/lib/dist/Mock/actions/layoutActions.d.ts +3 -0
  53. package/lib/dist/Mock/actions/layoutActions.js +11 -1
  54. package/lib/dist/Mock/mocks/NativeCommandsSender.js +1 -0
  55. package/lib/dist/src/adapters/NativeCommandsSender.d.ts +39 -4
  56. package/lib/dist/src/adapters/NativeCommandsSender.js +2 -2
  57. package/lib/dist/src/adapters/NativeRNNTurboEventEmitter.js +2 -9
  58. package/lib/dist/src/adapters/NativeRNNTurboModule.d.ts +9 -10
  59. package/lib/dist/src/adapters/NativeRNNTurboModule.js +1 -12
  60. package/lib/dist/src/commands/Commands.d.ts +13 -13
  61. package/lib/ios/AnimatedTextView.mm +1 -0
  62. package/lib/ios/Constants.mm +7 -1
  63. package/lib/ios/RNNAppDelegate.mm +3 -1
  64. package/lib/ios/RNNCommandsHandler.mm +1 -0
  65. package/lib/ios/RNNCustomTitleView.h +1 -0
  66. package/lib/ios/RNNCustomTitleView.mm +8 -1
  67. package/lib/ios/RNNEventEmitter.mm +3 -0
  68. package/lib/ios/RNNReactButtonView.mm +1 -1
  69. package/lib/ios/RNNReactView.h +3 -1
  70. package/lib/ios/RNNReactView.mm +45 -20
  71. package/lib/ios/TopBarTitlePresenter.mm +2 -0
  72. package/lib/ios/TurboModules/RNNTurboEventEmitter.mm +7 -0
  73. package/lib/ios/UINavigationController+RNNCommands.mm +4 -0
  74. package/lib/src/adapters/NativeCommandsSender.ts +7 -7
  75. package/lib/src/adapters/NativeRNNTurboEventEmitter.ts +3 -9
  76. package/lib/src/adapters/NativeRNNTurboModule.ts +23 -21
  77. package/package.json +14 -17
  78. package/react-native.config.js +1 -1
  79. package/lib/android/app/src/main/java/com/reactnativenavigation/react/DevPermissionRequest.java +0 -42
  80. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/statusbar/StatusBarController.kt +0 -9
  81. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/statusbar/StatusBarPresenter.kt +0 -9
  82. package/lib/android/app/src/reactNative51/java/com/reactnativenavigation/options/parsers/ColorParser.java +0 -18
  83. package/lib/android/app/src/reactNative51/java/com/reactnativenavigation/react/DevBundleDownloadListenerAdapter.java +0 -22
  84. package/lib/android/app/src/reactNative51/java/com/reactnativenavigation/react/JsDevReloadHandlerFacade.java +0 -22
  85. package/lib/android/app/src/reactNative51/java/com/reactnativenavigation/react/NavigationReactNativeHost.java +0 -71
  86. package/lib/android/app/src/reactNative51/java/com/reactnativenavigation/react/ReactGateway.java +0 -70
  87. package/lib/android/app/src/reactNative51/java/com/reactnativenavigation/react/SyncUiImplementation.java +0 -83
  88. package/lib/android/app/src/reactNative51/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt +0 -81
  89. package/lib/android/app/src/reactNative51/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxDelegate.kt +0 -42
  90. package/lib/android/app/src/reactNative51/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxHelper.java +0 -27
  91. package/lib/android/app/src/reactNative51/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleBarReactView.kt +0 -32
  92. package/lib/android/app/src/reactNative55/java/com/reactnativenavigation/options/parsers/ColorParser.java +0 -18
  93. package/lib/android/app/src/reactNative55/java/com/reactnativenavigation/react/DevBundleDownloadListenerAdapter.java +0 -22
  94. package/lib/android/app/src/reactNative55/java/com/reactnativenavigation/react/JsDevReloadHandlerFacade.java +0 -22
  95. package/lib/android/app/src/reactNative55/java/com/reactnativenavigation/react/NavigationReactNativeHost.java +0 -71
  96. package/lib/android/app/src/reactNative55/java/com/reactnativenavigation/react/ReactGateway.java +0 -70
  97. package/lib/android/app/src/reactNative55/java/com/reactnativenavigation/react/ReloadHandlerFacade.java +0 -22
  98. package/lib/android/app/src/reactNative55/java/com/reactnativenavigation/react/SyncUiImplementation.java +0 -83
  99. package/lib/android/app/src/reactNative55/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt +0 -81
  100. package/lib/android/app/src/reactNative55/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxDelegate.kt +0 -42
  101. package/lib/android/app/src/reactNative55/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxHelper.java +0 -27
  102. package/lib/android/app/src/reactNative55/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleBarReactView.kt +0 -32
  103. package/lib/android/app/src/reactNative56/java/com/reactnativenavigation/options/parsers/ColorParser.java +0 -18
  104. package/lib/android/app/src/reactNative56/java/com/reactnativenavigation/react/DevBundleDownloadListenerAdapter.java +0 -28
  105. package/lib/android/app/src/reactNative56/java/com/reactnativenavigation/react/JsDevReloadHandlerFacade.java +0 -28
  106. package/lib/android/app/src/reactNative56/java/com/reactnativenavigation/react/NavigationReactNativeHost.java +0 -71
  107. package/lib/android/app/src/reactNative56/java/com/reactnativenavigation/react/ReactGateway.java +0 -70
  108. package/lib/android/app/src/reactNative56/java/com/reactnativenavigation/react/ReloadHandlerFacade.java +0 -25
  109. package/lib/android/app/src/reactNative56/java/com/reactnativenavigation/react/SyncUiImplementation.java +0 -83
  110. package/lib/android/app/src/reactNative56/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt +0 -81
  111. package/lib/android/app/src/reactNative56/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxDelegate.kt +0 -42
  112. package/lib/android/app/src/reactNative56/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxHelper.java +0 -27
  113. package/lib/android/app/src/reactNative56/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleBarReactView.kt +0 -32
  114. package/lib/android/app/src/reactNative57/java/com/reactnativenavigation/options/parsers/ColorParser.java +0 -18
  115. package/lib/android/app/src/reactNative57/java/com/reactnativenavigation/react/DevBundleDownloadListenerAdapter.java +0 -28
  116. package/lib/android/app/src/reactNative57/java/com/reactnativenavigation/react/JsDevReloadHandlerFacade.java +0 -28
  117. package/lib/android/app/src/reactNative57/java/com/reactnativenavigation/react/NavigationReactNativeHost.java +0 -70
  118. package/lib/android/app/src/reactNative57/java/com/reactnativenavigation/react/ReactGateway.java +0 -70
  119. package/lib/android/app/src/reactNative57/java/com/reactnativenavigation/react/ReloadHandlerFacade.java +0 -25
  120. package/lib/android/app/src/reactNative57/java/com/reactnativenavigation/react/SyncUiImplementation.java +0 -70
  121. package/lib/android/app/src/reactNative57/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt +0 -81
  122. package/lib/android/app/src/reactNative57/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxDelegate.kt +0 -42
  123. package/lib/android/app/src/reactNative57/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxHelper.java +0 -27
  124. package/lib/android/app/src/reactNative57/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleBarReactView.kt +0 -32
  125. package/lib/android/app/src/reactNative57_5/java/com/reactnativenavigation/options/parsers/ColorParser.java +0 -18
  126. package/lib/android/app/src/reactNative57_5/java/com/reactnativenavigation/react/DevBundleDownloadListenerAdapter.java +0 -28
  127. package/lib/android/app/src/reactNative57_5/java/com/reactnativenavigation/react/JsDevReloadHandlerFacade.java +0 -28
  128. package/lib/android/app/src/reactNative57_5/java/com/reactnativenavigation/react/NavigationReactNativeHost.java +0 -70
  129. package/lib/android/app/src/reactNative57_5/java/com/reactnativenavigation/react/ReactGateway.java +0 -70
  130. package/lib/android/app/src/reactNative57_5/java/com/reactnativenavigation/react/ReloadHandlerFacade.java +0 -25
  131. package/lib/android/app/src/reactNative57_5/java/com/reactnativenavigation/react/SyncUiImplementation.java +0 -83
  132. package/lib/android/app/src/reactNative57_5/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt +0 -81
  133. package/lib/android/app/src/reactNative57_5/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxDelegate.kt +0 -42
  134. package/lib/android/app/src/reactNative57_5/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxHelper.java +0 -27
  135. package/lib/android/app/src/reactNative57_5/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleBarReactView.kt +0 -32
  136. package/lib/android/app/src/reactNative60/java/com/reactnativenavigation/options/parsers/ColorParser.java +0 -18
  137. package/lib/android/app/src/reactNative60/java/com/reactnativenavigation/react/DevBundleDownloadListenerAdapter.java +0 -28
  138. package/lib/android/app/src/reactNative60/java/com/reactnativenavigation/react/JsDevReloadHandlerFacade.java +0 -28
  139. package/lib/android/app/src/reactNative60/java/com/reactnativenavigation/react/NavigationReactNativeHost.java +0 -67
  140. package/lib/android/app/src/reactNative60/java/com/reactnativenavigation/react/ReactGateway.java +0 -70
  141. package/lib/android/app/src/reactNative60/java/com/reactnativenavigation/react/ReloadHandlerFacade.java +0 -25
  142. package/lib/android/app/src/reactNative60/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt +0 -81
  143. package/lib/android/app/src/reactNative60/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxDelegate.kt +0 -42
  144. package/lib/android/app/src/reactNative60/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxHelper.java +0 -27
  145. package/lib/android/app/src/reactNative60/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleBarReactView.kt +0 -32
  146. package/lib/android/app/src/reactNative62/java/com/reactnativenavigation/options/parsers/ColorParser.java +0 -18
  147. package/lib/android/app/src/reactNative62/java/com/reactnativenavigation/react/NavigationReactNativeHost.java +0 -67
  148. package/lib/android/app/src/reactNative62/java/com/reactnativenavigation/react/ReactGateway.java +0 -72
  149. package/lib/android/app/src/reactNative62/java/com/reactnativenavigation/react/ReloadHandlerFacade.java +0 -22
  150. package/lib/android/app/src/reactNative62/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt +0 -81
  151. package/lib/android/app/src/reactNative62/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxDelegate.kt +0 -42
  152. package/lib/android/app/src/reactNative62/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxHelper.java +0 -27
  153. package/lib/android/app/src/reactNative62/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleBarReactView.kt +0 -32
  154. package/lib/android/app/src/reactNative63/java/com/reactnativenavigation/react/DevBundleDownloadListenerAdapter.java +0 -22
  155. package/lib/android/app/src/reactNative63/java/com/reactnativenavigation/react/JsDevReloadHandlerFacade.java +0 -22
  156. package/lib/android/app/src/reactNative63/java/com/reactnativenavigation/react/NavigationReactNativeHost.java +0 -66
  157. package/lib/android/app/src/reactNative63/java/com/reactnativenavigation/react/ReactGateway.java +0 -72
  158. package/lib/android/app/src/reactNative63/java/com/reactnativenavigation/react/ReloadHandlerFacade.java +0 -22
  159. package/lib/android/app/src/reactNative63/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt +0 -81
  160. package/lib/android/app/src/reactNative63/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxDelegate.kt +0 -42
  161. package/lib/android/app/src/reactNative63/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleBarReactView.kt +0 -32
  162. package/lib/android/app/src/reactNative68/java/com/reactnativenavigation/options/parsers/ColorParser.kt +0 -38
  163. package/lib/android/app/src/reactNative68/java/com/reactnativenavigation/react/DevBundleDownloadListenerAdapter.java +0 -22
  164. package/lib/android/app/src/reactNative68/java/com/reactnativenavigation/react/JsDevReloadHandlerFacade.java +0 -22
  165. package/lib/android/app/src/reactNative68/java/com/reactnativenavigation/react/NavigationReactNativeHost.java +0 -66
  166. package/lib/android/app/src/reactNative68/java/com/reactnativenavigation/react/ReactGateway.java +0 -72
  167. package/lib/android/app/src/reactNative68/java/com/reactnativenavigation/react/ReloadHandlerFacade.java +0 -22
  168. package/lib/android/app/src/reactNative68/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt +0 -87
  169. package/lib/android/app/src/reactNative68/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxDelegate.kt +0 -42
  170. package/lib/android/app/src/reactNative68/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxHelper.java +0 -12
  171. package/lib/android/app/src/reactNative68/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleBarReactView.kt +0 -32
  172. package/lib/android/app/src/reactNative71/java/com/reactnativenavigation/options/parsers/ColorParser.kt +0 -38
  173. package/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/DevBundleDownloadListenerAdapter.java +0 -22
  174. package/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/JsDevReloadHandlerFacade.java +0 -22
  175. package/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/ReloadHandlerFacade.java +0 -22
  176. package/lib/android/app/src/reactNative71/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxHelper.java +0 -12
  177. /package/lib/android/app/src/{reactNative63 → main}/java/com/reactnativenavigation/options/parsers/ColorParser.kt +0 -0
  178. /package/lib/android/app/src/{reactNative62 → main}/java/com/reactnativenavigation/react/DevBundleDownloadListenerAdapter.java +0 -0
  179. /package/lib/android/app/src/{reactNative62 → main}/java/com/reactnativenavigation/react/JsDevReloadHandlerFacade.java +0 -0
  180. /package/lib/android/app/src/{reactNative71 → main}/java/com/reactnativenavigation/react/NavigationReactNativeHost.java +0 -0
  181. /package/lib/android/app/src/{reactNative51 → main}/java/com/reactnativenavigation/react/ReloadHandlerFacade.java +0 -0
  182. /package/lib/android/app/src/{reactNative71 → main}/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt +0 -0
  183. /package/lib/android/app/src/{reactNative71 → main}/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxDelegate.kt +0 -0
  184. /package/lib/android/app/src/{reactNative63 → main}/java/com/reactnativenavigation/viewcontrollers/viewcontroller/YellowBoxHelper.java +0 -0
  185. /package/lib/android/app/src/{reactNative71 → main}/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleBarReactView.kt +0 -0
@@ -1,7 +1,7 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`appDelegateLinker should work for RN 0.68 1`] = `
4
- "#import \\"AppDelegate.h\\"
4
+ "#import "AppDelegate.h"
5
5
  #import <ReactNativeNavigation/ReactNativeNavigation.h>
6
6
 
7
7
  #import <React/RCTBridge.h>
@@ -40,7 +40,7 @@ exports[`appDelegateLinker should work for RN 0.68 1`] = `
40
40
  #if RCT_NEW_ARCH_ENABLED
41
41
  _contextContainer = std::make_shared<facebook::react::ContextContainer const>();
42
42
  _reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
43
- _contextContainer->insert(\\"ReactNativeConfig\\", _reactNativeConfig);
43
+ _contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
44
44
  _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
45
45
  bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
46
46
  #endif
@@ -55,9 +55,9 @@ exports[`appDelegateLinker should work for RN 0.68 1`] = `
55
55
  - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
56
56
  {
57
57
  #if DEBUG
58
- return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\\"index\\"];
58
+ return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
59
59
  #else
60
- return [[NSBundle mainBundle] URLForResource:@\\"main\\" withExtension:@\\"jsbundle\\"];
60
+ return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
61
61
  #endif
62
62
  }
63
63
 
@@ -105,7 +105,7 @@ exports[`appDelegateLinker should work for RN 0.68 1`] = `
105
105
  `;
106
106
 
107
107
  exports[`appDelegateLinker should work for RN 0.69 1`] = `
108
- "#import \\"AppDelegate.h\\"
108
+ "#import "AppDelegate.h"
109
109
  #import <ReactNativeNavigation/ReactNativeNavigation.h>
110
110
 
111
111
  #import <React/RCTBridge.h>
@@ -123,7 +123,7 @@ exports[`appDelegateLinker should work for RN 0.69 1`] = `
123
123
 
124
124
  #import <react/config/ReactNativeConfig.h>
125
125
 
126
- static NSString *const kRNConcurrentRoot = @\\"concurrentRoot\\";
126
+ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
127
127
 
128
128
  @interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
129
129
  RCTTurboModuleManager *_turboModuleManager;
@@ -146,7 +146,7 @@ static NSString *const kRNConcurrentRoot = @\\"concurrentRoot\\";
146
146
  #if RCT_NEW_ARCH_ENABLED
147
147
  _contextContainer = std::make_shared<facebook::react::ContextContainer const>();
148
148
  _reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
149
- _contextContainer->insert(\\"ReactNativeConfig\\", _reactNativeConfig);
149
+ _contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
150
150
  _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
151
151
  bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
152
152
  #endif
@@ -183,9 +183,9 @@ static NSString *const kRNConcurrentRoot = @\\"concurrentRoot\\";
183
183
  - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
184
184
  {
185
185
  #if DEBUG
186
- return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\\"index\\"];
186
+ return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
187
187
  #else
188
- return [[NSBundle mainBundle] URLForResource:@\\"main\\" withExtension:@\\"jsbundle\\"];
188
+ return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
189
189
  #endif
190
190
  }
191
191
 
@@ -233,7 +233,7 @@ static NSString *const kRNConcurrentRoot = @\\"concurrentRoot\\";
233
233
  `;
234
234
 
235
235
  exports[`appDelegateLinker should work for RN 0.71 1`] = `
236
- "#import \\"AppDelegate.h\\"
236
+ "#import "AppDelegate.h"
237
237
  #import <ReactNativeNavigation/ReactNativeNavigation.h>
238
238
 
239
239
  #import <React/RCTBundleURLProvider.h>
@@ -249,9 +249,9 @@ exports[`appDelegateLinker should work for RN 0.71 1`] = `
249
249
  - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
250
250
  {
251
251
  #if DEBUG
252
- return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\\"index\\"];
252
+ return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
253
253
  #else
254
- return [[NSBundle mainBundle] URLForResource:@\\"main\\" withExtension:@\\"jsbundle\\"];
254
+ return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
255
255
  #endif
256
256
  }
257
257
 
package/index.e2e.js CHANGED
@@ -1,4 +1,5 @@
1
+ import "setimmediate";
1
2
  import { LogBox } from 'react-native';
2
- LogBox.ignoreAllLogs();
3
3
 
4
+ LogBox.ignoreAllLogs();
4
5
  require('./playground/index');
@@ -25,7 +25,8 @@ export const ComponentScreen = connect(
25
25
  }
26
26
 
27
27
  isVisible(): boolean {
28
- return LayoutStore.isVisibleLayout(this.props.layoutNode);
28
+ const isVisible = LayoutStore.isVisibleLayout(this.props.layoutNode);
29
+ return isVisible;
29
30
  }
30
31
 
31
32
  renderTabBar() {
@@ -4,6 +4,7 @@ import { BottomTabs } from './BottomTabs';
4
4
  import { ComponentProps } from '../ComponentProps';
5
5
  import { ComponentScreen } from './ComponentScreen';
6
6
  import { Stack } from './Stack';
7
+ import { SideMenuRoot, SideMenuCenter, SideMenuLeft, SideMenuRight } from './SideMenu';
7
8
 
8
9
  export const LayoutComponent = class extends Component<ComponentProps> {
9
10
  render() {
@@ -14,6 +15,14 @@ export const LayoutComponent = class extends Component<ComponentProps> {
14
15
  return <Stack layoutNode={this.props.layoutNode} />;
15
16
  case 'Component':
16
17
  return <ComponentScreen layoutNode={this.props.layoutNode} />;
18
+ case 'SideMenuRoot':
19
+ return <SideMenuRoot layoutNode={this.props.layoutNode} />;
20
+ case 'SideMenuLeft':
21
+ return <SideMenuLeft layoutNode={this.props.layoutNode} />;
22
+ case 'SideMenuCenter':
23
+ return <SideMenuCenter layoutNode={this.props.layoutNode} />;
24
+ case 'SideMenuRight':
25
+ return <SideMenuRight layoutNode={this.props.layoutNode} />;
17
26
  }
18
27
 
19
28
  return <View />;
@@ -0,0 +1,27 @@
1
+ import React, { Component } from 'react';
2
+ import { connect } from '../connect';
3
+ import { ComponentProps } from '../ComponentProps';
4
+ import { LayoutComponent } from './LayoutComponent';
5
+ import ParentNode from '../Layouts/ParentNode';
6
+
7
+ export const SideMenuRoot = connect(
8
+ class extends Component<ComponentProps> {
9
+ render() {
10
+ const children = this.props.layoutNode.children;
11
+ return children.map((child: ParentNode) => {
12
+ return <LayoutComponent key={child.nodeId} layoutNode={child} />;
13
+ });
14
+ }
15
+ }
16
+ );
17
+
18
+ class SideMenuComponent extends Component<ComponentProps> {
19
+ render() {
20
+ const children = this.props.layoutNode.children;
21
+ const component = children[0];
22
+ return <LayoutComponent key={component.nodeId} layoutNode={component} />;
23
+ }
24
+ }
25
+ export const SideMenuLeft = connect(SideMenuComponent);
26
+ export const SideMenuCenter = connect(SideMenuComponent);
27
+ export const SideMenuRight = connect(SideMenuComponent);
@@ -10,8 +10,10 @@ export default class BottomTabsNode extends ParentNode {
10
10
  this.selectedIndex = layout.data?.options?.bottomTabs?.currentTabIndex || 0;
11
11
  }
12
12
 
13
- mergeOptions(options: Options) {
14
- super.mergeOptions(options);
13
+ mergeOptions(_options: Options) {
14
+ super.mergeOptions(_options);
15
+
16
+ const { options } = this.data;
15
17
  if (options.bottomTabs?.currentTabIndex) {
16
18
  this.selectedIndex = options.bottomTabs?.currentTabIndex;
17
19
  switchTabByIndex(this, this.selectedIndex);
@@ -2,6 +2,11 @@ import BottomTabs from './BottomTabsNode';
2
2
  import ComponentNode from './ComponentNode';
3
3
  import Stack from './StackNode';
4
4
  import ParentNode from './ParentNode';
5
+ import SideMenuRootNode, {
6
+ SideMenuLeftNode,
7
+ SideMenuRightNode,
8
+ SideMenuCenterNode,
9
+ } from './SideMenu';
5
10
 
6
11
  export default class LayoutNodeFactory {
7
12
  static create(layout: any, parentNode?: ParentNode) {
@@ -10,7 +15,15 @@ export default class LayoutNodeFactory {
10
15
  return new ComponentNode(layout, parentNode);
11
16
  case 'Stack':
12
17
  return new Stack(layout, parentNode);
13
- default:
18
+ case 'SideMenuRoot':
19
+ return new SideMenuRootNode(layout, parentNode);
20
+ case 'SideMenuLeft':
21
+ return new SideMenuLeftNode(layout, parentNode);
22
+ case 'SideMenuCenter':
23
+ return new SideMenuCenterNode(layout, parentNode);
24
+ case 'SideMenuRight':
25
+ return new SideMenuRightNode(layout, parentNode);
26
+ default: // TODO Undo
14
27
  case 'BottomTabs':
15
28
  return new BottomTabs(layout, parentNode);
16
29
  }
@@ -35,6 +35,10 @@ export default class ParentNode extends Node {
35
35
  return this;
36
36
  }
37
37
 
38
+ applyOptions(_options: Options) {
39
+ this.parentNode?.applyOptions(_options);
40
+ }
41
+
38
42
  mergeOptions(options: Options) {
39
43
  this.data.options = _.mergeWith(this.data.options, options, (objValue, srcValue, key) => {
40
44
  if (_.isArray(objValue)) {
@@ -0,0 +1,87 @@
1
+ import ParentNode from './ParentNode';
2
+ import ComponentNode from './ComponentNode';
3
+ import { Options } from '../../src/index';
4
+ import * as layoutActions from '../actions/layoutActions';
5
+ import { NodeType } from './Node';
6
+
7
+ const isCenterChild = (child: ParentNode) => child.type === 'SideMenuCenter';
8
+ const isLeftChild = (child: ParentNode) => child.type === 'SideMenuLeft';
9
+ const isRightChild = (child: ParentNode) => child.type === 'SideMenuRight';
10
+
11
+ export default class SideMenuRootNode extends ParentNode {
12
+ visibleChild: ParentNode;
13
+
14
+ constructor(layout: any, parentNode?: ParentNode) {
15
+ super(layout, 'SideMenuRoot', parentNode);
16
+
17
+ this.visibleChild = this._getCenterChild();
18
+ if (!this.visibleChild) {
19
+ throw new Error('SideMenuRootNode must have a SideMenuCenter child');
20
+ }
21
+ }
22
+
23
+ applyOptions(_options: Options) {
24
+ super.applyOptions(_options);
25
+
26
+ this._updateVisibility(_options);
27
+ }
28
+
29
+ mergeOptions(options: Options) {
30
+ super.mergeOptions(options);
31
+
32
+ this._updateVisibility(options);
33
+ }
34
+
35
+ /**
36
+ * @override
37
+ */
38
+ getVisibleLayout(): ComponentNode {
39
+ return this.visibleChild.getVisibleLayout();
40
+ }
41
+
42
+ _updateVisibility(options: Options) {
43
+ if (options.sideMenu) {
44
+ if (options.sideMenu.left?.visible) {
45
+ this.visibleChild = this._getLeftChild();
46
+ layoutActions.openSideMenu(this.visibleChild);
47
+ } else if (options.sideMenu.right?.visible) {
48
+ this.visibleChild = this._getRightChild();
49
+ layoutActions.openSideMenu(this.visibleChild);
50
+ } else {
51
+ this.visibleChild = this._getCenterChild();
52
+ layoutActions.closeSideMenu(this.visibleChild);
53
+ }
54
+ }
55
+ }
56
+
57
+ _getCenterChild = () => this.children.find(isCenterChild) as ParentNode;
58
+ _getLeftChild = () => this.children.find(isLeftChild) as ParentNode;
59
+ _getRightChild = () => this.children.find(isRightChild) as ParentNode;
60
+ }
61
+
62
+ export class SideMenuNode extends ParentNode {
63
+ constructor(layout: any, type: NodeType, parentNode?: ParentNode) {
64
+ super(layout, type, parentNode);
65
+ }
66
+
67
+ getVisibleLayout() {
68
+ return this.children[0].getVisibleLayout();
69
+ }
70
+ }
71
+
72
+ export class SideMenuLeftNode extends SideMenuNode {
73
+ constructor(layout: any, parentNode?: ParentNode) {
74
+ super(layout, 'SideMenuLeft', parentNode);
75
+ }
76
+ }
77
+ export class SideMenuRightNode extends SideMenuNode {
78
+ constructor(layout: any, parentNode?: ParentNode) {
79
+ super(layout, 'SideMenuRight', parentNode);
80
+ }
81
+ }
82
+
83
+ export class SideMenuCenterNode extends SideMenuNode {
84
+ constructor(layout: any, parentNode?: ParentNode) {
85
+ super(layout, 'SideMenuCenter', parentNode);
86
+ }
87
+ }
@@ -2,8 +2,9 @@ import _ from 'lodash';
2
2
  import BottomTabsNode from '../Layouts/BottomTabsNode';
3
3
  import ParentNode from '../Layouts/ParentNode';
4
4
  import LayoutNodeFactory from '../Layouts/LayoutNodeFactory';
5
- import { Options } from '../../src/interfaces/Options';
5
+ import { SideMenuNode } from '../Layouts/SideMenu';
6
6
  import StackNode from '../Layouts/StackNode';
7
+ import { Options } from '../../src/interfaces/Options';
7
8
 
8
9
  const remx = require('remx');
9
10
 
@@ -11,6 +12,7 @@ const state = remx.state({
11
12
  root: {},
12
13
  modals: [],
13
14
  overlays: [],
15
+ sideMenu: undefined,
14
16
  });
15
17
 
16
18
  const setters = remx.setters({
@@ -75,6 +77,23 @@ const setters = remx.setters({
75
77
  selectTabIndex(layout: BottomTabsNode, index: number) {
76
78
  getters.getLayoutById(layout.nodeId).selectedIndex = index;
77
79
  },
80
+ openSideMenu(layout: SideMenuNode) {
81
+ if (state.sideMenu) {
82
+ throw new Error(
83
+ 'A side-menu is already open; Mocked-testing of multiple side-menu scenarios is not supported yet.' +
84
+ ' You can submit a request in https://github.com/wix/react-native-navigation/issues/new/choose.'
85
+ );
86
+ }
87
+ state.sideMenu = layout;
88
+ },
89
+ closeSideMenu(_layout: SideMenuNode) {
90
+ state.sideMenu = undefined;
91
+ },
92
+ applyOptions(componentId: string, options: Options) {
93
+ const layout = getters.getLayoutById(componentId);
94
+ if (layout) layout.applyOptions(options);
95
+ else console.warn(`[RNN error] Merge options failure: cannot find layout for: ${componentId}`);
96
+ },
78
97
  mergeOptions(componentId: string, options: Options) {
79
98
  const layout = getters.getLayoutById(componentId);
80
99
  if (layout) layout.mergeOptions(options);
@@ -87,12 +106,26 @@ const getters = remx.getters({
87
106
  return state.root;
88
107
  },
89
108
  getVisibleLayout() {
109
+ let layout: ParentNode | undefined;
90
110
  if (state.modals.length > 0) {
91
- return _.last<ParentNode>(state.modals)!.getVisibleLayout();
92
- } else if (!_.isEqual(state.root, {})) return state.root.getVisibleLayout();
111
+ layout = _.last<ParentNode>(state.modals)!;
112
+ } else if (!_.isEqual(state.root, {})) {
113
+ layout = state.root;
114
+ }
115
+
116
+ // Note: While this logic should be fair for all use cases (i.e. even multiple side-menus across tabs),
117
+ // there is no current test case that justifies it. Nevertheless, it's required to pass the tests,
118
+ // because otherwise getVisibleLayout() would not be revisited whenever side-menus are opened/closed.
119
+ if (layout && state.sideMenu && findNode(state.sideMenu.nodeId, layout!)) {
120
+ layout = state.sideMenu.parentNode;
121
+ }
122
+
123
+ return layout?.getVisibleLayout();
93
124
  },
94
125
  isVisibleLayout(layout: ParentNode) {
95
- return getters.getVisibleLayout() && getters.getVisibleLayout().nodeId === layout.nodeId;
126
+ const nodeId = layout.nodeId;
127
+ const visibleLayout = getters.getVisibleLayout();
128
+ return visibleLayout?.nodeId === nodeId;
96
129
  },
97
130
  getModals() {
98
131
  return state.modals;
@@ -101,13 +134,12 @@ const getters = remx.getters({
101
134
  return state.overlays;
102
135
  },
103
136
  getLayoutById(layoutId: string) {
104
- if (getters.getModalById(layoutId))
105
- return findParentNode(layoutId, getters.getModalById(layoutId));
137
+ if (getters.getModalById(layoutId)) return findNode(layoutId, getters.getModalById(layoutId));
106
138
 
107
- return findParentNode(layoutId, state.root);
139
+ return findNode(layoutId, state.root);
108
140
  },
109
141
  getModalById(layoutId: string) {
110
- return _.find(state.modals, (layout) => findParentNode(layoutId, layout));
142
+ return _.find(state.modals, (layout) => findNode(layoutId, layout));
111
143
  },
112
144
  getLayoutChildren(layoutId: string) {
113
145
  return getters.getLayoutById(layoutId).children;
@@ -120,13 +152,13 @@ const getters = remx.getters({
120
152
  },
121
153
  });
122
154
 
123
- function findParentNode(layoutId: string, layout: ParentNode): any | ParentNode {
155
+ function findNode(layoutId: string, layout: ParentNode): any | ParentNode {
124
156
  if (layoutId === layout.nodeId) {
125
157
  return layout;
126
158
  } else if (layout.children) {
127
159
  for (let i = 0; i < layout.children.length; i += 1) {
128
160
  const child = layout.children[i];
129
- const result = findParentNode(layoutId, child);
161
+ const result = findNode(layoutId, child);
130
162
 
131
163
  if (result !== false) {
132
164
  return result;
@@ -1,4 +1,5 @@
1
1
  import ParentNode from '../Layouts/ParentNode';
2
+ import { SideMenuNode } from '../Layouts/SideMenu';
2
3
  import { LayoutStore } from '../Stores/LayoutStore';
3
4
 
4
5
  export const switchTabByIndex = (bottomTabs: ParentNode | undefined, index: number) => {
@@ -8,3 +9,13 @@ export const switchTabByIndex = (bottomTabs: ParentNode | undefined, index: numb
8
9
  LayoutStore.getVisibleLayout().componentDidAppear();
9
10
  }
10
11
  };
12
+
13
+ export const openSideMenu = (sideMenu: SideMenuNode) => {
14
+ LayoutStore.openSideMenu(sideMenu);
15
+ LayoutStore.getVisibleLayout().componentDidAppear();
16
+ };
17
+
18
+ export const closeSideMenu = (layout: SideMenuNode) => {
19
+ LayoutStore.getVisibleLayout().componentDidDisappear();
20
+ LayoutStore.closeSideMenu(layout);
21
+ };
@@ -39,6 +39,7 @@ export class NativeCommandsSender {
39
39
  const layoutNode = LayoutNodeFactory.create(layout, stack);
40
40
  stack.getVisibleLayout().componentDidDisappear();
41
41
  LayoutStore.push(layoutNode, stack);
42
+ LayoutStore.applyOptions(layoutNode.nodeId, layoutNode.data.options);
42
43
  stack.getVisibleLayout().componentDidAppear();
43
44
  resolve(stack.getVisibleLayout().nodeId);
44
45
  this.reportCommandCompletion(CommandName.Push, commandId);
@@ -3,28 +3,39 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
3
3
 
4
4
  apply plugin: 'com.android.library'
5
5
  apply plugin: 'kotlin-android'
6
+ apply plugin: "com.facebook.react"
7
+
8
+
9
+ react {
10
+ jsRootDir = file("../../src/")
11
+ libraryName = "rnnavigation"
12
+ codegenJavaPackageName = "com.reactnativenavigation.react"
13
+ }
14
+
6
15
 
7
16
  def safeExtGet(prop, fallback) {
8
17
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
9
18
  }
10
19
 
11
20
  def safeExtGetFallbackLowerBound(prop, fallback) {
12
- Math.max(safeExtGet(prop,fallback),fallback)
21
+ Math.max(safeExtGet(prop, fallback), fallback)
13
22
  }
14
23
 
15
- def DEFAULT_COMPILE_SDK_VERSION = 33
16
- def DEFAULT_MIN_SDK_VERSION = 21
17
- def DEFAULT_TARGET_SDK_VERSION = 33
24
+ def DEFAULT_COMPILE_SDK_VERSION = 35
25
+ def DEFAULT_MIN_SDK_VERSION = 24
26
+ def DEFAULT_TARGET_SDK_VERSION = 35
18
27
  def DEFAULT_KOTLIN_VERSION = "1.5.31"
19
28
  def DEFAULT_KOTLIN_STDLIB = 'kotlin-stdlib-jdk8'
29
+ def DEFAULT_BUILD_TOOLS_VERSION = "35.0.0"
20
30
  def kotlinVersion = safeExtGet("RNNKotlinVersion", DEFAULT_KOTLIN_VERSION)
21
- def kotlinStdlib = safeExtGet('RNNKotlinStdlib',DEFAULT_KOTLIN_STDLIB )
31
+ def kotlinStdlib = safeExtGet('RNNKotlinStdlib', DEFAULT_KOTLIN_STDLIB)
22
32
  def kotlinCoroutinesCore = safeExtGet('RNNKotlinCoroutinesCore', '1.5.2')
33
+ def _buildToolsVersion = safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
23
34
 
24
35
  android {
25
36
  namespace 'com.reactnativenavigation'
26
37
  compileSdkVersion safeExtGetFallbackLowerBound('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
27
- buildToolsVersion = "34.0.0"
38
+ buildToolsVersion = _buildToolsVersion
28
39
  defaultConfig {
29
40
  minSdkVersion safeExtGetFallbackLowerBound('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
30
41
  targetSdkVersion safeExtGetFallbackLowerBound('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
@@ -64,126 +75,12 @@ android {
64
75
  }
65
76
  }
66
77
  compileOptions {
67
- if (reactNativeMinorVersion() >= 73) {
68
- sourceCompatibility JavaVersion.VERSION_17
69
- targetCompatibility JavaVersion.VERSION_17
70
- } else {
71
- sourceCompatibility JavaVersion.VERSION_1_8
72
- targetCompatibility JavaVersion.VERSION_1_8
73
- }
78
+ sourceCompatibility JavaVersion.VERSION_17
79
+ targetCompatibility JavaVersion.VERSION_17
74
80
  }
75
81
  kotlinOptions {
76
- if (reactNativeMinorVersion() >= 73) {
77
- jvmTarget = JavaVersion.VERSION_17
78
- } else {
79
- jvmTarget = JavaVersion.VERSION_11
80
- }
82
+ jvmTarget = JavaVersion.VERSION_17
81
83
  }
82
-
83
- flavorDimensions "RNN.reactNativeVersion"
84
- productFlavors {
85
- reactNative51 {
86
- dimension "RNN.reactNativeVersion"
87
- buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "51")
88
- }
89
- reactNative55 {
90
- dimension "RNN.reactNativeVersion"
91
- buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "55")
92
- }
93
- reactNative56 {
94
- dimension "RNN.reactNativeVersion"
95
- buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "56")
96
- }
97
- reactNative57 {
98
- dimension "RNN.reactNativeVersion"
99
- buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "57")
100
- }
101
- reactNative57_5 {
102
- dimension "RNN.reactNativeVersion"
103
- buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "57")
104
- }
105
- reactNative60 {
106
- dimension "RNN.reactNativeVersion"
107
- buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "60")
108
- }
109
- reactNative62 {
110
- dimension "RNN.reactNativeVersion"
111
- buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "62")
112
- }
113
- reactNative63 {
114
- dimension "RNN.reactNativeVersion"
115
- buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "63")
116
- }
117
- reactNative68 {
118
- dimension "RNN.reactNativeVersion"
119
- buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "68")
120
- }
121
- reactNative71 {
122
- dimension "RNN.reactNativeVersion"
123
- buildConfigField("int", "REACT_NATVE_VERSION_MINOR", "71")
124
- }
125
- }
126
-
127
- def flavor = resolveFlavor()
128
- variantFilter { variant ->
129
- def names = variant.flavors*.name
130
- if (!names.contains(flavor)) {
131
- setIgnore(true)
132
- }
133
- }
134
- }
135
-
136
- int reactNativeMinorVersion() {
137
- List reactNativeVersionComponents = reactNativeVersionComponents(findReactNativePackageJson())
138
- reactNativeVersionComponents[1].toInteger()
139
- }
140
-
141
- String resolveFlavor() {
142
- List reactNativeVersionComponents = reactNativeVersionComponents(findReactNativePackageJson())
143
- Integer reactNativeMinorComponent = reactNativeVersionComponents[1].toInteger()
144
- Integer reactNativePatchComponent = reactNativeVersionComponents[2].toInteger()
145
-
146
- if (reactNativeMinorComponent >= 71) {
147
- return "reactNative71"
148
- } else if (reactNativeMinorComponent >= 68) {
149
- return "reactNative68"
150
- } else if (reactNativeMinorComponent >= 63) {
151
- return "reactNative63"
152
- } else if (reactNativeMinorComponent >= 62) {
153
- return "reactNative62"
154
- } else if (reactNativeMinorComponent >= 60) {
155
- return "reactNative60"
156
- } else if (reactNativeMinorComponent >= 57 && reactNativePatchComponent >= 5) {
157
- return "reactNative57_5"
158
- } else if (reactNativeMinorComponent >= 57) {
159
- return "reactNative57"
160
- } else if (reactNativeMinorComponent >= 56) {
161
- return "reactNative56"
162
- } else if (reactNativeMinorComponent >= 55) {
163
- return "reactNative55"
164
- } else if (reactNativeMinorComponent >= 51) {
165
- return "reactNative51"
166
- }
167
- }
168
-
169
-
170
- Object findReactNativePackageJson() {
171
- def searchPath = 'node_modules/react-native/package.json'
172
- def projectDir = project.projectDir.toString() + '/'
173
- def rnPackageJsonFile = new File(projectDir + searchPath)
174
- while (!rnPackageJsonFile.exists()) {
175
- searchPath = '../' + searchPath
176
- rnPackageJsonFile = new File(projectDir + searchPath)
177
- }
178
- return rnPackageJsonFile
179
- }
180
-
181
- List reactNativeVersionComponents(rnPackageJsonFile) {
182
- def packageSlurper = new JsonSlurper()
183
- def reactNativePackageJson = packageSlurper.parseText(rnPackageJsonFile.text)
184
- def reactNativeVersion = reactNativePackageJson.version
185
-
186
- return reactNativeVersion.tokenize('-')[0].tokenize('.')
187
84
  }
188
85
 
189
86
  dependencies {
@@ -193,7 +90,7 @@ dependencies {
193
90
  implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinCoroutinesCore"
194
91
  implementation "androidx.constraintlayout:constraintlayout:2.0.4"
195
92
 
196
- implementation 'androidx.appcompat:appcompat:1.3.1'
93
+ implementation 'androidx.appcompat:appcompat:1.7.0'
197
94
  implementation 'androidx.annotation:annotation:1.2.0'
198
95
  implementation 'com.google.android.material:material:1.2.0-alpha03'
199
96
 
@@ -205,7 +102,7 @@ dependencies {
205
102
  //noinspection GradleDynamicVersion
206
103
  implementation 'com.facebook.react:react-native:+'
207
104
 
208
- if("Playground".toLowerCase() == rootProject.name.toLowerCase()){
105
+ if ("Playground".toLowerCase() == rootProject.name.toLowerCase()) {
209
106
  // tests only for our playground
210
107
  testImplementation 'junit:junit:4.13.2'
211
108
  testImplementation "org.robolectric:robolectric:4.7.2"
@@ -3,11 +3,13 @@ package com.reactnativenavigation
3
3
  import androidx.annotation.VisibleForTesting
4
4
 
5
5
  enum class RNNToggles {
6
- TOP_BAR_COLOR_ANIMATION,
6
+ TOP_BAR_COLOR_ANIMATION__PUSH,
7
+ TOP_BAR_COLOR_ANIMATION__TABS,
7
8
  }
8
9
 
9
10
  private val ToggleDefaults = mapOf(
10
- RNNToggles.TOP_BAR_COLOR_ANIMATION to false
11
+ RNNToggles.TOP_BAR_COLOR_ANIMATION__PUSH to false,
12
+ RNNToggles.TOP_BAR_COLOR_ANIMATION__TABS to false,
11
13
  )
12
14
 
13
15
  object RNNFeatureToggles {
@@ -3,7 +3,6 @@ package com.reactnativenavigation;
3
3
  import android.annotation.TargetApi;
4
4
  import android.content.Intent;
5
5
  import android.content.res.Configuration;
6
- import android.graphics.Color;
7
6
  import android.os.Build;
8
7
  import android.os.Bundle;
9
8
  import android.view.KeyEvent;
@@ -12,8 +11,8 @@ import android.view.View;
12
11
  import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
13
12
  import com.facebook.react.modules.core.PermissionAwareActivity;
14
13
  import com.facebook.react.modules.core.PermissionListener;
15
- import com.reactnativenavigation.options.Options;
16
14
  import com.reactnativenavigation.viewcontrollers.overlay.OverlayManager;
15
+ import com.reactnativenavigation.viewcontrollers.statusbar.StatusBarPresenter;
17
16
  import com.reactnativenavigation.viewcontrollers.viewcontroller.RootPresenter;
18
17
  import com.reactnativenavigation.react.JsDevReloadHandler;
19
18
  import com.reactnativenavigation.react.ReactGateway;
@@ -51,6 +50,7 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
51
50
  navigator.bindViews();
52
51
  getReactGateway().onActivityCreated(this);
53
52
  setBackPressedCallback();
53
+ StatusBarPresenter.Companion.init(this);
54
54
  }
55
55
 
56
56
  @Override