react-native-navigation 8.0.0 → 8.1.0-alpha01
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.
- package/ReactNativeNavigation.podspec +13 -12
- package/lib/android/app/src/main/java/com/reactnativenavigation/NavigationApplication.java +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/LayoutFactory.java +13 -14
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java +4 -6
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationPackage.kt +5 -4
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationReactInitializer.java +20 -21
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/ReactComponentViewCreator.java +1 -7
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/ReactView.java +38 -28
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/modal/ModalFrameLayout.kt +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/react/modal/ModalLayoutController.kt +4 -6
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/externalcomponent/ExternalComponentCreator.java +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/externalcomponent/ExternalComponentViewController.java +2 -4
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/navigator/Navigator.java +2 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/RootPresenter.java +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/component/ComponentViewCreator.java +1 -8
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/TopBarBackgroundView.java +2 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/TopBarBackgroundViewCreator.java +1 -7
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleBarButtonCreator.java +1 -8
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleBarReactButtonView.java +3 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleBarReactViewCreator.java +1 -7
- package/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/ReactGateway.java +10 -11
- package/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt +8 -42
- package/lib/android/app/src/reactNative71/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleBarReactView.kt +2 -2
- package/lib/dist/src/adapters/NativeCommandsSender.js +3 -2
- package/lib/dist/src/adapters/NativeEventsReceiver.js +4 -2
- package/lib/dist/src/adapters/NativeRNNTurboEventEmitter.d.ts +7 -0
- package/lib/dist/src/adapters/NativeRNNTurboEventEmitter.js +13 -0
- package/lib/dist/src/adapters/NativeRNNTurboModule.d.ts +28 -0
- package/lib/dist/src/adapters/NativeRNNTurboModule.js +16 -0
- package/lib/dist/src/commands/Deprecations.js +2 -2
- package/lib/dist/src/components/Modal.js +11 -2
- package/lib/ios/{AnimatedImageView.m → AnimatedImageView.mm} +1 -1
- package/lib/ios/{AnimatedReactView.m → AnimatedReactView.mm} +8 -1
- package/lib/ios/{AnimatedTextView.m → AnimatedTextView.mm} +21 -1
- package/lib/ios/BoolParser.h +1 -1
- package/lib/ios/{BottomTabsBasePresenter.m → BottomTabsBasePresenter.mm} +1 -1
- package/lib/ios/ColorParser.h +1 -1
- package/lib/ios/Constants.h +8 -0
- package/lib/ios/{Constants.m → Constants.mm} +12 -0
- package/lib/ios/NumberParser.h +1 -1
- package/lib/ios/RNNAppDelegate.h +8 -15
- package/lib/ios/RNNAppDelegate.mm +78 -81
- package/lib/ios/{RNNBottomTabsController.m → RNNBottomTabsController.mm} +1 -1
- package/lib/ios/RNNBridgeEventEmitter.h +4 -0
- package/lib/ios/RNNBridgeEventEmitter.mm +7 -0
- package/lib/ios/RNNBridgeManager.mm +71 -71
- package/lib/ios/{RNNButtonBuilder.m → RNNButtonBuilder.mm} +2 -2
- package/lib/ios/{RNNButtonOptions.m → RNNButtonOptions.mm} +2 -2
- package/lib/ios/{RNNButtonsParser.m → RNNButtonsParser.mm} +1 -1
- package/lib/ios/RNNCommandsHandler.h +8 -2
- package/lib/ios/{RNNCommandsHandler.m → RNNCommandsHandler.mm} +29 -10
- package/lib/ios/{RNNComponentOptions.m → RNNComponentOptions.mm} +3 -2
- package/lib/ios/{RNNComponentPresenter.m → RNNComponentPresenter.mm} +1 -1
- package/lib/ios/{RNNComponentViewController.m → RNNComponentViewController.mm} +0 -4
- package/lib/ios/RNNCustomTitleView.h +14 -4
- package/lib/ios/{RNNCustomTitleView.m → RNNCustomTitleView.mm} +8 -2
- package/lib/ios/RNNDotIndicatorPresenter.h +1 -1
- package/lib/ios/RNNElementFinder.h +2 -0
- package/lib/ios/RNNElementFinder.mm +44 -0
- package/lib/ios/RNNEventEmitter.h +1 -2
- package/lib/ios/{RNNEventEmitter.m → RNNEventEmitter.mm} +1 -5
- package/lib/ios/RNNExternalComponentStore.h +5 -0
- package/lib/ios/{RNNExternalComponentStore.m → RNNExternalComponentStore.mm} +12 -0
- package/lib/ios/{RNNFontAttributesCreator.m → RNNFontAttributesCreator.mm} +1 -1
- package/lib/ios/{RNNIconBackgroundOptions.m → RNNIconBackgroundOptions.mm} +1 -1
- package/lib/ios/{RNNInsetsOptions.m → RNNInsetsOptions.mm} +2 -2
- package/lib/ios/RNNModalManager.h +6 -0
- package/lib/ios/{RNNModalManager.m → RNNModalManager.mm} +71 -2
- package/lib/ios/{RNNNavigationOptions.m → RNNNavigationOptions.mm} +1 -1
- package/lib/ios/{RNNPushAnimation.m → RNNPushAnimation.mm} +1 -1
- package/lib/ios/RNNReactButtonView.h +4 -0
- package/lib/ios/RNNReactButtonView.mm +29 -0
- package/lib/ios/RNNReactRootViewCreator.h +4 -0
- package/lib/ios/{RNNReactRootViewCreator.m → RNNReactRootViewCreator.mm} +31 -8
- package/lib/ios/RNNReactView.h +64 -12
- package/lib/ios/RNNReactView.mm +119 -15
- package/lib/ios/{RNNScreenTransition.m → RNNScreenTransition.mm} +3 -2
- package/lib/ios/RNNSideMenu/MMDrawerController/{MMDrawerController.m → MMDrawerController.mm} +1 -1
- package/lib/ios/{RNNSideMenuChildVC.h → RNNSideMenuChildViewController.h} +1 -1
- package/lib/ios/{RNNSideMenuChildVC.m → RNNSideMenuChildViewController.mm} +4 -3
- package/lib/ios/{RNNSideMenuPresenter.m → RNNSideMenuPresenter.mm} +3 -3
- package/lib/ios/{RNNSideMenuController.h → RNNSideMenuViewController.h} +5 -5
- package/lib/ios/{RNNSideMenuController.m → RNNSideMenuViewController.mm} +8 -8
- package/lib/ios/{RNNSplashScreen.h → RNNSplashScreenViewController.h} +1 -1
- package/lib/ios/{RNNSplashScreen.m → RNNSplashScreenViewController.mm} +5 -5
- package/lib/ios/RNNSplitViewController.h +0 -1
- package/lib/ios/{RNNStackPresenter.m → RNNStackPresenter.mm} +2 -1
- package/lib/ios/RNNUIBarButtonItem.h +7 -1
- package/lib/ios/{RNNUIBarButtonItem.m → RNNUIBarButtonItem.mm} +17 -25
- package/lib/ios/RNNUtils.h +1 -0
- package/lib/ios/{RNNUtils.m → RNNUtils.mm} +8 -0
- package/lib/ios/{RNNControllerFactory.h → RNNViewControllerFactory.h} +10 -1
- package/lib/ios/{RNNControllerFactory.m → RNNViewControllerFactory.mm} +37 -7
- package/lib/ios/ReactNativeNavigation.h +13 -6
- package/lib/ios/ReactNativeNavigation.mm +117 -0
- package/lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj +976 -1166
- package/lib/ios/ScreenAnimationController.h +27 -9
- package/lib/ios/ScreenAnimationController.mm +180 -0
- package/lib/ios/SharedElementAnimator.mm +98 -0
- package/lib/ios/SideMenuOpenMode.h +1 -1
- package/lib/ios/StackControllerDelegate.h +10 -0
- package/lib/ios/{StackControllerDelegate.m → StackControllerDelegate.mm} +45 -1
- package/lib/ios/{TopBarTitlePresenter.m → TopBarTitlePresenter.mm} +2 -3
- package/lib/ios/{TransitionOptions.m → TransitionOptions.mm} +3 -2
- package/lib/ios/TurboModules/RNNTurboCommandsHandler.h +13 -0
- package/lib/ios/TurboModules/RNNTurboCommandsHandler.mm +16 -0
- package/lib/ios/TurboModules/RNNTurboEventEmitter.h +14 -0
- package/lib/ios/TurboModules/RNNTurboEventEmitter.mm +22 -0
- package/lib/ios/TurboModules/RNNTurboManager.h +23 -0
- package/lib/ios/TurboModules/RNNTurboManager.mm +114 -0
- package/lib/ios/TurboModules/RNNTurboModule.h +8 -0
- package/lib/ios/TurboModules/RNNTurboModule.mm +177 -0
- package/lib/ios/UISplitViewController+RNNOptions.h +1 -1
- package/lib/ios/{UISplitViewController+RNNOptions.m → UISplitViewController+RNNOptions.mm} +0 -1
- package/lib/ios/UIViewController+SideMenuController.h +2 -2
- package/lib/ios/{UIViewController+SideMenuController.m → UIViewController+SideMenuController.mm} +3 -3
- package/lib/ios/UIViewController+SideMenuViewController.h +8 -0
- package/lib/ios/Utils/{UIView+Utils.m → UIView+Utils.mm} +14 -0
- package/lib/src/adapters/NativeCommandsSender.ts +4 -2
- package/lib/src/adapters/NativeEventsReceiver.ts +6 -5
- package/lib/src/adapters/NativeRNNTurboEventEmitter.ts +18 -0
- package/lib/src/adapters/NativeRNNTurboModule.ts +47 -0
- package/lib/src/commands/Deprecations.ts +1 -1
- package/lib/src/components/Modal.tsx +23 -4
- package/metro.config.js +0 -1
- package/package.json +34 -6
- package/lib/ios/RNNElementFinder.m +0 -12
- package/lib/ios/RNNReactButtonView.m +0 -41
- package/lib/ios/RNNSwizzles.h +0 -13
- package/lib/ios/RNNSwizzles.m +0 -97
- package/lib/ios/ReactNativeNavigation.m +0 -85
- package/lib/ios/ScreenAnimationController.m +0 -139
- package/lib/ios/SharedElementAnimator.m +0 -83
- /package/lib/ios/{AnchorTransition.m → AnchorTransition.mm} +0 -0
- /package/lib/ios/{AnimatedUIImageView.m → AnimatedUIImageView.mm} +0 -0
- /package/lib/ios/{AnimatedViewFactory.m → AnimatedViewFactory.mm} +0 -0
- /package/lib/ios/{AnimationObserver.m → AnimationObserver.mm} +0 -0
- /package/lib/ios/{BaseAnimator.m → BaseAnimator.mm} +0 -0
- /package/lib/ios/{Bool.m → Bool.mm} +0 -0
- /package/lib/ios/{BoolParser.m → BoolParser.mm} +0 -0
- /package/lib/ios/{BottomTabPresenter.m → BottomTabPresenter.mm} +0 -0
- /package/lib/ios/{BottomTabPresenterCreator.m → BottomTabPresenterCreator.mm} +0 -0
- /package/lib/ios/{BottomTabsAfterInitialTabAttacher.m → BottomTabsAfterInitialTabAttacher.mm} +0 -0
- /package/lib/ios/{BottomTabsAppearancePresenter.m → BottomTabsAppearancePresenter.mm} +0 -0
- /package/lib/ios/{BottomTabsAttachMode.m → BottomTabsAttachMode.mm} +0 -0
- /package/lib/ios/{BottomTabsAttachModeFactory.m → BottomTabsAttachModeFactory.mm} +0 -0
- /package/lib/ios/{BottomTabsBaseAttacher.m → BottomTabsBaseAttacher.mm} +0 -0
- /package/lib/ios/{BottomTabsOnSwitchToTabAttacher.m → BottomTabsOnSwitchToTabAttacher.mm} +0 -0
- /package/lib/ios/{BottomTabsPresenterCreator.m → BottomTabsPresenterCreator.mm} +0 -0
- /package/lib/ios/{BottomTabsTogetherAttacher.m → BottomTabsTogetherAttacher.mm} +0 -0
- /package/lib/ios/{BoundsTransition.m → BoundsTransition.mm} +0 -0
- /package/lib/ios/{CenterTransition.m → CenterTransition.mm} +0 -0
- /package/lib/ios/{Color+Interpolation.m → Color+Interpolation.mm} +0 -0
- /package/lib/ios/{Color.m → Color.mm} +0 -0
- /package/lib/ios/{ColorParser.m → ColorParser.mm} +0 -0
- /package/lib/ios/{ColorTransition.m → ColorTransition.mm} +0 -0
- /package/lib/ios/{CornerRadiusTransition.m → CornerRadiusTransition.mm} +0 -0
- /package/lib/ios/{DeprecationOptions.m → DeprecationOptions.mm} +0 -0
- /package/lib/ios/{DictionaryParser.m → DictionaryParser.mm} +0 -0
- /package/lib/ios/{DisplayLinkAnimator.m → DisplayLinkAnimator.mm} +0 -0
- /package/lib/ios/{DotIndicatorOptions.m → DotIndicatorOptions.mm} +0 -0
- /package/lib/ios/{DotIndicatorParser.m → DotIndicatorParser.mm} +0 -0
- /package/lib/ios/{Double.m → Double.mm} +0 -0
- /package/lib/ios/{DoubleParser.m → DoubleParser.mm} +0 -0
- /package/lib/ios/{ElementAlphaTransition.m → ElementAlphaTransition.mm} +0 -0
- /package/lib/ios/{ElementAnimator.m → ElementAnimator.mm} +0 -0
- /package/lib/ios/{ElementBaseTransition.m → ElementBaseTransition.mm} +0 -0
- /package/lib/ios/{ElementFrameTransition.m → ElementFrameTransition.mm} +0 -0
- /package/lib/ios/{ElementHorizontalTransition.m → ElementHorizontalTransition.mm} +0 -0
- /package/lib/ios/{ElementTransitionOptions.m → ElementTransitionOptions.mm} +0 -0
- /package/lib/ios/{ElementTransitionsCreator.m → ElementTransitionsCreator.mm} +0 -0
- /package/lib/ios/{ElementVerticalTransition.m → ElementVerticalTransition.mm} +0 -0
- /package/lib/ios/{Enum.m → Enum.mm} +0 -0
- /package/lib/ios/{EnumParser.m → EnumParser.mm} +0 -0
- /package/lib/ios/{FloatTransition.m → FloatTransition.mm} +0 -0
- /package/lib/ios/{HorizontalScaleTransition.m → HorizontalScaleTransition.mm} +0 -0
- /package/lib/ios/{HorizontalTranslationTransition.m → HorizontalTranslationTransition.mm} +0 -0
- /package/lib/ios/{Image.m → Image.mm} +0 -0
- /package/lib/ios/{ImageParser.m → ImageParser.mm} +0 -0
- /package/lib/ios/{IntNumber.m → IntNumber.mm} +0 -0
- /package/lib/ios/{IntNumberParser.m → IntNumberParser.mm} +0 -0
- /package/lib/ios/{InteractivePopGestureDelegate.m → InteractivePopGestureDelegate.mm} +0 -0
- /package/lib/ios/Interpolators/{AccelerateDecelerateInterpolator.m → AccelerateDecelerateInterpolator.mm} +0 -0
- /package/lib/ios/Interpolators/{AccelerateInterpolator.m → AccelerateInterpolator.mm} +0 -0
- /package/lib/ios/Interpolators/{DecelerateAccelerateInterpolator.m → DecelerateAccelerateInterpolator.mm} +0 -0
- /package/lib/ios/Interpolators/{DecelerateInterpolator.m → DecelerateInterpolator.mm} +0 -0
- /package/lib/ios/Interpolators/{FastOutSlowIn.m → FastOutSlowIn.mm} +0 -0
- /package/lib/ios/Interpolators/{LinearInterpolator.m → LinearInterpolator.mm} +0 -0
- /package/lib/ios/Interpolators/{OvershootInterpolator.m → OvershootInterpolator.mm} +0 -0
- /package/lib/ios/Interpolators/{SpringInterpolator.m → SpringInterpolator.mm} +0 -0
- /package/lib/ios/{LNInterpolable.m → LNInterpolable.mm} +0 -0
- /package/lib/ios/{NSArray+utils.m → NSArray+utils.mm} +0 -0
- /package/lib/ios/{NoColor.m → NoColor.mm} +0 -0
- /package/lib/ios/{NullBool.m → NullBool.mm} +0 -0
- /package/lib/ios/{NullColor.m → NullColor.mm} +0 -0
- /package/lib/ios/{NullDictionary.m → NullDictionary.mm} +0 -0
- /package/lib/ios/{NullDouble.m → NullDouble.mm} +0 -0
- /package/lib/ios/{NullEnum.m → NullEnum.mm} +0 -0
- /package/lib/ios/{NullImage.m → NullImage.mm} +0 -0
- /package/lib/ios/{NullIntNumber.m → NullIntNumber.mm} +0 -0
- /package/lib/ios/{NullNumber.m → NullNumber.mm} +0 -0
- /package/lib/ios/{NullText.m → NullText.mm} +0 -0
- /package/lib/ios/{Number.m → Number.mm} +0 -0
- /package/lib/ios/{NumberParser.m → NumberParser.mm} +0 -0
- /package/lib/ios/{OptionsArrayParser.m → OptionsArrayParser.mm} +0 -0
- /package/lib/ios/{Param.m → Param.mm} +0 -0
- /package/lib/ios/{PathTransition.m → PathTransition.mm} +0 -0
- /package/lib/ios/{RCTConvert+Interpolation.m → RCTConvert+Interpolation.mm} +0 -0
- /package/lib/ios/{RCTConvert+SideMenuOpenGestureMode.m → RCTConvert+SideMenuOpenGestureMode.mm} +0 -0
- /package/lib/ios/{RCTConvert+UIBarButtonSystemItem.m → RCTConvert+UIBarButtonSystemItem.mm} +0 -0
- /package/lib/ios/{RCTConvert+UIFontWeight.m → RCTConvert+UIFontWeight.mm} +0 -0
- /package/lib/ios/{RCTHelpers.m → RCTHelpers.mm} +0 -0
- /package/lib/ios/{RNNAnimationsOptions.m → RNNAnimationsOptions.mm} +0 -0
- /package/lib/ios/{RNNBackButtonOptions.m → RNNBackButtonOptions.mm} +0 -0
- /package/lib/ios/{RNNBackgroundOptions.m → RNNBackgroundOptions.mm} +0 -0
- /package/lib/ios/{RNNBaseIconCreator.m → RNNBaseIconCreator.mm} +0 -0
- /package/lib/ios/{RNNBasePresenter.m → RNNBasePresenter.mm} +0 -0
- /package/lib/ios/{RNNBottomTabOptions.m → RNNBottomTabOptions.mm} +0 -0
- /package/lib/ios/{RNNBottomTabsOptions.m → RNNBottomTabsOptions.mm} +0 -0
- /package/lib/ios/{RNNBottomTabsPresenter.m → RNNBottomTabsPresenter.mm} +0 -0
- /package/lib/ios/{RNNBridgeModule.m → RNNBridgeModule.mm} +0 -0
- /package/lib/ios/{RNNButtonsPresenter.m → RNNButtonsPresenter.mm} +0 -0
- /package/lib/ios/{RNNComponentRootView.m → RNNComponentRootView.mm} +0 -0
- /package/lib/ios/{RNNComponentView.m → RNNComponentView.mm} +0 -0
- /package/lib/ios/{RNNConvert.m → RNNConvert.mm} +0 -0
- /package/lib/ios/{RNNDefaultOptionsHelper.m → RNNDefaultOptionsHelper.mm} +0 -0
- /package/lib/ios/{RNNDictionary.m → RNNDictionary.mm} +0 -0
- /package/lib/ios/{RNNDotIndicatorPresenter.m → RNNDotIndicatorPresenter.mm} +0 -0
- /package/lib/ios/{RNNDynamicIconCreator.m → RNNDynamicIconCreator.mm} +0 -0
- /package/lib/ios/{RNNElement.m → RNNElement.mm} +0 -0
- /package/lib/ios/{RNNElementView.m → RNNElementView.mm} +0 -0
- /package/lib/ios/{RNNEnterExitAnimation.m → RNNEnterExitAnimation.mm} +0 -0
- /package/lib/ios/{RNNErrorHandler.m → RNNErrorHandler.mm} +0 -0
- /package/lib/ios/{RNNExternalViewController.m → RNNExternalViewController.mm} +0 -0
- /package/lib/ios/{RNNIconCreator.m → RNNIconCreator.mm} +0 -0
- /package/lib/ios/{RNNIconDrawer.m → RNNIconDrawer.mm} +0 -0
- /package/lib/ios/{RNNInterpolator.m → RNNInterpolator.mm} +0 -0
- /package/lib/ios/{RNNLargeTitleOptions.m → RNNLargeTitleOptions.mm} +0 -0
- /package/lib/ios/{RNNLayoutInfo.m → RNNLayoutInfo.mm} +0 -0
- /package/lib/ios/{RNNLayoutManager.m → RNNLayoutManager.mm} +0 -0
- /package/lib/ios/{RNNLayoutNode.m → RNNLayoutNode.mm} +0 -0
- /package/lib/ios/{RNNLayoutOptions.m → RNNLayoutOptions.mm} +0 -0
- /package/lib/ios/{RNNModalHostViewManagerHandler.m → RNNModalHostViewManagerHandler.mm} +0 -0
- /package/lib/ios/{RNNModalManagerEventHandler.m → RNNModalManagerEventHandler.mm} +0 -0
- /package/lib/ios/{RNNModalOptions.m → RNNModalOptions.mm} +0 -0
- /package/lib/ios/{RNNOptions.m → RNNOptions.mm} +0 -0
- /package/lib/ios/{RNNOverlayManager.m → RNNOverlayManager.mm} +0 -0
- /package/lib/ios/{RNNOverlayOptions.m → RNNOverlayOptions.mm} +0 -0
- /package/lib/ios/{RNNOverlayWindow.m → RNNOverlayWindow.mm} +0 -0
- /package/lib/ios/{RNNPreviewOptions.m → RNNPreviewOptions.mm} +0 -0
- /package/lib/ios/{RNNReactBackgroundView.m → RNNReactBackgroundView.mm} +0 -0
- /package/lib/ios/{RNNReactComponentRegistry.m → RNNReactComponentRegistry.mm} +0 -0
- /package/lib/ios/{RNNReactTitleView.m → RNNReactTitleView.mm} +0 -0
- /package/lib/ios/{RNNScreenTransitionsCreator.m → RNNScreenTransitionsCreator.mm} +0 -0
- /package/lib/ios/{RNNScrollEdgeAppearanceBackgroundOptions.m → RNNScrollEdgeAppearanceBackgroundOptions.mm} +0 -0
- /package/lib/ios/{RNNScrollEdgeAppearanceOptions.m → RNNScrollEdgeAppearanceOptions.mm} +0 -0
- /package/lib/ios/{RNNSearchBarOptions.m → RNNSearchBarOptions.mm} +0 -0
- /package/lib/ios/{RNNSegmentedControl.m → RNNSegmentedControl.mm} +0 -0
- /package/lib/ios/{RNNSetRootAnimator.m → RNNSetRootAnimator.mm} +0 -0
- /package/lib/ios/{RNNShadowOptions.m → RNNShadowOptions.mm} +0 -0
- /package/lib/ios/{RNNSharedElementAnimationOptions.m → RNNSharedElementAnimationOptions.mm} +0 -0
- /package/lib/ios/RNNSideMenu/MMDrawerController/{MMDrawerBarButtonItem.m → MMDrawerBarButtonItem.mm} +0 -0
- /package/lib/ios/RNNSideMenu/MMDrawerController/{MMDrawerVisualState.m → MMDrawerVisualState.mm} +0 -0
- /package/lib/ios/RNNSideMenu/MMDrawerController/{MMExampleDrawerVisualStateManager.m → MMExampleDrawerVisualStateManager.mm} +0 -0
- /package/lib/ios/RNNSideMenu/MMDrawerController/{UIViewController+MMDrawerController.m → UIViewController+MMDrawerController.mm} +0 -0
- /package/lib/ios/{RNNSideMenuOptions.m → RNNSideMenuOptions.mm} +0 -0
- /package/lib/ios/{RNNSideMenuSideOptions.m → RNNSideMenuSideOptions.mm} +0 -0
- /package/lib/ios/{RNNSplitViewController.m → RNNSplitViewController.mm} +0 -0
- /package/lib/ios/{RNNSplitViewControllerPresenter.m → RNNSplitViewControllerPresenter.mm} +0 -0
- /package/lib/ios/{RNNSplitViewOptions.m → RNNSplitViewOptions.mm} +0 -0
- /package/lib/ios/{RNNStackController.m → RNNStackController.mm} +0 -0
- /package/lib/ios/{RNNStatusBarOptions.m → RNNStatusBarOptions.mm} +0 -0
- /package/lib/ios/{RNNSubtitleOptions.m → RNNSubtitleOptions.mm} +0 -0
- /package/lib/ios/{RNNTabBarItemCreator.m → RNNTabBarItemCreator.mm} +0 -0
- /package/lib/ios/{RNNTitleOptions.m → RNNTitleOptions.mm} +0 -0
- /package/lib/ios/{RNNTitleViewHelper.m → RNNTitleViewHelper.mm} +0 -0
- /package/lib/ios/{RNNTopBarOptions.m → RNNTopBarOptions.mm} +0 -0
- /package/lib/ios/{RNNTopTabOptions.m → RNNTopTabOptions.mm} +0 -0
- /package/lib/ios/{RNNTopTabsOptions.m → RNNTopTabsOptions.mm} +0 -0
- /package/lib/ios/{RNNTopTabsViewController.m → RNNTopTabsViewController.mm} +0 -0
- /package/lib/ios/{RNNTransitionStateHolder.m → RNNTransitionStateHolder.mm} +0 -0
- /package/lib/ios/{RNNUIBarBackButtonItem.m → RNNUIBarBackButtonItem.mm} +0 -0
- /package/lib/ios/{RNNViewLocation.m → RNNViewLocation.mm} +0 -0
- /package/lib/ios/{RectTransition.m → RectTransition.mm} +0 -0
- /package/lib/ios/{RotationTransition.m → RotationTransition.mm} +0 -0
- /package/lib/ios/{ScreenReversedAnimationController.m → ScreenReversedAnimationController.mm} +0 -0
- /package/lib/ios/{SharedElementTransition.m → SharedElementTransition.mm} +0 -0
- /package/lib/ios/{SharedElementTransitionOptions.m → SharedElementTransitionOptions.mm} +0 -0
- /package/lib/ios/{SideMenuOpenGestureModeParser.m → SideMenuOpenGestureModeParser.mm} +0 -0
- /package/lib/ios/{SideMenuOpenMode.m → SideMenuOpenMode.mm} +0 -0
- /package/lib/ios/{TabBarItemAppearanceCreator.m → TabBarItemAppearanceCreator.mm} +0 -0
- /package/lib/ios/{TabBarItemIOS15Creator.m → TabBarItemIOS15Creator.mm} +0 -0
- /package/lib/ios/{Text.m → Text.mm} +0 -0
- /package/lib/ios/{TextParser.m → TextParser.mm} +0 -0
- /package/lib/ios/{TextStorageTransition.m → TextStorageTransition.mm} +0 -0
- /package/lib/ios/{TimeInterval.m → TimeInterval.mm} +0 -0
- /package/lib/ios/{TimeIntervalParser.m → TimeIntervalParser.mm} +0 -0
- /package/lib/ios/{TopBarAppearancePresenter.m → TopBarAppearancePresenter.mm} +0 -0
- /package/lib/ios/{TopBarPresenter.m → TopBarPresenter.mm} +0 -0
- /package/lib/ios/{TopBarPresenterCreator.m → TopBarPresenterCreator.mm} +0 -0
- /package/lib/ios/{TransformRectTransition.m → TransformRectTransition.mm} +0 -0
- /package/lib/ios/{Transition.m → Transition.mm} +0 -0
- /package/lib/ios/{TransitionDetailsOptions.m → TransitionDetailsOptions.mm} +0 -0
- /package/lib/ios/{UIImage+utils.m → UIImage+utils.mm} +0 -0
- /package/lib/ios/{UIImageView+Transition.m → UIImageView+Transition.mm} +0 -0
- /package/lib/ios/{UINavigationController+RNNCommands.m → UINavigationController+RNNCommands.mm} +0 -0
- /package/lib/ios/{UINavigationController+RNNOptions.m → UINavigationController+RNNOptions.mm} +0 -0
- /package/lib/ios/{UITabBar+utils.m → UITabBar+utils.mm} +0 -0
- /package/lib/ios/{UITabBarController+RNNOptions.m → UITabBarController+RNNOptions.mm} +0 -0
- /package/lib/ios/{UIViewController+LayoutProtocol.m → UIViewController+LayoutProtocol.mm} +0 -0
- /package/lib/ios/{UIViewController+RNNOptions.m → UIViewController+RNNOptions.mm} +0 -0
- /package/lib/ios/Utils/{UIColor+RNNUtils.m → UIColor+RNNUtils.mm} +0 -0
- /package/lib/ios/Utils/{UITabBarController+RNNUtils.m → UITabBarController+RNNUtils.mm} +0 -0
- /package/lib/ios/Utils/{UIViewController+Utils.m → UIViewController+Utils.mm} +0 -0
- /package/lib/ios/{VICMAImageView.m → VICMAImageView.mm} +0 -0
- /package/lib/ios/{VerticalRotationTransition.m → VerticalRotationTransition.mm} +0 -0
- /package/lib/ios/{VerticalScaleTransition.m → VerticalScaleTransition.mm} +0 -0
- /package/lib/ios/{VerticalTranslationTransition.m → VerticalTranslationTransition.mm} +0 -0
- /package/lib/ios/{WindowOptions.m → WindowOptions.mm} +0 -0
|
@@ -19,23 +19,21 @@ Pod::Spec.new do |s|
|
|
|
19
19
|
|
|
20
20
|
s.subspec 'Core' do |ss|
|
|
21
21
|
s.source = { :git => "https://github.com/wix/react-native-navigation.git", :tag => "#{s.version}" }
|
|
22
|
-
s.source_files
|
|
22
|
+
s.source_files = 'lib/ios/**/*.{h,m,mm,cpp}'
|
|
23
23
|
s.exclude_files = "lib/ios/ReactNativeNavigationTests/**/*.*", "lib/ios/OCMock/**/*.*"
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
30
|
-
fabric_flags = fabric_enabled ? '-DRCT_NEW_ARCH_ENABLED' : ''
|
|
31
|
-
|
|
32
|
-
s.pod_target_xcconfig = {
|
|
26
|
+
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DFOLLY_CFG_NO_COROUTINES=1'
|
|
27
|
+
s.pod_target_xcconfig = {
|
|
33
28
|
'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/RCT-Folly" "$(PODS_ROOT)/Headers/Private/React-Core" "$(PODS_ROOT)/Headers/Private/Yoga"',
|
|
34
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++
|
|
29
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
35
30
|
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
36
|
-
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if fabric_enabled
|
|
34
|
+
install_modules_dependencies(s)
|
|
37
35
|
|
|
38
|
-
s.compiler_flags = folly_compiler_flags + ' ' + '-DRCT_NEW_ARCH_ENABLED'
|
|
36
|
+
s.compiler_flags = folly_compiler_flags + ' ' + '-DRCT_NEW_ARCH_ENABLED' + ' ' + '-DUSE_HERMES=1'
|
|
39
37
|
s.requires_arc = true
|
|
40
38
|
|
|
41
39
|
s.dependency "React"
|
|
@@ -46,9 +44,12 @@ Pod::Spec.new do |s|
|
|
|
46
44
|
s.dependency "RCT-Folly"
|
|
47
45
|
s.dependency "RCTRequired"
|
|
48
46
|
s.dependency "RCTTypeSafety"
|
|
49
|
-
s.dependency "ReactCommon
|
|
47
|
+
s.dependency "ReactCommon"
|
|
50
48
|
s.dependency "React-runtimeexecutor"
|
|
51
49
|
s.dependency "React-rncore"
|
|
50
|
+
s.dependency "React-RuntimeCore"
|
|
51
|
+
else
|
|
52
|
+
s.compiler_flags = folly_compiler_flags
|
|
52
53
|
end
|
|
53
54
|
|
|
54
55
|
s.dependency 'React-Core'
|
|
@@ -53,7 +53,7 @@ public abstract class NavigationApplication extends Application implements React
|
|
|
53
53
|
* @return a singleton {@link ReactGateway}
|
|
54
54
|
*/
|
|
55
55
|
protected ReactGateway createReactGateway() {
|
|
56
|
-
return new ReactGateway(getReactNativeHost());
|
|
56
|
+
return new ReactGateway(getReactHost(), getReactNativeHost().getUseDeveloperSupport());
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
public ReactGateway getReactGateway() {
|
|
@@ -3,6 +3,7 @@ package com.reactnativenavigation.options;
|
|
|
3
3
|
import android.app.Activity;
|
|
4
4
|
import android.content.Context;
|
|
5
5
|
|
|
6
|
+
import com.facebook.react.ReactHost;
|
|
6
7
|
import com.facebook.react.ReactInstanceManager;
|
|
7
8
|
import com.facebook.react.bridge.ReactContext;
|
|
8
9
|
import com.reactnativenavigation.NavigationApplication;
|
|
@@ -50,23 +51,22 @@ import static com.reactnativenavigation.utils.CollectionUtils.*;
|
|
|
50
51
|
import org.json.JSONObject;
|
|
51
52
|
|
|
52
53
|
public class LayoutFactory {
|
|
53
|
-
|
|
54
|
+
private final ReactHost reactHost;
|
|
55
|
+
private Activity activity;
|
|
54
56
|
private ChildControllersRegistry childRegistry;
|
|
55
|
-
private final ReactInstanceManager reactInstanceManager;
|
|
56
57
|
private EventEmitter eventEmitter;
|
|
57
58
|
private Map<String, ExternalComponentCreator> externalComponentCreators;
|
|
58
59
|
private @NonNull Options defaultOptions = new Options();
|
|
59
60
|
private TypefaceLoader typefaceManager;
|
|
61
|
+
|
|
62
|
+
public LayoutFactory(ReactHost reactHost) {
|
|
63
|
+
this.reactHost = reactHost;
|
|
64
|
+
}
|
|
60
65
|
|
|
61
66
|
public void setDefaultOptions(@NonNull Options defaultOptions) {
|
|
62
67
|
Assertions.assertNotNull(defaultOptions);
|
|
63
68
|
this.defaultOptions = defaultOptions;
|
|
64
69
|
}
|
|
65
|
-
|
|
66
|
-
public LayoutFactory(final ReactInstanceManager reactInstanceManager) {
|
|
67
|
-
this.reactInstanceManager = reactInstanceManager;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
70
|
public void init(Activity activity, EventEmitter eventEmitter, ChildControllersRegistry childRegistry, Map<String, ExternalComponentCreator> externalComponentCreators) {
|
|
71
71
|
this.activity = activity;
|
|
72
72
|
this.eventEmitter = eventEmitter;
|
|
@@ -76,7 +76,7 @@ public class LayoutFactory {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
public ViewController<?> create(final LayoutNode node) {
|
|
79
|
-
final ReactContext context =
|
|
79
|
+
final ReactContext context = reactHost.getCurrentReactContext();
|
|
80
80
|
switch (node.type) {
|
|
81
81
|
case Component:
|
|
82
82
|
return createComponent(node);
|
|
@@ -164,7 +164,7 @@ public class LayoutFactory {
|
|
|
164
164
|
childRegistry,
|
|
165
165
|
id,
|
|
166
166
|
name,
|
|
167
|
-
new ComponentViewCreator(
|
|
167
|
+
new ComponentViewCreator(),
|
|
168
168
|
parseOptions(node.getOptions()),
|
|
169
169
|
new Presenter(activity, defaultOptions),
|
|
170
170
|
new ComponentPresenter(defaultOptions)
|
|
@@ -179,7 +179,6 @@ public class LayoutFactory {
|
|
|
179
179
|
new Presenter(activity, defaultOptions),
|
|
180
180
|
externalComponent,
|
|
181
181
|
externalComponentCreators.get(externalComponent.name.get()),
|
|
182
|
-
reactInstanceManager,
|
|
183
182
|
new EventEmitter(context),
|
|
184
183
|
new ExternalComponentPresenter(),
|
|
185
184
|
parseOptions(node.getOptions())
|
|
@@ -194,9 +193,9 @@ public class LayoutFactory {
|
|
|
194
193
|
.setId(node.id)
|
|
195
194
|
.setInitialOptions(parseOptions(node.getOptions()))
|
|
196
195
|
.setStackPresenter(new StackPresenter(activity,
|
|
197
|
-
new TitleBarReactViewCreator(
|
|
198
|
-
new TopBarBackgroundViewCreator(
|
|
199
|
-
new TitleBarButtonCreator(
|
|
196
|
+
new TitleBarReactViewCreator(),
|
|
197
|
+
new TopBarBackgroundViewCreator(),
|
|
198
|
+
new TitleBarButtonCreator(),
|
|
200
199
|
new IconResolver(activity, new ImageLoader()),
|
|
201
200
|
new TypefaceLoader(activity),
|
|
202
201
|
new RenderChecker(),
|
|
@@ -243,7 +242,7 @@ public class LayoutFactory {
|
|
|
243
242
|
}
|
|
244
243
|
|
|
245
244
|
private Options parseOptions(JSONObject jsonOptions) {
|
|
246
|
-
Context context =
|
|
245
|
+
Context context = reactHost.getCurrentReactContext();
|
|
247
246
|
if (context == null) {
|
|
248
247
|
context = activity == null ? NavigationApplication.instance : activity;
|
|
249
248
|
}
|
|
@@ -40,19 +40,17 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
|
40
40
|
private static final String NAME = "RNNBridgeModule";
|
|
41
41
|
|
|
42
42
|
private final Now now = new Now();
|
|
43
|
-
private final ReactInstanceManager reactInstanceManager;
|
|
44
43
|
private final JSONParser jsonParser;
|
|
45
44
|
private final LayoutFactory layoutFactory;
|
|
46
45
|
private EventEmitter eventEmitter;
|
|
47
46
|
|
|
48
47
|
@SuppressWarnings("WeakerAccess")
|
|
49
|
-
public NavigationModule(ReactApplicationContext reactContext,
|
|
50
|
-
this(reactContext,
|
|
48
|
+
public NavigationModule(ReactApplicationContext reactContext, LayoutFactory layoutFactory) {
|
|
49
|
+
this(reactContext, new JSONParser(), layoutFactory);
|
|
51
50
|
}
|
|
52
51
|
|
|
53
|
-
public NavigationModule(ReactApplicationContext reactContext,
|
|
52
|
+
public NavigationModule(ReactApplicationContext reactContext, JSONParser jsonParser, LayoutFactory layoutFactory) {
|
|
54
53
|
super(reactContext);
|
|
55
|
-
this.reactInstanceManager = reactInstanceManager;
|
|
56
54
|
this.jsonParser = jsonParser;
|
|
57
55
|
this.layoutFactory = layoutFactory;
|
|
58
56
|
reactContext.addLifecycleEventListener(new LifecycleEventListenerAdapter() {
|
|
@@ -116,7 +114,7 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
|
116
114
|
final LayoutNode layoutTree = LayoutNodeParser.parse(Objects.requireNonNull(jsonParser.parse(rawLayoutTree).optJSONObject("root")));
|
|
117
115
|
handle(() -> {
|
|
118
116
|
final ViewController<?> viewController = layoutFactory.create(layoutTree);
|
|
119
|
-
navigator().setRoot(viewController, new NativeCommandListener("setRoot", commandId, promise, eventEmitter, now)
|
|
117
|
+
navigator().setRoot(viewController, new NativeCommandListener("setRoot", commandId, promise, eventEmitter, now));
|
|
120
118
|
});
|
|
121
119
|
}
|
|
122
120
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package com.reactnativenavigation.react
|
|
2
2
|
|
|
3
|
-
import com.facebook.react.
|
|
3
|
+
import com.facebook.react.ReactApplication
|
|
4
|
+
import com.facebook.react.ReactHost
|
|
4
5
|
import com.facebook.react.ReactPackage
|
|
5
6
|
import com.facebook.react.bridge.NativeModule
|
|
6
7
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
@@ -8,13 +9,13 @@ import com.facebook.react.uimanager.ViewManager
|
|
|
8
9
|
import com.reactnativenavigation.options.LayoutFactory
|
|
9
10
|
import com.reactnativenavigation.react.modal.ModalViewManager
|
|
10
11
|
|
|
11
|
-
class NavigationPackage(
|
|
12
|
+
class NavigationPackage() : ReactPackage {
|
|
12
13
|
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
|
|
14
|
+
val reactApp = reactContext.applicationContext as ReactApplication
|
|
13
15
|
return listOf(
|
|
14
16
|
NavigationModule(
|
|
15
17
|
reactContext,
|
|
16
|
-
|
|
17
|
-
LayoutFactory(reactNativeHost.reactInstanceManager)
|
|
18
|
+
LayoutFactory(reactApp.reactHost)
|
|
18
19
|
)
|
|
19
20
|
)
|
|
20
21
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.reactnativenavigation.react;
|
|
2
2
|
|
|
3
|
+
import com.facebook.react.ReactHost;
|
|
3
4
|
import com.facebook.react.ReactInstanceManager;
|
|
4
5
|
import com.facebook.react.bridge.ReactContext;
|
|
5
6
|
import com.reactnativenavigation.NavigationActivity;
|
|
@@ -9,18 +10,18 @@ import androidx.annotation.NonNull;
|
|
|
9
10
|
|
|
10
11
|
public class NavigationReactInitializer implements ReactInstanceManager.ReactInstanceEventListener {
|
|
11
12
|
|
|
12
|
-
private final
|
|
13
|
+
private final ReactHost reactHost;
|
|
13
14
|
private final DevPermissionRequest devPermissionRequest;
|
|
14
15
|
private boolean waitingForAppLaunchEvent = true;
|
|
15
16
|
private boolean isActivityReadyForUi = false;
|
|
16
17
|
|
|
17
|
-
NavigationReactInitializer(
|
|
18
|
-
this.
|
|
18
|
+
NavigationReactInitializer(ReactHost reactHost, boolean isDebug) {
|
|
19
|
+
this.reactHost = reactHost;
|
|
19
20
|
this.devPermissionRequest = new DevPermissionRequest(isDebug);
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
void onActivityCreated() {
|
|
23
|
-
|
|
24
|
+
reactHost.addReactInstanceEventListener(this);
|
|
24
25
|
waitingForAppLaunchEvent = true;
|
|
25
26
|
}
|
|
26
27
|
|
|
@@ -28,7 +29,7 @@ public class NavigationReactInitializer implements ReactInstanceManager.ReactIns
|
|
|
28
29
|
if (devPermissionRequest.shouldAskPermission(activity)) {
|
|
29
30
|
devPermissionRequest.askPermission(activity);
|
|
30
31
|
} else {
|
|
31
|
-
|
|
32
|
+
reactHost.onHostResume(activity, activity);
|
|
32
33
|
isActivityReadyForUi = true;
|
|
33
34
|
prepareReactApp();
|
|
34
35
|
}
|
|
@@ -36,24 +37,26 @@ public class NavigationReactInitializer implements ReactInstanceManager.ReactIns
|
|
|
36
37
|
|
|
37
38
|
void onActivityPaused(NavigationActivity activity) {
|
|
38
39
|
isActivityReadyForUi = false;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
// TODO: Check it needed
|
|
41
|
+
//if (reactHost.hasStartedCreatingInitialContext()) {
|
|
42
|
+
reactHost.onHostPause(activity);
|
|
43
|
+
//}
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
void onActivityDestroyed(NavigationActivity activity) {
|
|
45
|
-
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
}
|
|
47
|
+
reactHost.removeReactInstanceEventListener(this);
|
|
48
|
+
//if (reactHost.gehasStartedCreatingInitialContext()) {
|
|
49
|
+
reactHost.onHostDestroy(activity);
|
|
50
|
+
//}
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
private void prepareReactApp() {
|
|
52
|
-
if
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
// TODO: Check if needed
|
|
55
|
+
//if (shouldCreateContext()) {
|
|
56
|
+
reactHost.start();
|
|
57
|
+
if (waitingForAppLaunchEvent) {
|
|
58
|
+
if (reactHost.getCurrentReactContext() != null) {
|
|
59
|
+
emitAppLaunched(reactHost.getCurrentReactContext());
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
}
|
|
@@ -64,10 +67,6 @@ public class NavigationReactInitializer implements ReactInstanceManager.ReactIns
|
|
|
64
67
|
new EventEmitter(context).appLaunched();
|
|
65
68
|
}
|
|
66
69
|
|
|
67
|
-
private boolean shouldCreateContext() {
|
|
68
|
-
return !reactInstanceManager.hasStartedCreatingInitialContext();
|
|
69
|
-
}
|
|
70
|
-
|
|
71
70
|
@Override
|
|
72
71
|
public void onReactContextInitialized(final ReactContext context) {
|
|
73
72
|
emitAppLaunched(context);
|
package/lib/android/app/src/main/java/com/reactnativenavigation/react/ReactComponentViewCreator.java
CHANGED
|
@@ -6,14 +6,8 @@ import com.facebook.react.ReactInstanceManager;
|
|
|
6
6
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.ReactViewCreator;
|
|
7
7
|
|
|
8
8
|
public class ReactComponentViewCreator implements ReactViewCreator {
|
|
9
|
-
private ReactInstanceManager reactInstanceManager;
|
|
10
|
-
|
|
11
|
-
public ReactComponentViewCreator(final ReactInstanceManager reactInstanceManager) {
|
|
12
|
-
this.reactInstanceManager = reactInstanceManager;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
9
|
@Override
|
|
16
10
|
public ReactView create(final Activity activity, final String componentId, final String componentName) {
|
|
17
|
-
return new ReactView(activity,
|
|
11
|
+
return new ReactView(activity, componentId, componentName);
|
|
18
12
|
}
|
|
19
13
|
}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
package com.reactnativenavigation.react;
|
|
2
2
|
|
|
3
|
+
import static com.reactnativenavigation.utils.CoordinatorLayoutUtils.matchParentLP;
|
|
4
|
+
|
|
3
5
|
import android.annotation.SuppressLint;
|
|
4
6
|
import android.content.Context;
|
|
5
7
|
import android.os.Bundle;
|
|
6
8
|
import android.view.MotionEvent;
|
|
9
|
+
import android.view.View;
|
|
10
|
+
import android.widget.FrameLayout;
|
|
7
11
|
|
|
8
12
|
import androidx.annotation.RestrictTo;
|
|
9
13
|
|
|
10
|
-
import com.facebook.react.
|
|
11
|
-
import com.facebook.react.
|
|
14
|
+
import com.facebook.react.ReactApplication;
|
|
15
|
+
import com.facebook.react.ReactHost;
|
|
12
16
|
import com.facebook.react.bridge.ReactContext;
|
|
13
|
-
import com.facebook.react.
|
|
14
|
-
import com.facebook.react.uimanager.
|
|
15
|
-
import com.facebook.react.uimanager.
|
|
17
|
+
import com.facebook.react.interfaces.fabric.ReactSurface;
|
|
18
|
+
import com.facebook.react.uimanager.UIManagerHelper;
|
|
19
|
+
import com.facebook.react.uimanager.common.UIManagerType;
|
|
16
20
|
import com.facebook.react.uimanager.events.EventDispatcher;
|
|
17
21
|
import com.reactnativenavigation.react.events.ComponentType;
|
|
18
22
|
import com.reactnativenavigation.react.events.EventEmitter;
|
|
@@ -21,21 +25,22 @@ import com.reactnativenavigation.viewcontrollers.viewcontroller.ScrollEventListe
|
|
|
21
25
|
import com.reactnativenavigation.views.component.Renderable;
|
|
22
26
|
|
|
23
27
|
@SuppressLint("ViewConstructor")
|
|
24
|
-
public class ReactView extends
|
|
25
|
-
|
|
26
|
-
private final ReactInstanceManager reactInstanceManager;
|
|
28
|
+
public class ReactView extends FrameLayout implements IReactView, Renderable {
|
|
27
29
|
private final String componentId;
|
|
28
30
|
private final String componentName;
|
|
29
31
|
private boolean isAttachedToReactInstance = false;
|
|
30
|
-
private final JSTouchDispatcher jsTouchDispatcher;
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
private final ReactSurface reactSurface;
|
|
34
|
+
|
|
35
|
+
public ReactView(final Context context, String componentId, String componentName) {
|
|
33
36
|
super(context);
|
|
34
|
-
this.reactInstanceManager = reactInstanceManager;
|
|
35
37
|
this.componentId = componentId;
|
|
36
38
|
this.componentName = componentName;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
|
|
40
|
+
final Bundle opts = new Bundle();
|
|
41
|
+
opts.putString("componentId", componentId);
|
|
42
|
+
reactSurface = getReactHost().createSurface(context, componentName, opts);
|
|
43
|
+
addView(reactSurface.getView(), matchParentLP());
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
@Override
|
|
@@ -47,9 +52,7 @@ public class ReactView extends ReactRootView implements IReactView, Renderable {
|
|
|
47
52
|
public void start() {
|
|
48
53
|
if (isAttachedToReactInstance) return;
|
|
49
54
|
isAttachedToReactInstance = true;
|
|
50
|
-
|
|
51
|
-
opts.putString("componentId", componentId);
|
|
52
|
-
startReactApplication(reactInstanceManager, componentName, opts);
|
|
55
|
+
reactSurface.start();
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
@Override
|
|
@@ -64,13 +67,12 @@ public class ReactView extends ReactRootView implements IReactView, Renderable {
|
|
|
64
67
|
|
|
65
68
|
@Override
|
|
66
69
|
public void destroy() {
|
|
67
|
-
|
|
70
|
+
reactSurface.stop();
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
public void sendComponentWillStart(ComponentType type) {
|
|
71
74
|
this.post(()->{
|
|
72
|
-
|
|
73
|
-
ReactContext currentReactContext = reactInstanceManager.getCurrentReactContext();
|
|
75
|
+
ReactContext currentReactContext = getReactContent();
|
|
74
76
|
if (currentReactContext != null)
|
|
75
77
|
new EventEmitter(currentReactContext).emitComponentWillAppear(componentId, componentName, type);
|
|
76
78
|
});
|
|
@@ -78,8 +80,7 @@ public class ReactView extends ReactRootView implements IReactView, Renderable {
|
|
|
78
80
|
|
|
79
81
|
public void sendComponentStart(ComponentType type) {
|
|
80
82
|
this.post(()->{
|
|
81
|
-
|
|
82
|
-
ReactContext currentReactContext = reactInstanceManager.getCurrentReactContext();
|
|
83
|
+
ReactContext currentReactContext = getReactContent();
|
|
83
84
|
if (currentReactContext != null) {
|
|
84
85
|
new EventEmitter(currentReactContext).emitComponentDidAppear(componentId, componentName, type);
|
|
85
86
|
}
|
|
@@ -87,8 +88,7 @@ public class ReactView extends ReactRootView implements IReactView, Renderable {
|
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
public void sendComponentStop(ComponentType type) {
|
|
90
|
-
|
|
91
|
-
ReactContext currentReactContext = reactInstanceManager.getCurrentReactContext();
|
|
91
|
+
ReactContext currentReactContext = getReactContent();
|
|
92
92
|
if (currentReactContext != null) {
|
|
93
93
|
new EventEmitter(currentReactContext).emitComponentDidDisappear(componentId, componentName, type);
|
|
94
94
|
}
|
|
@@ -96,8 +96,7 @@ public class ReactView extends ReactRootView implements IReactView, Renderable {
|
|
|
96
96
|
|
|
97
97
|
@Override
|
|
98
98
|
public void sendOnNavigationButtonPressed(String buttonId) {
|
|
99
|
-
|
|
100
|
-
ReactContext currentReactContext = reactInstanceManager.getCurrentReactContext();
|
|
99
|
+
ReactContext currentReactContext = getReactContent();
|
|
101
100
|
if (currentReactContext != null) {
|
|
102
101
|
new EventEmitter(currentReactContext).emitOnNavigationButtonPressed(componentId, buttonId);
|
|
103
102
|
}
|
|
@@ -110,7 +109,10 @@ public class ReactView extends ReactRootView implements IReactView, Renderable {
|
|
|
110
109
|
|
|
111
110
|
@Override
|
|
112
111
|
public void dispatchTouchEventToJs(MotionEvent event) {
|
|
113
|
-
|
|
112
|
+
View view = reactSurface.getView();
|
|
113
|
+
if (view != null) {
|
|
114
|
+
view.onTouchEvent(event);
|
|
115
|
+
}
|
|
114
116
|
}
|
|
115
117
|
|
|
116
118
|
@Override
|
|
@@ -119,12 +121,20 @@ public class ReactView extends ReactRootView implements IReactView, Renderable {
|
|
|
119
121
|
}
|
|
120
122
|
|
|
121
123
|
public EventDispatcher getEventDispatcher() {
|
|
122
|
-
ReactContext reactContext =
|
|
123
|
-
return reactContext == null ? null :
|
|
124
|
+
ReactContext reactContext = getReactContent();
|
|
125
|
+
return reactContext == null ? null : UIManagerHelper.getEventDispatcher(reactContext, UIManagerType.FABRIC);
|
|
124
126
|
}
|
|
125
127
|
|
|
126
128
|
@RestrictTo(RestrictTo.Scope.TESTS)
|
|
127
129
|
public String getComponentName() {
|
|
128
130
|
return componentName;
|
|
129
131
|
}
|
|
132
|
+
|
|
133
|
+
private ReactHost getReactHost() {
|
|
134
|
+
return ((ReactApplication)getContext().getApplicationContext()).getReactHost();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
private ReactContext getReactContent() {
|
|
138
|
+
return getReactHost().getCurrentReactContext();
|
|
139
|
+
}
|
|
130
140
|
}
|
package/lib/android/app/src/main/java/com/reactnativenavigation/react/modal/ModalFrameLayout.kt
CHANGED
|
@@ -8,7 +8,7 @@ class ModalFrameLayout(context: ReactContext) : FrameLayout(context) {
|
|
|
8
8
|
val modalContentLayout = ModalContentLayout(context)
|
|
9
9
|
|
|
10
10
|
init {
|
|
11
|
-
addView(modalContentLayout, MarginLayoutParams(MarginLayoutParams.
|
|
11
|
+
addView(modalContentLayout, MarginLayoutParams(MarginLayoutParams.MATCH_PARENT, MarginLayoutParams.MATCH_PARENT)
|
|
12
12
|
.apply {
|
|
13
13
|
val translucent = context.currentActivity?.window?.let {
|
|
14
14
|
SystemUiUtils.isTranslucent(it)
|
package/lib/android/app/src/main/java/com/reactnativenavigation/react/modal/ModalLayoutController.kt
CHANGED
|
@@ -2,7 +2,9 @@ package com.reactnativenavigation.react.modal
|
|
|
2
2
|
|
|
3
3
|
import android.app.Activity
|
|
4
4
|
import com.facebook.react.bridge.ReactContext
|
|
5
|
+
import com.facebook.react.uimanager.UIManagerHelper
|
|
5
6
|
import com.facebook.react.uimanager.UIManagerModule
|
|
7
|
+
import com.facebook.react.uimanager.common.UIManagerType
|
|
6
8
|
import com.reactnativenavigation.options.Options
|
|
7
9
|
import com.reactnativenavigation.react.Constants
|
|
8
10
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController
|
|
@@ -35,17 +37,13 @@ class ModalLayoutController(
|
|
|
35
37
|
|
|
36
38
|
override fun sendOnNavigationButtonPressed(buttonId: String?) {
|
|
37
39
|
if (buttonId == Constants.HARDWARE_BACK_BUTTON_ID) {
|
|
38
|
-
val dispatcher = reactContext.
|
|
39
|
-
UIManagerModule::class.java
|
|
40
|
-
)?.eventDispatcher
|
|
40
|
+
val dispatcher = UIManagerHelper.getEventDispatcher(reactContext, UIManagerType.FABRIC)
|
|
41
41
|
dispatcher?.dispatchEvent(RequestCloseModalEvent(getHostId()))
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
fun sendShowEvent() {
|
|
46
|
-
val dispatcher = reactContext.
|
|
47
|
-
UIManagerModule::class.java
|
|
48
|
-
)?.eventDispatcher
|
|
46
|
+
val dispatcher = UIManagerHelper.getEventDispatcher(reactContext, UIManagerType.FABRIC)
|
|
49
47
|
dispatcher?.dispatchEvent(ShowModalEvent(getHostId()))
|
|
50
48
|
}
|
|
51
49
|
}
|
|
@@ -7,5 +7,5 @@ import com.facebook.react.ReactInstanceManager;
|
|
|
7
7
|
import org.json.JSONObject;
|
|
8
8
|
|
|
9
9
|
public interface ExternalComponentCreator {
|
|
10
|
-
ExternalComponent create(FragmentActivity activity,
|
|
10
|
+
ExternalComponent create(FragmentActivity activity, JSONObject props);
|
|
11
11
|
}
|
|
@@ -24,15 +24,13 @@ import static com.reactnativenavigation.utils.ObjectUtils.perform;
|
|
|
24
24
|
public class ExternalComponentViewController extends ChildController<ExternalComponentLayout> {
|
|
25
25
|
private final ExternalComponent externalComponent;
|
|
26
26
|
private final ExternalComponentCreator componentCreator;
|
|
27
|
-
private ReactInstanceManager reactInstanceManager;
|
|
28
27
|
private final EventEmitter emitter;
|
|
29
28
|
private final ExternalComponentPresenter presenter;
|
|
30
29
|
|
|
31
|
-
public ExternalComponentViewController(Activity activity, ChildControllersRegistry childRegistry, String id, Presenter presenter, ExternalComponent externalComponent, ExternalComponentCreator componentCreator,
|
|
30
|
+
public ExternalComponentViewController(Activity activity, ChildControllersRegistry childRegistry, String id, Presenter presenter, ExternalComponent externalComponent, ExternalComponentCreator componentCreator, EventEmitter emitter, ExternalComponentPresenter externalComponentPresenter, Options initialOptions) {
|
|
32
31
|
super(activity, childRegistry, id, presenter, initialOptions);
|
|
33
32
|
this.externalComponent = externalComponent;
|
|
34
33
|
this.componentCreator = componentCreator;
|
|
35
|
-
this.reactInstanceManager = reactInstanceManager;
|
|
36
34
|
this.emitter = emitter;
|
|
37
35
|
this.presenter = externalComponentPresenter;
|
|
38
36
|
}
|
|
@@ -42,7 +40,7 @@ public class ExternalComponentViewController extends ChildController<ExternalCom
|
|
|
42
40
|
ExternalComponentLayout content = new ExternalComponentLayout(getActivity());
|
|
43
41
|
enableDrawingBehindStatusBar(content);
|
|
44
42
|
content.addView(componentCreator
|
|
45
|
-
.create(getActivity(),
|
|
43
|
+
.create(getActivity(), externalComponent.passProps)
|
|
46
44
|
.asView(), CoordinatorLayoutUtils.matchParentWithBehaviour(new BehaviourDelegate(this)));
|
|
47
45
|
return content;
|
|
48
46
|
}
|
|
@@ -143,7 +143,7 @@ public class Navigator extends ParentController<ViewGroup> {
|
|
|
143
143
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
public void setRoot(final ViewController<?> appearing, CommandListener commandListener
|
|
146
|
+
public void setRoot(final ViewController<?> appearing, CommandListener commandListener) {
|
|
147
147
|
previousRoot = root;
|
|
148
148
|
modalStack.destroy();
|
|
149
149
|
final boolean removeSplashView = isRootNotCreated();
|
|
@@ -160,7 +160,7 @@ public class Navigator extends ParentController<ViewGroup> {
|
|
|
160
160
|
destroyPreviousRoot();
|
|
161
161
|
super.onSuccess(childId);
|
|
162
162
|
}
|
|
163
|
-
}
|
|
163
|
+
});
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
public void mergeOptions(final String componentId, Options options) {
|
|
@@ -34,7 +34,7 @@ public class RootPresenter {
|
|
|
34
34
|
this.layoutDirectionApplier = layoutDirectionApplier;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
public void setRoot(ViewController appearingRoot, ViewController<?> disappearingRoot, Options defaultOptions, CommandListener listener
|
|
37
|
+
public void setRoot(ViewController appearingRoot, ViewController<?> disappearingRoot, Options defaultOptions, CommandListener listener) {
|
|
38
38
|
layoutDirectionApplier.apply(appearingRoot, defaultOptions);
|
|
39
39
|
rootLayout.addView(appearingRoot.getView(), matchParentWithBehaviour(new BehaviourDelegate(appearingRoot)));
|
|
40
40
|
Options options = appearingRoot.resolveCurrentOptions(defaultOptions);
|
|
@@ -9,16 +9,9 @@ import com.reactnativenavigation.react.ReactComponentViewCreator;
|
|
|
9
9
|
import com.reactnativenavigation.react.ReactView;
|
|
10
10
|
|
|
11
11
|
public class ComponentViewCreator implements ReactViewCreator {
|
|
12
|
-
|
|
13
|
-
private ReactInstanceManager instanceManager;
|
|
14
|
-
|
|
15
|
-
public ComponentViewCreator(ReactInstanceManager instanceManager) {
|
|
16
|
-
this.instanceManager = instanceManager;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
12
|
@Override
|
|
20
13
|
public IReactView create(Activity activity, String componentId, String componentName) {
|
|
21
|
-
ReactView reactView = new ReactComponentViewCreator(
|
|
14
|
+
ReactView reactView = new ReactComponentViewCreator().create(activity, componentId, componentName);
|
|
22
15
|
return new ComponentLayout(activity, reactView);
|
|
23
16
|
}
|
|
24
17
|
}
|
|
@@ -9,7 +9,7 @@ import com.reactnativenavigation.react.ReactView;
|
|
|
9
9
|
@SuppressLint("ViewConstructor")
|
|
10
10
|
public class TopBarBackgroundView extends ReactView {
|
|
11
11
|
|
|
12
|
-
public TopBarBackgroundView(Context context,
|
|
13
|
-
super(context,
|
|
12
|
+
public TopBarBackgroundView(Context context, String componentId, String componentName) {
|
|
13
|
+
super(context, componentId, componentName);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -7,14 +7,8 @@ import com.reactnativenavigation.viewcontrollers.viewcontroller.ReactViewCreator
|
|
|
7
7
|
|
|
8
8
|
public class TopBarBackgroundViewCreator implements ReactViewCreator {
|
|
9
9
|
|
|
10
|
-
protected ReactInstanceManager instanceManager;
|
|
11
|
-
|
|
12
|
-
public TopBarBackgroundViewCreator(ReactInstanceManager instanceManager) {
|
|
13
|
-
this.instanceManager = instanceManager;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
10
|
@Override
|
|
17
11
|
public TopBarBackgroundView create(Activity activity, String componentId, String componentName) {
|
|
18
|
-
return new TopBarBackgroundView(activity,
|
|
12
|
+
return new TopBarBackgroundView(activity, componentId, componentName);
|
|
19
13
|
}
|
|
20
14
|
}
|
|
@@ -6,14 +6,7 @@ import com.facebook.react.ReactInstanceManager;
|
|
|
6
6
|
import com.reactnativenavigation.options.ComponentOptions;
|
|
7
7
|
|
|
8
8
|
public class TitleBarButtonCreator {
|
|
9
|
-
|
|
10
|
-
private ReactInstanceManager instanceManager;
|
|
11
|
-
|
|
12
|
-
public TitleBarButtonCreator(ReactInstanceManager instanceManager) {
|
|
13
|
-
this.instanceManager = instanceManager;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
9
|
public TitleBarReactButtonView create(Activity activity, ComponentOptions component) {
|
|
17
|
-
return new TitleBarReactButtonView(activity,
|
|
10
|
+
return new TitleBarReactButtonView(activity, component);
|
|
18
11
|
}
|
|
19
12
|
}
|
|
@@ -18,8 +18,8 @@ import static com.reactnativenavigation.utils.UiUtils.dpToPx;
|
|
|
18
18
|
public class TitleBarReactButtonView extends ReactView {
|
|
19
19
|
private final ComponentOptions component;
|
|
20
20
|
|
|
21
|
-
public TitleBarReactButtonView(Context context,
|
|
22
|
-
super(context,
|
|
21
|
+
public TitleBarReactButtonView(Context context, ComponentOptions component) {
|
|
22
|
+
super(context, component.componentId.get(), component.name.get());
|
|
23
23
|
this.component = component;
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -28,7 +28,7 @@ public class TitleBarReactButtonView extends ReactView {
|
|
|
28
28
|
|
|
29
29
|
//This is a workaround, ReactNative throws exception when views have ids, On android MenuItems
|
|
30
30
|
// With ActionViews like this got an id, see #7253
|
|
31
|
-
if (!this.isAttachedToWindow()
|
|
31
|
+
if (!this.isAttachedToWindow()) {
|
|
32
32
|
this.setId(View.NO_ID);
|
|
33
33
|
}
|
|
34
34
|
|