@amazon-devices/react-native-screens 2.0.1758683737
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/LICENSE +7 -0
- package/README.md +223 -0
- package/RNScreens.podspec +53 -0
- package/SystemBundles/8f5a820b958535e533acb38dbc0c72c1837721b9db075f4a1740e42b9fee3910.bundle +33668 -0
- package/SystemBundles/8f5a820b958535e533acb38dbc0c72c1837721b9db075f4a1740e42b9fee3910.map +1 -0
- package/SystemModules/amzn__react-native-screens.modules.txt +101 -0
- package/SystemModules/amzn__react-native-screens.private.modules.txt +244 -0
- package/SystemModules/keplerscript-system-bundle-config.json +7 -0
- package/THIRD_PARTY_NOTICES.txt +707 -0
- package/android/build.gradle +133 -0
- package/android/src/fabric/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt +49 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/com/swmansion/rnscreens/CustomSearchView.kt +77 -0
- package/android/src/main/java/com/swmansion/rnscreens/CustomToolbar.kt +7 -0
- package/android/src/main/java/com/swmansion/rnscreens/FragmentBackPressOverrider.kt +29 -0
- package/android/src/main/java/com/swmansion/rnscreens/FragmentHolder.kt +7 -0
- package/android/src/main/java/com/swmansion/rnscreens/RNScreensPackage.kt +21 -0
- package/android/src/main/java/com/swmansion/rnscreens/Screen.kt +289 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenContainer.kt +372 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenContainerViewManager.kt +40 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenEventDispatcher.kt +21 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenFragment.kt +331 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenFragmentWrapper.kt +22 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt +336 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.kt +282 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragmentWrapper.kt +15 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt +398 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigViewManager.kt +204 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderSubview.kt +38 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderSubviewManager.kt +41 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackViewManager.kt +75 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt +186 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt +296 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreensShadowNode.kt +19 -0
- package/android/src/main/java/com/swmansion/rnscreens/SearchBarManager.kt +133 -0
- package/android/src/main/java/com/swmansion/rnscreens/SearchBarView.kt +178 -0
- package/android/src/main/java/com/swmansion/rnscreens/SearchViewFormatter.kt +67 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderAttachedEvent.kt +22 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderBackButtonClickedEvent.kt +22 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderDetachedEvent.kt +22 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderHeightChangeEvent.kt +26 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenAppearEvent.kt +18 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenDisappearEvent.kt +18 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenDismissedEvent.kt +20 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenTransitionProgressEvent.kt +32 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillAppearEvent.kt +18 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillDisappearEvent.kt +18 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarBlurEvent.kt +22 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarChangeTextEvent.kt +28 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarCloseEvent.kt +22 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarFocusEvent.kt +22 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarOpenEvent.kt +22 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarSearchButtonPressEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/StackFinishTransitioningEvent.kt +18 -0
- package/android/src/main/java/com/swmansion/rnscreens/utils/DeviceUtils.kt +12 -0
- package/android/src/main/jni/CMakeLists.txt +72 -0
- package/android/src/main/jni/rnscreens.cpp +16 -0
- package/android/src/main/jni/rnscreens.h +28 -0
- package/android/src/main/res/base/anim/rns_default_enter_in.xml +18 -0
- package/android/src/main/res/base/anim/rns_default_enter_out.xml +19 -0
- package/android/src/main/res/base/anim/rns_default_exit_in.xml +17 -0
- package/android/src/main/res/base/anim/rns_default_exit_out.xml +18 -0
- package/android/src/main/res/base/anim/rns_fade_from_bottom.xml +14 -0
- package/android/src/main/res/base/anim/rns_fade_in.xml +7 -0
- package/android/src/main/res/base/anim/rns_fade_out.xml +7 -0
- package/android/src/main/res/base/anim/rns_fade_to_bottom.xml +15 -0
- package/android/src/main/res/base/anim/rns_no_animation_20.xml +6 -0
- package/android/src/main/res/base/anim/rns_no_animation_250.xml +7 -0
- package/android/src/main/res/base/anim/rns_no_animation_350.xml +6 -0
- package/android/src/main/res/base/anim/rns_no_animation_medium.xml +7 -0
- package/android/src/main/res/base/anim/rns_slide_in_from_bottom.xml +7 -0
- package/android/src/main/res/base/anim/rns_slide_in_from_left.xml +5 -0
- package/android/src/main/res/base/anim/rns_slide_in_from_right.xml +5 -0
- package/android/src/main/res/base/anim/rns_slide_out_to_bottom.xml +7 -0
- package/android/src/main/res/base/anim/rns_slide_out_to_left.xml +5 -0
- package/android/src/main/res/base/anim/rns_slide_out_to_right.xml +5 -0
- package/android/src/main/res/base/anim/rns_standard_accelerate_interpolator.xml +6 -0
- package/android/src/main/res/v33/anim-v33/rns_default_enter_in.xml +38 -0
- package/android/src/main/res/v33/anim-v33/rns_default_enter_out.xml +38 -0
- package/android/src/main/res/v33/anim-v33/rns_default_exit_in.xml +38 -0
- package/android/src/main/res/v33/anim-v33/rns_default_exit_out.xml +38 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerDelegate.java +111 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerInterface.java +44 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerDelegate.java +107 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerInterface.java +42 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderSubviewManagerDelegate.java +31 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderSubviewManagerInterface.java +17 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackManagerDelegate.java +25 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackManagerInterface.java +16 -0
- package/android/src/paper/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt +10 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h +41 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.cpp +9 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.h +30 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.cpp +14 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.h +45 -0
- package/ios/RCTImageComponentView+RNSScreenStackHeaderConfig.h +11 -0
- package/ios/RCTImageComponentView+RNSScreenStackHeaderConfig.mm +14 -0
- package/ios/RNSConvert.h +36 -0
- package/ios/RNSConvert.mm +154 -0
- package/ios/RNSEnums.h +71 -0
- package/ios/RNSFullWindowOverlay.h +34 -0
- package/ios/RNSFullWindowOverlay.mm +241 -0
- package/ios/RNSScreen.h +144 -0
- package/ios/RNSScreen.mm +1599 -0
- package/ios/RNSScreenContainer.h +45 -0
- package/ios/RNSScreenContainer.mm +343 -0
- package/ios/RNSScreenNavigationContainer.h +16 -0
- package/ios/RNSScreenNavigationContainer.mm +66 -0
- package/ios/RNSScreenStack.h +37 -0
- package/ios/RNSScreenStack.mm +1111 -0
- package/ios/RNSScreenStackAnimator.h +8 -0
- package/ios/RNSScreenStackAnimator.mm +320 -0
- package/ios/RNSScreenStackHeaderConfig.h +74 -0
- package/ios/RNSScreenStackHeaderConfig.mm +967 -0
- package/ios/RNSScreenStackHeaderSubview.h +44 -0
- package/ios/RNSScreenStackHeaderSubview.mm +147 -0
- package/ios/RNSScreenWindowTraits.h +26 -0
- package/ios/RNSScreenWindowTraits.mm +266 -0
- package/ios/RNSSearchBar.h +43 -0
- package/ios/RNSSearchBar.mm +465 -0
- package/ios/RNScreens.xcodeproj/project.pbxproj +461 -0
- package/ios/UIViewController+RNScreens.h +9 -0
- package/ios/UIViewController+RNScreens.mm +78 -0
- package/ios/UIWindow+RNScreens.h +9 -0
- package/ios/UIWindow+RNScreens.mm +17 -0
- package/ios/events/RNSHeaderHeightChangeEvent.h +8 -0
- package/ios/events/RNSHeaderHeightChangeEvent.mm +44 -0
- package/ios/events/RNSScreenViewEvent.h +12 -0
- package/ios/events/RNSScreenViewEvent.mm +59 -0
- package/ios/utils/RNSUIBarButtonItem.h +5 -0
- package/ios/utils/RNSUIBarButtonItem.mm +22 -0
- package/kepler-compatibility.json +8 -0
- package/kepler-transformed-package-info.json +3 -0
- package/lib/commonjs/TransitionProgressContext.js +11 -0
- package/lib/commonjs/TransitionProgressContext.js.map +1 -0
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +11 -0
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js +33 -0
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenNativeComponent.js +70 -0
- package/lib/commonjs/fabric/ScreenNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js +11 -0
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js +31 -0
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js +12 -0
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js +35 -0
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/SearchBarNativeComponent.js +19 -0
- package/lib/commonjs/fabric/SearchBarNativeComponent.js.map +1 -0
- package/lib/commonjs/index.js +147 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/index.native.js +407 -0
- package/lib/commonjs/index.native.js.map +1 -0
- package/lib/commonjs/native-stack/index.js +49 -0
- package/lib/commonjs/native-stack/index.js.map +1 -0
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js +75 -0
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js.map +1 -0
- package/lib/commonjs/native-stack/types.js +6 -0
- package/lib/commonjs/native-stack/types.js.map +1 -0
- package/lib/commonjs/native-stack/utils/AnimatedHeaderHeightContext.js +12 -0
- package/lib/commonjs/native-stack/utils/AnimatedHeaderHeightContext.js.map +1 -0
- package/lib/commonjs/native-stack/utils/HeaderHeightContext.js +12 -0
- package/lib/commonjs/native-stack/utils/HeaderHeightContext.js.map +1 -0
- package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js +75 -0
- package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js.map +1 -0
- package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js +35 -0
- package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js.map +1 -0
- package/lib/commonjs/native-stack/utils/useAnimatedHeaderHeight.js +19 -0
- package/lib/commonjs/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -0
- package/lib/commonjs/native-stack/utils/useBackPressSubscription.js +54 -0
- package/lib/commonjs/native-stack/utils/useBackPressSubscription.js.map +1 -0
- package/lib/commonjs/native-stack/utils/useHeaderHeight.js +19 -0
- package/lib/commonjs/native-stack/utils/useHeaderHeight.js.map +1 -0
- package/lib/commonjs/native-stack/views/FontProcessor.js +21 -0
- package/lib/commonjs/native-stack/views/FontProcessor.js.map +1 -0
- package/lib/commonjs/native-stack/views/HeaderConfig.js +141 -0
- package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -0
- package/lib/commonjs/native-stack/views/NativeStackView.js +354 -0
- package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -0
- package/lib/commonjs/reanimated/ReanimatedHeaderHeightContext.js +12 -0
- package/lib/commonjs/reanimated/ReanimatedHeaderHeightContext.js.map +1 -0
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js +101 -0
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -0
- package/lib/commonjs/reanimated/ReanimatedScreen.js +22 -0
- package/lib/commonjs/reanimated/ReanimatedScreen.js.map +1 -0
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js +47 -0
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js.map +1 -0
- package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js +12 -0
- package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js.map +1 -0
- package/lib/commonjs/reanimated/index.js +28 -0
- package/lib/commonjs/reanimated/index.js.map +1 -0
- package/lib/commonjs/reanimated/useReanimatedHeaderHeight.js +19 -0
- package/lib/commonjs/reanimated/useReanimatedHeaderHeight.js.map +1 -0
- package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js +19 -0
- package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js.map +1 -0
- package/lib/commonjs/types.js +6 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/useTransitionProgress.js +19 -0
- package/lib/commonjs/useTransitionProgress.js.map +1 -0
- package/lib/commonjs/utils.js +21 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/module/TransitionProgressContext.js +3 -0
- package/lib/module/TransitionProgressContext.js.map +1 -0
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js +4 -0
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenContainerNativeComponent.js +25 -0
- package/lib/module/fabric/ScreenContainerNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenNativeComponent.js +63 -0
- package/lib/module/fabric/ScreenNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js +4 -0
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js +23 -0
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js +7 -0
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenStackNativeComponent.js +28 -0
- package/lib/module/fabric/ScreenStackNativeComponent.js.map +1 -0
- package/lib/module/fabric/SearchBarNativeComponent.js +10 -0
- package/lib/module/fabric/SearchBarNativeComponent.js.map +1 -0
- package/lib/module/index.js +67 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/index.native.js +410 -0
- package/lib/module/index.native.js.map +1 -0
- package/lib/module/native-stack/index.js +22 -0
- package/lib/module/native-stack/index.js.map +1 -0
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js +72 -0
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js.map +1 -0
- package/lib/module/native-stack/types.js +2 -0
- package/lib/module/native-stack/types.js.map +1 -0
- package/lib/module/native-stack/utils/AnimatedHeaderHeightContext.js +4 -0
- package/lib/module/native-stack/utils/AnimatedHeaderHeightContext.js.map +1 -0
- package/lib/module/native-stack/utils/HeaderHeightContext.js +4 -0
- package/lib/module/native-stack/utils/HeaderHeightContext.js.map +1 -0
- package/lib/module/native-stack/utils/SafeAreaProviderCompat.js +68 -0
- package/lib/module/native-stack/utils/SafeAreaProviderCompat.js.map +1 -0
- package/lib/module/native-stack/utils/getDefaultHeaderHeight.js +29 -0
- package/lib/module/native-stack/utils/getDefaultHeaderHeight.js.map +1 -0
- package/lib/module/native-stack/utils/useAnimatedHeaderHeight.js +10 -0
- package/lib/module/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -0
- package/lib/module/native-stack/utils/useBackPressSubscription.js +47 -0
- package/lib/module/native-stack/utils/useBackPressSubscription.js.map +1 -0
- package/lib/module/native-stack/utils/useHeaderHeight.js +10 -0
- package/lib/module/native-stack/utils/useHeaderHeight.js.map +1 -0
- package/lib/module/native-stack/views/FontProcessor.js +13 -0
- package/lib/module/native-stack/views/FontProcessor.js.map +1 -0
- package/lib/module/native-stack/views/HeaderConfig.js +132 -0
- package/lib/module/native-stack/views/HeaderConfig.js.map +1 -0
- package/lib/module/native-stack/views/NativeStackView.js +355 -0
- package/lib/module/native-stack/views/NativeStackView.js.map +1 -0
- package/lib/module/reanimated/ReanimatedHeaderHeightContext.js +5 -0
- package/lib/module/reanimated/ReanimatedHeaderHeightContext.js.map +1 -0
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js +97 -0
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -0
- package/lib/module/reanimated/ReanimatedScreen.js +17 -0
- package/lib/module/reanimated/ReanimatedScreen.js.map +1 -0
- package/lib/module/reanimated/ReanimatedScreenProvider.js +40 -0
- package/lib/module/reanimated/ReanimatedScreenProvider.js.map +1 -0
- package/lib/module/reanimated/ReanimatedTransitionProgressContext.js +5 -0
- package/lib/module/reanimated/ReanimatedTransitionProgressContext.js.map +1 -0
- package/lib/module/reanimated/index.js +4 -0
- package/lib/module/reanimated/index.js.map +1 -0
- package/lib/module/reanimated/useReanimatedHeaderHeight.js +10 -0
- package/lib/module/reanimated/useReanimatedHeaderHeight.js.map +1 -0
- package/lib/module/reanimated/useReanimatedTransitionProgress.js +10 -0
- package/lib/module/reanimated/useReanimatedTransitionProgress.js.map +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/useTransitionProgress.js +10 -0
- package/lib/module/useTransitionProgress.js.map +1 -0
- package/lib/module/utils.js +14 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/typescript/TransitionProgressContext.d.ts +9 -0
- package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts +7 -0
- package/lib/typescript/fabric/ScreenContainerNativeComponent.d.ts +5 -0
- package/lib/typescript/fabric/ScreenNativeComponent.d.ts +66 -0
- package/lib/typescript/fabric/ScreenNavigationContainerNativeComponent.d.ts +7 -0
- package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts +33 -0
- package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts +10 -0
- package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts +8 -0
- package/lib/typescript/fabric/SearchBarNativeComponent.d.ts +49 -0
- package/lib/typescript/index.d.ts +33 -0
- package/lib/typescript/index.native.d.ts +2 -0
- package/lib/typescript/native-stack/index.d.ts +19 -0
- package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +6 -0
- package/lib/typescript/native-stack/types.d.ts +438 -0
- package/lib/typescript/native-stack/utils/AnimatedHeaderHeightContext.d.ts +4 -0
- package/lib/typescript/native-stack/utils/HeaderHeightContext.d.ts +3 -0
- package/lib/typescript/native-stack/utils/SafeAreaProviderCompat.d.ts +11 -0
- package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts +7 -0
- package/lib/typescript/native-stack/utils/useAnimatedHeaderHeight.d.ts +1 -0
- package/lib/typescript/native-stack/utils/useBackPressSubscription.d.ts +16 -0
- package/lib/typescript/native-stack/utils/useHeaderHeight.d.ts +1 -0
- package/lib/typescript/native-stack/views/FontProcessor.d.ts +1 -0
- package/lib/typescript/native-stack/views/HeaderConfig.d.ts +8 -0
- package/lib/typescript/native-stack/views/NativeStackView.d.ts +10 -0
- package/lib/typescript/reanimated/ReanimatedHeaderHeightContext.d.ts +4 -0
- package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +5 -0
- package/lib/typescript/reanimated/ReanimatedScreen.d.ts +5 -0
- package/lib/typescript/reanimated/ReanimatedScreenProvider.d.ts +2 -0
- package/lib/typescript/reanimated/ReanimatedTransitionProgressContext.d.ts +9 -0
- package/lib/typescript/reanimated/index.d.ts +3 -0
- package/lib/typescript/reanimated/useReanimatedHeaderHeight.d.ts +3 -0
- package/lib/typescript/reanimated/useReanimatedTransitionProgress.d.ts +11 -0
- package/lib/typescript/types.d.ts +612 -0
- package/lib/typescript/useTransitionProgress.d.ts +5 -0
- package/lib/typescript/utils.d.ts +3 -0
- package/native-stack/README.md +814 -0
- package/native-stack/package.json +6 -0
- package/package.json +1 -0
- package/react-native.config.js +42 -0
- package/reanimated/package.json +6 -0
- package/src/TransitionProgressContext.tsx +12 -0
- package/src/fabric/FullWindowOverlayNativeComponent.ts +7 -0
- package/src/fabric/ScreenContainerNativeComponent.ts +28 -0
- package/src/fabric/ScreenNativeComponent.ts +158 -0
- package/src/fabric/ScreenNavigationContainerNativeComponent.ts +10 -0
- package/src/fabric/ScreenStackHeaderConfigNativeComponent.ts +61 -0
- package/src/fabric/ScreenStackHeaderSubviewNativeComponent.ts +22 -0
- package/src/fabric/ScreenStackNativeComponent.ts +33 -0
- package/src/fabric/SearchBarNativeComponent.ts +79 -0
- package/src/index.native.tsx +599 -0
- package/src/index.tsx +119 -0
- package/src/native-stack/index.tsx +27 -0
- package/src/native-stack/navigators/createNativeStackNavigator.tsx +107 -0
- package/src/native-stack/types.tsx +486 -0
- package/src/native-stack/utils/AnimatedHeaderHeightContext.tsx +8 -0
- package/src/native-stack/utils/HeaderHeightContext.tsx +5 -0
- package/src/native-stack/utils/SafeAreaProviderCompat.tsx +78 -0
- package/src/native-stack/utils/getDefaultHeaderHeight.tsx +41 -0
- package/src/native-stack/utils/useAnimatedHeaderHeight.tsx +15 -0
- package/src/native-stack/utils/useBackPressSubscription.tsx +66 -0
- package/src/native-stack/utils/useHeaderHeight.tsx +15 -0
- package/src/native-stack/views/FontProcessor.tsx +14 -0
- package/src/native-stack/views/HeaderConfig.tsx +187 -0
- package/src/native-stack/views/NativeStackView.tsx +466 -0
- package/src/reanimated/ReanimatedHeaderHeightContext.tsx +7 -0
- package/src/reanimated/ReanimatedNativeStackScreen.tsx +130 -0
- package/src/reanimated/ReanimatedScreen.tsx +25 -0
- package/src/reanimated/ReanimatedScreenProvider.tsx +42 -0
- package/src/reanimated/ReanimatedTransitionProgressContext.tsx +13 -0
- package/src/reanimated/index.tsx +3 -0
- package/src/reanimated/useReanimatedHeaderHeight.tsx +14 -0
- package/src/reanimated/useReanimatedTransitionProgress.tsx +14 -0
- package/src/types.tsx +699 -0
- package/src/useTransitionProgress.tsx +15 -0
- package/src/utils.ts +18 -0
- package/windows/README.md +25 -0
- package/windows/RNScreens/PropertySheet.props +16 -0
- package/windows/RNScreens/RNScreens.cpp +66 -0
- package/windows/RNScreens/RNScreens.def +3 -0
- package/windows/RNScreens/RNScreens.h +41 -0
- package/windows/RNScreens/RNScreens.idl +8 -0
- package/windows/RNScreens/RNScreens.vcxproj +187 -0
- package/windows/RNScreens/RNScreens.vcxproj.filters +52 -0
- package/windows/RNScreens/ReactPackageProvider.cpp +30 -0
- package/windows/RNScreens/ReactPackageProvider.h +17 -0
- package/windows/RNScreens/ReactPackageProvider.idl +9 -0
- package/windows/RNScreens/Screen.cpp +122 -0
- package/windows/RNScreens/Screen.h +64 -0
- package/windows/RNScreens/ScreenContainer.cpp +49 -0
- package/windows/RNScreens/ScreenContainer.h +23 -0
- package/windows/RNScreens/ScreenContainerViewManager.cpp +133 -0
- package/windows/RNScreens/ScreenContainerViewManager.h +78 -0
- package/windows/RNScreens/ScreenStack.cpp +65 -0
- package/windows/RNScreens/ScreenStack.h +23 -0
- package/windows/RNScreens/ScreenStackHeaderConfig.cpp +19 -0
- package/windows/RNScreens/ScreenStackHeaderConfig.h +14 -0
- package/windows/RNScreens/ScreenStackHeaderConfigViewManager.cpp +89 -0
- package/windows/RNScreens/ScreenStackHeaderConfigViewManager.h +62 -0
- package/windows/RNScreens/ScreenStackViewManager.cpp +132 -0
- package/windows/RNScreens/ScreenStackViewManager.h +78 -0
- package/windows/RNScreens/ScreenViewManager.cpp +154 -0
- package/windows/RNScreens/ScreenViewManager.h +78 -0
- package/windows/RNScreens/packages.config +4 -0
- package/windows/RNScreens/pch.cpp +1 -0
- package/windows/RNScreens/pch.h +9 -0
- package/windows/RNScreens62.sln +254 -0
- package/windows/RNScreens63.sln +225 -0
- package/windows/RNScreens65.sln +144 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
#import "RNSScreenStackAnimator.h"
|
|
2
|
+
#import "RNSScreenStack.h"
|
|
3
|
+
|
|
4
|
+
#import "RNSScreen.h"
|
|
5
|
+
|
|
6
|
+
// proportions to default transition duration
|
|
7
|
+
static const float RNSSlideOpenTransitionDurationProportion = 1;
|
|
8
|
+
static const float RNSFadeOpenTransitionDurationProportion = 0.2 / 0.35;
|
|
9
|
+
static const float RNSSlideCloseTransitionDurationProportion = 0.25 / 0.35;
|
|
10
|
+
static const float RNSFadeCloseTransitionDurationProportion = 0.15 / 0.35;
|
|
11
|
+
static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
|
|
12
|
+
|
|
13
|
+
@implementation RNSScreenStackAnimator {
|
|
14
|
+
UINavigationControllerOperation _operation;
|
|
15
|
+
NSTimeInterval _transitionDuration;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
- (instancetype)initWithOperation:(UINavigationControllerOperation)operation
|
|
19
|
+
{
|
|
20
|
+
if (self = [super init]) {
|
|
21
|
+
_operation = operation;
|
|
22
|
+
_transitionDuration = 0.35; // default duration in seconds
|
|
23
|
+
}
|
|
24
|
+
return self;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
- (NSTimeInterval)transitionDuration:(id<UIViewControllerContextTransitioning>)transitionContext
|
|
28
|
+
{
|
|
29
|
+
RNSScreenView *screen;
|
|
30
|
+
if (_operation == UINavigationControllerOperationPush) {
|
|
31
|
+
UIViewController *toViewController =
|
|
32
|
+
[transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
|
|
33
|
+
screen = ((RNSScreen *)toViewController).screenView;
|
|
34
|
+
} else if (_operation == UINavigationControllerOperationPop) {
|
|
35
|
+
UIViewController *fromViewController =
|
|
36
|
+
[transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
|
|
37
|
+
screen = ((RNSScreen *)fromViewController).screenView;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (screen != nil && screen.stackAnimation == RNSScreenStackAnimationNone) {
|
|
41
|
+
return 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (screen != nil && screen.transitionDuration != nil && [screen.transitionDuration floatValue] >= 0) {
|
|
45
|
+
float durationInSeconds = [screen.transitionDuration floatValue] / 1000.0;
|
|
46
|
+
return durationInSeconds;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return _transitionDuration;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
- (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext
|
|
53
|
+
{
|
|
54
|
+
UIViewController *toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
|
|
55
|
+
UIViewController *fromViewController =
|
|
56
|
+
[transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
|
|
57
|
+
toViewController.view.frame = [transitionContext finalFrameForViewController:toViewController];
|
|
58
|
+
|
|
59
|
+
RNSScreenView *screen;
|
|
60
|
+
if (_operation == UINavigationControllerOperationPush) {
|
|
61
|
+
screen = ((RNSScreen *)toViewController).screenView;
|
|
62
|
+
} else if (_operation == UINavigationControllerOperationPop) {
|
|
63
|
+
screen = ((RNSScreen *)fromViewController).screenView;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (screen != nil) {
|
|
67
|
+
if (screen.fullScreenSwipeEnabled && transitionContext.isInteractive) {
|
|
68
|
+
// we are swiping with full width gesture
|
|
69
|
+
if (screen.customAnimationOnSwipe) {
|
|
70
|
+
[self animateTransitionWithStackAnimation:screen.stackAnimation
|
|
71
|
+
transitionContext:transitionContext
|
|
72
|
+
toVC:toViewController
|
|
73
|
+
fromVC:fromViewController];
|
|
74
|
+
} else {
|
|
75
|
+
// we have to provide an animation when swiping, otherwise the screen will be popped immediately,
|
|
76
|
+
// so in case of no custom animation on swipe set, we provide the one closest to the default
|
|
77
|
+
[self animateSimplePushWithTransitionContext:transitionContext toVC:toViewController fromVC:fromViewController];
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
// we are going forward or provided custom animation on swipe or clicked native header back button
|
|
81
|
+
[self animateTransitionWithStackAnimation:screen.stackAnimation
|
|
82
|
+
transitionContext:transitionContext
|
|
83
|
+
toVC:toViewController
|
|
84
|
+
fromVC:fromViewController];
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
- (void)animateSimplePushWithTransitionContext:(id<UIViewControllerContextTransitioning>)transitionContext
|
|
90
|
+
toVC:(UIViewController *)toViewController
|
|
91
|
+
fromVC:(UIViewController *)fromViewController
|
|
92
|
+
{
|
|
93
|
+
float containerWidth = transitionContext.containerView.bounds.size.width;
|
|
94
|
+
float belowViewWidth = containerWidth * 0.3;
|
|
95
|
+
|
|
96
|
+
CGAffineTransform rightTransform = CGAffineTransformMakeTranslation(containerWidth, 0);
|
|
97
|
+
CGAffineTransform leftTransform = CGAffineTransformMakeTranslation(-belowViewWidth, 0);
|
|
98
|
+
|
|
99
|
+
if (toViewController.navigationController.view.semanticContentAttribute ==
|
|
100
|
+
UISemanticContentAttributeForceRightToLeft) {
|
|
101
|
+
rightTransform = CGAffineTransformMakeTranslation(-containerWidth, 0);
|
|
102
|
+
leftTransform = CGAffineTransformMakeTranslation(belowViewWidth, 0);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (_operation == UINavigationControllerOperationPush) {
|
|
106
|
+
toViewController.view.transform = rightTransform;
|
|
107
|
+
[[transitionContext containerView] addSubview:toViewController.view];
|
|
108
|
+
[UIView animateWithDuration:[self transitionDuration:transitionContext]
|
|
109
|
+
animations:^{
|
|
110
|
+
fromViewController.view.transform = leftTransform;
|
|
111
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
112
|
+
}
|
|
113
|
+
completion:^(BOOL finished) {
|
|
114
|
+
fromViewController.view.transform = CGAffineTransformIdentity;
|
|
115
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
116
|
+
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
|
|
117
|
+
}];
|
|
118
|
+
} else if (_operation == UINavigationControllerOperationPop) {
|
|
119
|
+
toViewController.view.transform = leftTransform;
|
|
120
|
+
[[transitionContext containerView] insertSubview:toViewController.view belowSubview:fromViewController.view];
|
|
121
|
+
|
|
122
|
+
void (^animationBlock)(void) = ^{
|
|
123
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
124
|
+
fromViewController.view.transform = rightTransform;
|
|
125
|
+
};
|
|
126
|
+
void (^completionBlock)(BOOL) = ^(BOOL finished) {
|
|
127
|
+
fromViewController.view.transform = CGAffineTransformIdentity;
|
|
128
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
129
|
+
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
if (!transitionContext.isInteractive) {
|
|
133
|
+
[UIView animateWithDuration:[self transitionDuration:transitionContext]
|
|
134
|
+
animations:animationBlock
|
|
135
|
+
completion:completionBlock];
|
|
136
|
+
} else {
|
|
137
|
+
// we don't want the EaseInOut option when swiping to dismiss the view, it is the same in default animation option
|
|
138
|
+
[UIView animateWithDuration:[self transitionDuration:transitionContext]
|
|
139
|
+
delay:0.0
|
|
140
|
+
options:UIViewAnimationOptionCurveLinear
|
|
141
|
+
animations:animationBlock
|
|
142
|
+
completion:completionBlock];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
- (void)animateFadeWithTransitionContext:(id<UIViewControllerContextTransitioning>)transitionContext
|
|
148
|
+
toVC:(UIViewController *)toViewController
|
|
149
|
+
fromVC:(UIViewController *)fromViewController
|
|
150
|
+
{
|
|
151
|
+
toViewController.view.frame = [transitionContext finalFrameForViewController:toViewController];
|
|
152
|
+
|
|
153
|
+
if (_operation == UINavigationControllerOperationPush) {
|
|
154
|
+
[[transitionContext containerView] addSubview:toViewController.view];
|
|
155
|
+
toViewController.view.alpha = 0.0;
|
|
156
|
+
[UIView animateWithDuration:[self transitionDuration:transitionContext]
|
|
157
|
+
animations:^{
|
|
158
|
+
toViewController.view.alpha = 1.0;
|
|
159
|
+
}
|
|
160
|
+
completion:^(BOOL finished) {
|
|
161
|
+
toViewController.view.alpha = 1.0;
|
|
162
|
+
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
|
|
163
|
+
}];
|
|
164
|
+
} else if (_operation == UINavigationControllerOperationPop) {
|
|
165
|
+
[[transitionContext containerView] insertSubview:toViewController.view belowSubview:fromViewController.view];
|
|
166
|
+
|
|
167
|
+
[UIView animateWithDuration:[self transitionDuration:transitionContext]
|
|
168
|
+
animations:^{
|
|
169
|
+
fromViewController.view.alpha = 0.0;
|
|
170
|
+
}
|
|
171
|
+
completion:^(BOOL finished) {
|
|
172
|
+
fromViewController.view.alpha = 1.0;
|
|
173
|
+
|
|
174
|
+
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
|
|
175
|
+
}];
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
- (void)animateSlideFromBottomWithTransitionContext:(id<UIViewControllerContextTransitioning>)transitionContext
|
|
180
|
+
toVC:(UIViewController *)toViewController
|
|
181
|
+
fromVC:(UIViewController *)fromViewController
|
|
182
|
+
{
|
|
183
|
+
CGAffineTransform topBottomTransform =
|
|
184
|
+
CGAffineTransformMakeTranslation(0, transitionContext.containerView.bounds.size.height);
|
|
185
|
+
|
|
186
|
+
if (_operation == UINavigationControllerOperationPush) {
|
|
187
|
+
toViewController.view.transform = topBottomTransform;
|
|
188
|
+
[[transitionContext containerView] addSubview:toViewController.view];
|
|
189
|
+
[UIView animateWithDuration:[self transitionDuration:transitionContext]
|
|
190
|
+
animations:^{
|
|
191
|
+
fromViewController.view.transform = CGAffineTransformIdentity;
|
|
192
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
193
|
+
}
|
|
194
|
+
completion:^(BOOL finished) {
|
|
195
|
+
fromViewController.view.transform = CGAffineTransformIdentity;
|
|
196
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
197
|
+
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
|
|
198
|
+
}];
|
|
199
|
+
} else if (_operation == UINavigationControllerOperationPop) {
|
|
200
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
201
|
+
[[transitionContext containerView] insertSubview:toViewController.view belowSubview:fromViewController.view];
|
|
202
|
+
|
|
203
|
+
void (^animationBlock)(void) = ^{
|
|
204
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
205
|
+
fromViewController.view.transform = topBottomTransform;
|
|
206
|
+
};
|
|
207
|
+
void (^completionBlock)(BOOL) = ^(BOOL finished) {
|
|
208
|
+
fromViewController.view.transform = CGAffineTransformIdentity;
|
|
209
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
210
|
+
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
if (!transitionContext.isInteractive) {
|
|
214
|
+
[UIView animateWithDuration:[self transitionDuration:transitionContext]
|
|
215
|
+
animations:animationBlock
|
|
216
|
+
completion:completionBlock];
|
|
217
|
+
} else {
|
|
218
|
+
// we don't want the EaseInOut option when swiping to dismiss the view, it is the same in default animation option
|
|
219
|
+
[UIView animateWithDuration:[self transitionDuration:transitionContext]
|
|
220
|
+
delay:0.0
|
|
221
|
+
options:UIViewAnimationOptionCurveLinear
|
|
222
|
+
animations:animationBlock
|
|
223
|
+
completion:completionBlock];
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
- (void)animateFadeFromBottomWithTransitionContext:(id<UIViewControllerContextTransitioning>)transitionContext
|
|
229
|
+
toVC:(UIViewController *)toViewController
|
|
230
|
+
fromVC:(UIViewController *)fromViewController
|
|
231
|
+
{
|
|
232
|
+
CGAffineTransform topBottomTransform =
|
|
233
|
+
CGAffineTransformMakeTranslation(0, 0.08 * transitionContext.containerView.bounds.size.height);
|
|
234
|
+
|
|
235
|
+
const float transitionDuration = [self transitionDuration:transitionContext];
|
|
236
|
+
|
|
237
|
+
if (_operation == UINavigationControllerOperationPush) {
|
|
238
|
+
toViewController.view.transform = topBottomTransform;
|
|
239
|
+
toViewController.view.alpha = 0.0;
|
|
240
|
+
[[transitionContext containerView] addSubview:toViewController.view];
|
|
241
|
+
|
|
242
|
+
// Android Nougat open animation
|
|
243
|
+
// http://aosp.opersys.com/xref/android-7.1.2_r37/xref/frameworks/base/core/res/res/anim/activity_open_enter.xml
|
|
244
|
+
[UIView animateWithDuration:transitionDuration * RNSSlideOpenTransitionDurationProportion // defaults to 0.35 s
|
|
245
|
+
delay:0
|
|
246
|
+
options:UIViewAnimationOptionCurveEaseOut
|
|
247
|
+
animations:^{
|
|
248
|
+
fromViewController.view.transform = CGAffineTransformIdentity;
|
|
249
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
250
|
+
}
|
|
251
|
+
completion:^(BOOL finished) {
|
|
252
|
+
fromViewController.view.transform = CGAffineTransformIdentity;
|
|
253
|
+
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
|
|
254
|
+
}];
|
|
255
|
+
[UIView animateWithDuration:transitionDuration * RNSFadeOpenTransitionDurationProportion // defaults to 0.2 s
|
|
256
|
+
delay:0
|
|
257
|
+
options:UIViewAnimationOptionCurveEaseOut
|
|
258
|
+
animations:^{
|
|
259
|
+
toViewController.view.alpha = 1.0;
|
|
260
|
+
}
|
|
261
|
+
completion:nil];
|
|
262
|
+
|
|
263
|
+
} else if (_operation == UINavigationControllerOperationPop) {
|
|
264
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
265
|
+
[[transitionContext containerView] insertSubview:toViewController.view belowSubview:fromViewController.view];
|
|
266
|
+
|
|
267
|
+
// Android Nougat exit animation
|
|
268
|
+
// http://aosp.opersys.com/xref/android-7.1.2_r37/xref/frameworks/base/core/res/res/anim/activity_close_exit.xml
|
|
269
|
+
[UIView animateWithDuration:transitionDuration * RNSSlideCloseTransitionDurationProportion // defaults to 0.25 s
|
|
270
|
+
delay:0
|
|
271
|
+
options:UIViewAnimationOptionCurveEaseIn
|
|
272
|
+
animations:^{
|
|
273
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
274
|
+
fromViewController.view.transform = topBottomTransform;
|
|
275
|
+
}
|
|
276
|
+
completion:^(BOOL finished) {
|
|
277
|
+
fromViewController.view.transform = CGAffineTransformIdentity;
|
|
278
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
279
|
+
fromViewController.view.alpha = 1.0;
|
|
280
|
+
toViewController.view.alpha = 1.0;
|
|
281
|
+
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
|
|
282
|
+
}];
|
|
283
|
+
[UIView animateWithDuration:transitionDuration * RNSFadeCloseTransitionDurationProportion // defaults to 0.15 s
|
|
284
|
+
delay:transitionDuration * RNSFadeCloseDelayTransitionDurationProportion // defaults to 0.1 s
|
|
285
|
+
options:UIViewAnimationOptionCurveLinear
|
|
286
|
+
animations:^{
|
|
287
|
+
fromViewController.view.alpha = 0.0;
|
|
288
|
+
}
|
|
289
|
+
completion:nil];
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
+ (BOOL)isCustomAnimation:(RNSScreenStackAnimation)animation
|
|
294
|
+
{
|
|
295
|
+
return (animation != RNSScreenStackAnimationFlip && animation != RNSScreenStackAnimationDefault);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
- (void)animateTransitionWithStackAnimation:(RNSScreenStackAnimation)animation
|
|
299
|
+
transitionContext:(id<UIViewControllerContextTransitioning>)transitionContext
|
|
300
|
+
toVC:(UIViewController *)toVC
|
|
301
|
+
fromVC:(UIViewController *)fromVC
|
|
302
|
+
{
|
|
303
|
+
if (animation == RNSScreenStackAnimationSimplePush) {
|
|
304
|
+
[self animateSimplePushWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
|
|
305
|
+
return;
|
|
306
|
+
} else if (animation == RNSScreenStackAnimationFade || animation == RNSScreenStackAnimationNone) {
|
|
307
|
+
[self animateFadeWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
|
|
308
|
+
return;
|
|
309
|
+
} else if (animation == RNSScreenStackAnimationSlideFromBottom) {
|
|
310
|
+
[self animateSlideFromBottomWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
|
|
311
|
+
return;
|
|
312
|
+
} else if (animation == RNSScreenStackAnimationFadeFromBottom) {
|
|
313
|
+
[self animateFadeFromBottomWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
// simple_push is the default custom animation
|
|
317
|
+
[self animateSimplePushWithTransitionContext:transitionContext toVC:toVC fromVC:fromVC];
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
@end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
#import <React/RCTViewComponentView.h>
|
|
3
|
+
#else
|
|
4
|
+
#import <React/RCTViewManager.h>
|
|
5
|
+
#endif
|
|
6
|
+
|
|
7
|
+
#import <React/RCTConvert.h>
|
|
8
|
+
#import "RNSScreen.h"
|
|
9
|
+
#import "RNSScreenStackHeaderSubview.h"
|
|
10
|
+
#import "RNSSearchBar.h"
|
|
11
|
+
|
|
12
|
+
@interface NSString (RNSStringUtil)
|
|
13
|
+
|
|
14
|
+
+ (BOOL)RNSisBlank:(NSString *)string;
|
|
15
|
+
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
@interface RNSScreenStackHeaderConfig :
|
|
19
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
20
|
+
RCTViewComponentView
|
|
21
|
+
#else
|
|
22
|
+
UIView
|
|
23
|
+
#endif
|
|
24
|
+
|
|
25
|
+
@property (nonatomic, weak) RNSScreenView *screenView;
|
|
26
|
+
|
|
27
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
28
|
+
@property (nonatomic) BOOL show;
|
|
29
|
+
#else
|
|
30
|
+
@property (nonatomic) UIBlurEffectStyle blurEffect;
|
|
31
|
+
@property (nonatomic) BOOL hide;
|
|
32
|
+
#endif
|
|
33
|
+
|
|
34
|
+
@property (nonatomic, retain) NSString *title;
|
|
35
|
+
@property (nonatomic, retain) NSString *titleFontFamily;
|
|
36
|
+
@property (nonatomic, retain) NSNumber *titleFontSize;
|
|
37
|
+
@property (nonatomic, retain) NSString *titleFontWeight;
|
|
38
|
+
@property (nonatomic, retain) UIColor *titleColor;
|
|
39
|
+
@property (nonatomic, retain) NSString *backTitle;
|
|
40
|
+
@property (nonatomic, retain) NSString *backTitleFontFamily;
|
|
41
|
+
@property (nonatomic, retain) NSNumber *backTitleFontSize;
|
|
42
|
+
@property (nonatomic, getter=isBackTitleVisible) BOOL backTitleVisible;
|
|
43
|
+
@property (nonatomic, retain) UIColor *backgroundColor;
|
|
44
|
+
@property (nonatomic, retain) UIColor *color;
|
|
45
|
+
@property (nonatomic) BOOL largeTitle;
|
|
46
|
+
@property (nonatomic, retain) NSString *largeTitleFontFamily;
|
|
47
|
+
@property (nonatomic, retain) NSNumber *largeTitleFontSize;
|
|
48
|
+
@property (nonatomic, retain) NSString *largeTitleFontWeight;
|
|
49
|
+
@property (nonatomic, retain) UIColor *largeTitleBackgroundColor;
|
|
50
|
+
@property (nonatomic) BOOL largeTitleHideShadow;
|
|
51
|
+
@property (nonatomic, retain) UIColor *largeTitleColor;
|
|
52
|
+
@property (nonatomic) BOOL hideBackButton;
|
|
53
|
+
@property (nonatomic) BOOL disableBackButtonMenu;
|
|
54
|
+
@property (nonatomic) BOOL hideShadow;
|
|
55
|
+
@property (nonatomic) BOOL translucent;
|
|
56
|
+
@property (nonatomic) BOOL backButtonInCustomView;
|
|
57
|
+
@property (nonatomic) UISemanticContentAttribute direction;
|
|
58
|
+
|
|
59
|
+
+ (void)willShowViewController:(UIViewController *)vc
|
|
60
|
+
animated:(BOOL)animated
|
|
61
|
+
withConfig:(RNSScreenStackHeaderConfig *)config;
|
|
62
|
+
|
|
63
|
+
@end
|
|
64
|
+
|
|
65
|
+
@interface RNSScreenStackHeaderConfigManager : RCTViewManager
|
|
66
|
+
|
|
67
|
+
@end
|
|
68
|
+
|
|
69
|
+
@interface RCTConvert (RNSScreenStackHeader)
|
|
70
|
+
|
|
71
|
+
+ (UIBlurEffectStyle)UIBlurEffectStyle:(id)json;
|
|
72
|
+
+ (UISemanticContentAttribute)UISemanticContentAttribute:(id)json;
|
|
73
|
+
|
|
74
|
+
@end
|