@amazon-devices/react-native-screens 2.0.9000000000 → 3.0.9000000000-rn-83
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/README.md +57 -18
- package/RNScreens.podspec +12 -30
- package/SystemBundles/d557bc3ccca761f329c4a0be9f40c5edeceaeb72783a7971e6e3dcf80a6bedb0.bundle +45130 -0
- package/SystemBundles/d557bc3ccca761f329c4a0be9f40c5edeceaeb72783a7971e6e3dcf80a6bedb0.map +13686 -0
- package/SystemModules/amzn__react-native-screens-3.modules.txt +158 -0
- package/SystemModules/amzn__react-native-screens-3.private.modules.txt +376 -0
- package/SystemModules/keplerscript-system-bundle-config.json +4 -4
- package/android/CMakeLists.txt +80 -0
- package/android/build.gradle +96 -17
- package/android/src/fabric/java/com/swmansion/rnscreens/FabricEnabledHeaderConfigViewGroup.kt +61 -0
- package/android/src/fabric/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt +38 -25
- package/android/src/fabric/java/com/swmansion/rnscreens/NativeProxy.kt +53 -0
- package/android/src/main/cpp/NativeProxy.cpp +51 -0
- package/android/src/main/cpp/NativeProxy.h +35 -0
- package/android/src/main/cpp/OnLoad.cpp +8 -0
- package/android/src/main/cpp/jni-adapter.cpp +106 -0
- package/android/src/main/java/com/swmansion/rnscreens/CustomSearchView.kt +20 -10
- package/android/src/main/java/com/swmansion/rnscreens/CustomToolbar.kt +69 -1
- package/android/src/main/java/com/swmansion/rnscreens/FragmentBackPressOverrider.kt +8 -8
- package/android/src/main/java/com/swmansion/rnscreens/InsetsObserverProxy.kt +104 -0
- package/android/src/main/java/com/swmansion/rnscreens/ModalScreenViewManager.kt +12 -0
- package/android/src/main/java/com/swmansion/rnscreens/NativeDismissalObserver.kt +12 -0
- package/android/src/main/java/com/swmansion/rnscreens/RNScreensPackage.kt +65 -7
- package/android/src/main/java/com/swmansion/rnscreens/Screen.kt +327 -84
- package/android/src/main/java/com/swmansion/rnscreens/ScreenContainer.kt +122 -72
- package/android/src/main/java/com/swmansion/rnscreens/ScreenContainerViewManager.kt +27 -4
- package/android/src/main/java/com/swmansion/rnscreens/ScreenContentWrapper.kt +38 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenContentWrapperManager.kt +25 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenEventDispatcher.kt +10 -2
- package/android/src/main/java/com/swmansion/rnscreens/ScreenFooter.kt +299 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenFooterManager.kt +25 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenFragment.kt +91 -67
- package/android/src/main/java/com/swmansion/rnscreens/ScreenFragmentWrapper.kt +12 -1
- package/android/src/main/java/com/swmansion/rnscreens/ScreenModalFragment.kt +281 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt +184 -81
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragment.kt +467 -80
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackFragmentWrapper.kt +8 -1
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt +156 -124
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigShadowNode.kt +25 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigViewManager.kt +159 -39
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderSubview.kt +24 -9
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderSubviewManager.kt +19 -13
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackViewManager.kt +31 -28
- package/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt +276 -71
- package/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt +124 -64
- package/android/src/main/java/com/swmansion/rnscreens/ScreensModule.kt +127 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreensShadowNode.kt +4 -2
- package/android/src/main/java/com/swmansion/rnscreens/SearchBarManager.kt +160 -53
- package/android/src/main/java/com/swmansion/rnscreens/SearchBarView.kt +57 -32
- package/android/src/main/java/com/swmansion/rnscreens/SearchViewFormatter.kt +15 -10
- package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/BottomSheetBehaviorExt.kt +42 -0
- package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/BottomSheetDialogRootView.kt +104 -0
- package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/BottomSheetDialogScreen.kt +26 -0
- package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/DimmingFragment.kt +493 -0
- package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/DimmingView.kt +66 -0
- package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/GestureTransparentViewGroup.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/bottomsheet/SheetUtils.kt +135 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderAttachedEvent.kt +7 -8
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderBackButtonClickedEvent.kt +8 -9
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderDetachedEvent.kt +7 -8
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderHeightChangeEvent.kt +9 -10
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenAppearEvent.kt +4 -1
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenDisappearEvent.kt +4 -1
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenDismissedEvent.kt +8 -4
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenTransitionProgressEvent.kt +13 -16
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillAppearEvent.kt +4 -1
- package/android/src/main/java/com/swmansion/rnscreens/events/ScreenWillDisappearEvent.kt +4 -1
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarBlurEvent.kt +8 -9
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarChangeTextEvent.kt +8 -11
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarCloseEvent.kt +7 -8
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarFocusEvent.kt +8 -9
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarOpenEvent.kt +7 -8
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarSearchButtonPressEvent.kt +12 -11
- package/android/src/main/java/com/swmansion/rnscreens/events/SheetDetentChangedEvent.kt +27 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/StackFinishTransitioningEvent.kt +4 -1
- package/android/src/main/java/com/swmansion/rnscreens/ext/NumericExt.kt +12 -0
- package/android/src/main/java/com/swmansion/rnscreens/ext/ViewExt.kt +32 -0
- package/android/src/main/java/com/swmansion/rnscreens/utils/DeviceUtils.kt +1 -5
- package/android/src/main/java/com/swmansion/rnscreens/utils/PaddingBundle.kt +8 -0
- package/android/src/main/java/com/swmansion/rnscreens/utils/ScreenDummyLayoutHelper.kt +282 -0
- package/android/src/main/jni/CMakeLists.txt +35 -23
- package/android/src/main/jni/rnscreens.h +3 -0
- package/android/src/main/res/base/anim/rns_ios_from_left_background_close.xml +5 -0
- package/android/src/main/res/base/anim/rns_ios_from_left_background_open.xml +5 -0
- package/android/src/main/res/base/anim/rns_ios_from_left_foreground_close.xml +6 -0
- package/android/src/main/res/base/anim/rns_ios_from_left_foreground_open.xml +6 -0
- package/android/src/main/res/base/anim/rns_ios_from_right_background_close.xml +5 -0
- package/android/src/main/res/base/anim/rns_ios_from_right_background_open.xml +5 -0
- package/android/src/main/res/base/anim/rns_ios_from_right_foreground_close.xml +6 -0
- package/android/src/main/res/base/anim/rns_ios_from_right_foreground_open.xml +6 -0
- package/android/src/main/res/base/drawable/rns_rounder_top_corners_shape.xml +8 -0
- package/android/src/main/res/v33/anim-v33/rns_default_enter_in.xml +0 -1
- package/android/src/main/res/v33/anim-v33/rns_default_enter_out.xml +2 -2
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenContainerManagerDelegate.java +25 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenContainerManagerInterface.java +16 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenContentWrapperManagerDelegate.java +25 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenContentWrapperManagerInterface.java +16 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenFooterManagerDelegate.java +25 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenFooterManagerInterface.java +16 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerDelegate.java +16 -3
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerInterface.java +7 -2
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerDelegate.java +6 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerInterface.java +2 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSSearchBarManagerDelegate.java +99 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSSearchBarManagerInterface.java +37 -0
- package/android/src/paper/java/com/swmansion/rnscreens/FabricEnabledHeaderConfigViewGroup.kt +39 -0
- package/android/src/paper/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt +11 -2
- package/android/src/paper/java/com/swmansion/rnscreens/NativeProxy.kt +19 -0
- package/android/src/paper/java/com/swmansion/rnscreens/NativeScreensModuleSpec.java +36 -0
- package/common/cpp/react/renderer/components/rnscreens/FrameCorrectionModes.h +51 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSModalScreenComponentDescriptor.h +40 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSModalScreenShadowNode.cpp +16 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSModalScreenShadowNode.h +32 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h +55 -12
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.cpp +157 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.h +31 -11
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderConfigComponentDescriptor.h +49 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderConfigShadowNode.cpp +22 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderConfigShadowNode.h +40 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderConfigState.cpp +34 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderConfigState.h +57 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderSubviewComponentDescriptor.h +27 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderSubviewShadowNode.cpp +8 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderSubviewShadowNode.h +31 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderSubviewState.cpp +15 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderSubviewState.h +39 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.cpp +23 -2
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.h +33 -8
- package/common/cpp/react/renderer/components/rnscreens/utils/RectUtil.h +36 -0
- package/cpp/RNSScreenRemovalListener.cpp +25 -0
- package/cpp/RNSScreenRemovalListener.h +20 -0
- package/cpp/RNScreensTurboModule.cpp +115 -0
- package/cpp/RNScreensTurboModule.h +40 -0
- package/gesture-handler/package.json +6 -0
- package/ios/RNSConvert.h +24 -4
- package/ios/RNSConvert.mm +180 -55
- package/ios/RNSEnums.h +48 -0
- package/ios/RNSFullWindowOverlay.mm +12 -2
- package/ios/RNSModalScreen.h +8 -0
- package/ios/RNSModalScreen.mm +65 -0
- package/ios/RNSModule.h +19 -0
- package/ios/RNSModule.mm +173 -0
- package/ios/RNSPercentDrivenInteractiveTransition.h +12 -0
- package/ios/RNSPercentDrivenInteractiveTransition.mm +69 -0
- package/ios/RNSScreen.h +24 -5
- package/ios/RNSScreen.mm +652 -173
- package/ios/RNSScreenContainer.mm +12 -1
- package/ios/RNSScreenContentWrapper.h +44 -0
- package/ios/RNSScreenContentWrapper.mm +67 -0
- package/ios/RNSScreenFooter.h +30 -0
- package/ios/RNSScreenFooter.mm +142 -0
- package/ios/RNSScreenNavigationContainer.mm +7 -0
- package/ios/RNSScreenStack.h +6 -0
- package/ios/RNSScreenStack.mm +333 -109
- package/ios/RNSScreenStackAnimator.h +15 -1
- package/ios/RNSScreenStackAnimator.mm +380 -115
- package/ios/RNSScreenStackHeaderConfig.h +74 -6
- package/ios/RNSScreenStackHeaderConfig.mm +338 -69
- package/ios/RNSScreenStackHeaderSubview.h +0 -7
- package/ios/RNSScreenStackHeaderSubview.mm +61 -24
- package/ios/RNSScreenWindowTraits.h +1 -1
- package/ios/RNSScreenWindowTraits.mm +24 -50
- package/ios/RNSSearchBar.h +5 -5
- package/ios/RNSSearchBar.mm +42 -11
- package/ios/events/RNSHeaderHeightChangeEvent.h +0 -1
- package/ios/events/RNSHeaderHeightChangeEvent.mm +15 -0
- package/ios/events/RNSScreenViewEvent.h +0 -1
- package/ios/utils/RCTSurfaceTouchHandler+RNSUtility.h +15 -0
- package/ios/utils/RCTSurfaceTouchHandler+RNSUtility.mm +14 -0
- package/ios/utils/RCTTouchHandler+RNSUtility.h +15 -0
- package/ios/utils/RCTTouchHandler+RNSUtility.mm +15 -0
- package/ios/utils/RNSDefines.h +7 -0
- package/ios/utils/RNSUIBarButtonItem.h +2 -0
- package/ios/utils/UINavigationBar+RNSUtility.h +37 -0
- package/ios/utils/UINavigationBar+RNSUtility.mm +44 -0
- package/ios/utils/UIView+RNSUtility.h +23 -0
- package/ios/utils/UIView+RNSUtility.mm +54 -0
- package/kepler-compatibility.json +2 -2
- package/lib/commonjs/TransitionProgressContext.js +2 -2
- package/lib/commonjs/TransitionProgressContext.js.map +1 -1
- package/lib/commonjs/components/DebugContainer.js +38 -0
- package/lib/commonjs/components/DebugContainer.js.map +1 -0
- package/lib/commonjs/components/DebugContainer.web.js +14 -0
- package/lib/commonjs/components/DebugContainer.web.js.map +1 -0
- package/lib/commonjs/components/FullWindowOverlay.js +31 -0
- package/lib/commonjs/components/FullWindowOverlay.js.map +1 -0
- package/lib/commonjs/components/FullWindowOverlay.web.js +9 -0
- package/lib/commonjs/components/FullWindowOverlay.web.js.map +1 -0
- package/lib/commonjs/components/Screen.js +286 -0
- package/lib/commonjs/components/Screen.js.map +1 -0
- package/lib/commonjs/components/Screen.web.js +48 -0
- package/lib/commonjs/components/Screen.web.js.map +1 -0
- package/lib/commonjs/components/ScreenContainer.js +32 -0
- package/lib/commonjs/components/ScreenContainer.js.map +1 -0
- package/lib/commonjs/components/ScreenContainer.web.js +10 -0
- package/lib/commonjs/components/ScreenContainer.web.js.map +1 -0
- package/lib/commonjs/components/ScreenContentWrapper.js +17 -0
- package/lib/commonjs/components/ScreenContentWrapper.js.map +1 -0
- package/lib/commonjs/components/ScreenContentWrapper.web.js +10 -0
- package/lib/commonjs/components/ScreenContentWrapper.web.js.map +1 -0
- package/lib/commonjs/components/ScreenFooter.js +25 -0
- package/lib/commonjs/components/ScreenFooter.js.map +1 -0
- package/lib/commonjs/components/ScreenFooter.web.js +11 -0
- package/lib/commonjs/components/ScreenFooter.web.js.map +1 -0
- package/lib/commonjs/components/ScreenStack.js +67 -0
- package/lib/commonjs/components/ScreenStack.js.map +1 -0
- package/lib/commonjs/components/ScreenStack.web.js +10 -0
- package/lib/commonjs/components/ScreenStack.web.js.map +1 -0
- package/lib/commonjs/components/ScreenStackHeaderConfig.js +100 -0
- package/lib/commonjs/components/ScreenStackHeaderConfig.js.map +1 -0
- package/lib/commonjs/components/ScreenStackHeaderConfig.web.js +39 -0
- package/lib/commonjs/components/ScreenStackHeaderConfig.web.js.map +1 -0
- package/lib/commonjs/components/ScreenStackItem.js +106 -0
- package/lib/commonjs/components/ScreenStackItem.js.map +1 -0
- package/lib/commonjs/components/SearchBar.js +67 -0
- package/lib/commonjs/components/SearchBar.js.map +1 -0
- package/lib/commonjs/components/SearchBar.web.js +10 -0
- package/lib/commonjs/components/SearchBar.web.js.map +1 -0
- package/lib/commonjs/components/helpers/DelayedFreeze.js +31 -0
- package/lib/commonjs/components/helpers/DelayedFreeze.js.map +1 -0
- package/lib/commonjs/components/helpers/usePrevious.js +16 -0
- package/lib/commonjs/components/helpers/usePrevious.js.map +1 -0
- package/lib/commonjs/contexts.js +11 -0
- package/lib/commonjs/contexts.js.map +1 -0
- package/lib/commonjs/core.js +40 -0
- package/lib/commonjs/core.js.map +1 -0
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +17 -2
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ModalScreenNativeComponent.js +14 -0
- package/lib/commonjs/fabric/ModalScreenNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/NativeScreensModule.js +10 -0
- package/lib/commonjs/fabric/NativeScreensModule.js.map +1 -0
- package/lib/commonjs/fabric/NativeScreensModule.web.js +8 -0
- package/lib/commonjs/fabric/NativeScreensModule.web.js.map +1 -0
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js +8 -11
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenContentWrapperNativeComponent.js +18 -0
- package/lib/commonjs/fabric/ScreenContentWrapperNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenFooterNativeComponent.js +10 -0
- package/lib/commonjs/fabric/ScreenFooterNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenNativeComponent.js +13 -15
- package/lib/commonjs/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js +3 -2
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js +10 -9
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js +6 -3
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js +8 -11
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/SearchBarNativeComponent.js +5 -6
- package/lib/commonjs/fabric/SearchBarNativeComponent.js.map +1 -1
- package/lib/commonjs/gesture-handler/GestureDetectorProvider.js +19 -0
- package/lib/commonjs/gesture-handler/GestureDetectorProvider.js.map +1 -0
- package/lib/commonjs/gesture-handler/RNScreensTurboModule.js +8 -0
- package/lib/commonjs/gesture-handler/RNScreensTurboModule.js.map +1 -0
- package/lib/commonjs/gesture-handler/ScreenGestureDetector.js +200 -0
- package/lib/commonjs/gesture-handler/ScreenGestureDetector.js.map +1 -0
- package/lib/commonjs/gesture-handler/constraints.js +64 -0
- package/lib/commonjs/gesture-handler/constraints.js.map +1 -0
- package/lib/commonjs/gesture-handler/defaults.js +45 -0
- package/lib/commonjs/gesture-handler/defaults.js.map +1 -0
- package/lib/commonjs/gesture-handler/fabricUtils.js +66 -0
- package/lib/commonjs/gesture-handler/fabricUtils.js.map +1 -0
- package/lib/commonjs/gesture-handler/fabricUtils.web.js +17 -0
- package/lib/commonjs/gesture-handler/fabricUtils.web.js.map +1 -0
- package/lib/commonjs/gesture-handler/index.js +14 -0
- package/lib/commonjs/gesture-handler/index.js.map +1 -0
- package/lib/commonjs/index.js +157 -95
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native-stack/contexts/GHContext.js +12 -0
- package/lib/commonjs/native-stack/contexts/GHContext.js.map +1 -0
- package/lib/commonjs/native-stack/index.js +1 -1
- package/lib/commonjs/native-stack/index.js.map +1 -1
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js +24 -24
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/commonjs/native-stack/types.js.map +1 -1
- package/lib/commonjs/native-stack/utils/AnimatedHeaderHeightContext.js +1 -2
- package/lib/commonjs/native-stack/utils/AnimatedHeaderHeightContext.js.map +1 -1
- package/lib/commonjs/native-stack/utils/HeaderHeightContext.js +1 -2
- package/lib/commonjs/native-stack/utils/HeaderHeightContext.js.map +1 -1
- package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js +1 -2
- package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
- package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
- package/lib/commonjs/native-stack/utils/getStatusBarHeight.js +22 -0
- package/lib/commonjs/native-stack/utils/getStatusBarHeight.js.map +1 -0
- package/lib/commonjs/native-stack/utils/useAnimatedHeaderHeight.js +2 -3
- package/lib/commonjs/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -1
- package/lib/commonjs/native-stack/utils/useBackPressSubscription.js +5 -6
- package/lib/commonjs/native-stack/utils/useBackPressSubscription.js.map +1 -1
- package/lib/commonjs/native-stack/utils/useHeaderHeight.js +2 -3
- package/lib/commonjs/native-stack/utils/useHeaderHeight.js.map +1 -1
- package/lib/commonjs/native-stack/views/FontProcessor.js +2 -4
- package/lib/commonjs/native-stack/views/FontProcessor.js.map +1 -1
- package/lib/commonjs/native-stack/views/FooterComponent.js +17 -0
- package/lib/commonjs/native-stack/views/FooterComponent.js.map +1 -0
- package/lib/commonjs/native-stack/views/HeaderConfig.js +23 -15
- package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.js +124 -56
- package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedHeaderHeightContext.js +1 -2
- package/lib/commonjs/reanimated/ReanimatedHeaderHeightContext.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js +14 -21
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedScreen.js +4 -4
- package/lib/commonjs/reanimated/ReanimatedScreen.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js +10 -18
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js +1 -2
- package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js.map +1 -1
- package/lib/commonjs/reanimated/index.js +1 -1
- package/lib/commonjs/reanimated/index.js.map +1 -1
- package/lib/commonjs/reanimated/useReanimatedHeaderHeight.js +4 -5
- package/lib/commonjs/reanimated/useReanimatedHeaderHeight.js.map +1 -1
- package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js +2 -3
- package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/useTransitionProgress.js +2 -3
- package/lib/commonjs/useTransitionProgress.js.map +1 -1
- package/lib/commonjs/utils.js +28 -6
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/TransitionProgressContext.js +2 -0
- package/lib/module/TransitionProgressContext.js.map +1 -1
- package/lib/module/components/DebugContainer.js +30 -0
- package/lib/module/components/DebugContainer.js.map +1 -0
- package/lib/module/components/DebugContainer.web.js +6 -0
- package/lib/module/components/DebugContainer.web.js.map +1 -0
- package/lib/module/components/FullWindowOverlay.js +24 -0
- package/lib/module/components/FullWindowOverlay.js.map +1 -0
- package/lib/module/components/FullWindowOverlay.web.js +3 -0
- package/lib/module/components/FullWindowOverlay.web.js.map +1 -0
- package/lib/module/components/Screen.js +282 -0
- package/lib/module/components/Screen.js.map +1 -0
- package/lib/module/components/Screen.web.js +41 -0
- package/lib/module/components/Screen.web.js.map +1 -0
- package/lib/module/components/ScreenContainer.js +26 -0
- package/lib/module/components/ScreenContainer.js.map +1 -0
- package/lib/module/components/ScreenContainer.web.js +4 -0
- package/lib/module/components/ScreenContainer.web.js.map +1 -0
- package/lib/module/components/ScreenContentWrapper.js +10 -0
- package/lib/module/components/ScreenContentWrapper.js.map +1 -0
- package/lib/module/components/ScreenContentWrapper.web.js +4 -0
- package/lib/module/components/ScreenContentWrapper.web.js.map +1 -0
- package/lib/module/components/ScreenFooter.js +18 -0
- package/lib/module/components/ScreenFooter.js.map +1 -0
- package/lib/module/components/ScreenFooter.web.js +6 -0
- package/lib/module/components/ScreenFooter.web.js.map +1 -0
- package/lib/module/components/ScreenStack.js +63 -0
- package/lib/module/components/ScreenStack.js.map +1 -0
- package/lib/module/components/ScreenStack.web.js +4 -0
- package/lib/module/components/ScreenStack.web.js.map +1 -0
- package/lib/module/components/ScreenStackHeaderConfig.js +91 -0
- package/lib/module/components/ScreenStackHeaderConfig.js.map +1 -0
- package/lib/module/components/ScreenStackHeaderConfig.web.js +26 -0
- package/lib/module/components/ScreenStackHeaderConfig.web.js.map +1 -0
- package/lib/module/components/ScreenStackItem.js +98 -0
- package/lib/module/components/ScreenStackItem.js.map +1 -0
- package/lib/module/components/SearchBar.js +62 -0
- package/lib/module/components/SearchBar.js.map +1 -0
- package/lib/module/components/SearchBar.web.js +4 -0
- package/lib/module/components/SearchBar.web.js.map +1 -0
- package/lib/module/components/helpers/DelayedFreeze.js +24 -0
- package/lib/module/components/helpers/DelayedFreeze.js.map +1 -0
- package/lib/module/components/helpers/usePrevious.js +10 -0
- package/lib/module/components/helpers/usePrevious.js.map +1 -0
- package/lib/module/contexts.js +4 -0
- package/lib/module/contexts.js.map +1 -0
- package/lib/module/core.js +31 -0
- package/lib/module/core.js.map +1 -0
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js +16 -0
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
- package/lib/module/fabric/ModalScreenNativeComponent.js +10 -0
- package/lib/module/fabric/ModalScreenNativeComponent.js.map +1 -0
- package/lib/module/fabric/NativeScreensModule.js +5 -0
- package/lib/module/fabric/NativeScreensModule.js.map +1 -0
- package/lib/module/fabric/NativeScreensModule.web.js +2 -0
- package/lib/module/fabric/NativeScreensModule.web.js.map +1 -0
- package/lib/module/fabric/ScreenContainerNativeComponent.js +3 -4
- package/lib/module/fabric/ScreenContainerNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenContentWrapperNativeComponent.js +10 -0
- package/lib/module/fabric/ScreenContentWrapperNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenFooterNativeComponent.js +3 -0
- package/lib/module/fabric/ScreenFooterNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenNativeComponent.js +8 -7
- package/lib/module/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js +2 -0
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js +8 -2
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js +5 -1
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackNativeComponent.js +3 -3
- package/lib/module/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/module/fabric/SearchBarNativeComponent.js +3 -1
- package/lib/module/fabric/SearchBarNativeComponent.js.map +1 -1
- package/lib/module/gesture-handler/GestureDetectorProvider.js +12 -0
- package/lib/module/gesture-handler/GestureDetectorProvider.js.map +1 -0
- package/lib/module/gesture-handler/RNScreensTurboModule.js +2 -0
- package/lib/module/gesture-handler/RNScreensTurboModule.js.map +1 -0
- package/lib/module/gesture-handler/ScreenGestureDetector.js +193 -0
- package/lib/module/gesture-handler/ScreenGestureDetector.js.map +1 -0
- package/lib/module/gesture-handler/constraints.js +56 -0
- package/lib/module/gesture-handler/constraints.js.map +1 -0
- package/lib/module/gesture-handler/defaults.js +39 -0
- package/lib/module/gesture-handler/defaults.js.map +1 -0
- package/lib/module/gesture-handler/fabricUtils.js +61 -0
- package/lib/module/gesture-handler/fabricUtils.js.map +1 -0
- package/lib/module/gesture-handler/fabricUtils.web.js +10 -0
- package/lib/module/gesture-handler/fabricUtils.web.js.map +1 -0
- package/lib/module/gesture-handler/index.js +5 -0
- package/lib/module/gesture-handler/index.js.map +1 -0
- package/lib/module/index.js +29 -64
- package/lib/module/index.js.map +1 -1
- package/lib/module/native-stack/contexts/GHContext.js +6 -0
- package/lib/module/native-stack/contexts/GHContext.js.map +1 -0
- package/lib/module/native-stack/index.js.map +1 -1
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js +22 -21
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/module/native-stack/types.js.map +1 -1
- package/lib/module/native-stack/utils/AnimatedHeaderHeightContext.js.map +1 -1
- package/lib/module/native-stack/utils/HeaderHeightContext.js.map +1 -1
- package/lib/module/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
- package/lib/module/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
- package/lib/module/native-stack/utils/getStatusBarHeight.js +16 -0
- package/lib/module/native-stack/utils/getStatusBarHeight.js.map +1 -0
- package/lib/module/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -1
- package/lib/module/native-stack/utils/useBackPressSubscription.js +4 -5
- package/lib/module/native-stack/utils/useBackPressSubscription.js.map +1 -1
- package/lib/module/native-stack/utils/useHeaderHeight.js.map +1 -1
- package/lib/module/native-stack/views/FontProcessor.js +2 -3
- package/lib/module/native-stack/views/FontProcessor.js.map +1 -1
- package/lib/module/native-stack/views/FooterComponent.js +10 -0
- package/lib/module/native-stack/views/FooterComponent.js.map +1 -0
- package/lib/module/native-stack/views/HeaderConfig.js +14 -6
- package/lib/module/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/module/native-stack/views/NativeStackView.js +118 -47
- package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/module/reanimated/ReanimatedHeaderHeightContext.js.map +1 -1
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js +9 -13
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/module/reanimated/ReanimatedScreen.js +2 -3
- package/lib/module/reanimated/ReanimatedScreen.js.map +1 -1
- package/lib/module/reanimated/ReanimatedScreenProvider.js +8 -16
- package/lib/module/reanimated/ReanimatedScreenProvider.js.map +1 -1
- package/lib/module/reanimated/ReanimatedTransitionProgressContext.js.map +1 -1
- package/lib/module/reanimated/index.js.map +1 -1
- package/lib/module/reanimated/useReanimatedHeaderHeight.js +1 -1
- package/lib/module/reanimated/useReanimatedHeaderHeight.js.map +1 -1
- package/lib/module/reanimated/useReanimatedTransitionProgress.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/useTransitionProgress.js.map +1 -1
- package/lib/module/utils.js +26 -5
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/TransitionProgressContext.d.ts +2 -1
- package/lib/typescript/TransitionProgressContext.d.ts.map +1 -0
- package/lib/typescript/components/DebugContainer.d.ts +15 -0
- package/lib/typescript/components/DebugContainer.d.ts.map +1 -0
- package/lib/typescript/components/DebugContainer.web.d.ts +4 -0
- package/lib/typescript/components/DebugContainer.web.d.ts.map +1 -0
- package/lib/typescript/components/FullWindowOverlay.d.ts +6 -0
- package/lib/typescript/components/FullWindowOverlay.d.ts.map +1 -0
- package/lib/typescript/components/FullWindowOverlay.web.d.ts +6 -0
- package/lib/typescript/components/FullWindowOverlay.web.d.ts.map +1 -0
- package/lib/typescript/components/Screen.d.ts +8 -0
- package/lib/typescript/components/Screen.d.ts.map +1 -0
- package/lib/typescript/components/Screen.web.d.ts +11 -0
- package/lib/typescript/components/Screen.web.d.ts.map +1 -0
- package/lib/typescript/components/ScreenContainer.d.ts +5 -0
- package/lib/typescript/components/ScreenContainer.d.ts.map +1 -0
- package/lib/typescript/components/ScreenContainer.web.d.ts +4 -0
- package/lib/typescript/components/ScreenContainer.web.d.ts.map +1 -0
- package/lib/typescript/components/ScreenContentWrapper.d.ts +5 -0
- package/lib/typescript/components/ScreenContentWrapper.d.ts.map +1 -0
- package/lib/typescript/components/ScreenContentWrapper.web.d.ts +4 -0
- package/lib/typescript/components/ScreenContentWrapper.web.d.ts.map +1 -0
- package/lib/typescript/components/ScreenFooter.d.ts +12 -0
- package/lib/typescript/components/ScreenFooter.d.ts.map +1 -0
- package/lib/typescript/components/ScreenFooter.web.d.ts +6 -0
- package/lib/typescript/components/ScreenFooter.web.d.ts.map +1 -0
- package/lib/typescript/components/ScreenStack.d.ts +5 -0
- package/lib/typescript/components/ScreenStack.d.ts.map +1 -0
- package/lib/typescript/components/ScreenStack.web.d.ts +4 -0
- package/lib/typescript/components/ScreenStack.web.d.ts.map +1 -0
- package/lib/typescript/components/ScreenStackHeaderConfig.d.ts +13 -0
- package/lib/typescript/components/ScreenStackHeaderConfig.d.ts.map +1 -0
- package/lib/typescript/components/ScreenStackHeaderConfig.web.d.ts +13 -0
- package/lib/typescript/components/ScreenStackHeaderConfig.web.d.ts.map +1 -0
- package/lib/typescript/components/ScreenStackItem.d.ts +11 -0
- package/lib/typescript/components/ScreenStackItem.d.ts.map +1 -0
- package/lib/typescript/components/SearchBar.d.ts +5 -0
- package/lib/typescript/components/SearchBar.d.ts.map +1 -0
- package/lib/typescript/components/SearchBar.web.d.ts +4 -0
- package/lib/typescript/components/SearchBar.web.d.ts.map +1 -0
- package/lib/typescript/components/helpers/DelayedFreeze.d.ts +8 -0
- package/lib/typescript/components/helpers/DelayedFreeze.d.ts.map +1 -0
- package/lib/typescript/components/helpers/usePrevious.d.ts +2 -0
- package/lib/typescript/components/helpers/usePrevious.d.ts.map +1 -0
- package/lib/typescript/contexts.d.ts +5 -0
- package/lib/typescript/contexts.d.ts.map +1 -0
- package/lib/typescript/core.d.ts +6 -0
- package/lib/typescript/core.d.ts.map +1 -0
- package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts +1 -1
- package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/ModalScreenNativeComponent.d.ts +76 -0
- package/lib/typescript/fabric/ModalScreenNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/NativeScreensModule.d.ts +6 -0
- package/lib/typescript/fabric/NativeScreensModule.d.ts.map +1 -0
- package/lib/typescript/fabric/NativeScreensModule.web.d.ts +3 -0
- package/lib/typescript/fabric/NativeScreensModule.web.d.ts.map +1 -0
- package/lib/typescript/fabric/ScreenContainerNativeComponent.d.ts +1 -0
- package/lib/typescript/fabric/ScreenContainerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/ScreenContentWrapperNativeComponent.d.ts +6 -0
- package/lib/typescript/fabric/ScreenContentWrapperNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/ScreenFooterNativeComponent.d.ts +7 -0
- package/lib/typescript/fabric/ScreenFooterNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/ScreenNativeComponent.d.ts +34 -24
- package/lib/typescript/fabric/ScreenNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/ScreenNavigationContainerNativeComponent.d.ts +1 -1
- package/lib/typescript/fabric/ScreenNavigationContainerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts +12 -2
- package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts +2 -2
- package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts +4 -2
- package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts.map +1 -0
- package/lib/typescript/fabric/SearchBarNativeComponent.d.ts +17 -16
- package/lib/typescript/fabric/SearchBarNativeComponent.d.ts.map +1 -0
- package/lib/typescript/gesture-handler/GestureDetectorProvider.d.ts +5 -0
- package/lib/typescript/gesture-handler/GestureDetectorProvider.d.ts.map +1 -0
- package/lib/typescript/gesture-handler/RNScreensTurboModule.d.ts +13 -0
- package/lib/typescript/gesture-handler/RNScreensTurboModule.d.ts.map +1 -0
- package/lib/typescript/gesture-handler/ScreenGestureDetector.d.ts +5 -0
- package/lib/typescript/gesture-handler/ScreenGestureDetector.d.ts.map +1 -0
- package/lib/typescript/gesture-handler/constraints.d.ts +6 -0
- package/lib/typescript/gesture-handler/constraints.d.ts.map +1 -0
- package/lib/typescript/gesture-handler/defaults.d.ts +20 -0
- package/lib/typescript/gesture-handler/defaults.d.ts.map +1 -0
- package/lib/typescript/gesture-handler/fabricUtils.d.ts +10 -0
- package/lib/typescript/gesture-handler/fabricUtils.d.ts.map +1 -0
- package/lib/typescript/gesture-handler/fabricUtils.web.d.ts +6 -0
- package/lib/typescript/gesture-handler/fabricUtils.web.d.ts.map +1 -0
- package/lib/typescript/gesture-handler/index.d.ts +2 -0
- package/lib/typescript/gesture-handler/index.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +25 -31
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/native-stack/contexts/GHContext.d.ts +4 -0
- package/lib/typescript/native-stack/contexts/GHContext.d.ts.map +1 -0
- package/lib/typescript/native-stack/index.d.ts +1 -0
- package/lib/typescript/native-stack/index.d.ts.map +1 -0
- package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +4 -0
- package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -0
- package/lib/typescript/native-stack/types.d.ts +191 -33
- package/lib/typescript/native-stack/types.d.ts.map +1 -0
- package/lib/typescript/native-stack/utils/AnimatedHeaderHeightContext.d.ts +1 -0
- package/lib/typescript/native-stack/utils/AnimatedHeaderHeightContext.d.ts.map +1 -0
- package/lib/typescript/native-stack/utils/HeaderHeightContext.d.ts +1 -0
- package/lib/typescript/native-stack/utils/HeaderHeightContext.d.ts.map +1 -0
- package/lib/typescript/native-stack/utils/SafeAreaProviderCompat.d.ts +2 -1
- package/lib/typescript/native-stack/utils/SafeAreaProviderCompat.d.ts.map +1 -0
- package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts +3 -2
- package/lib/typescript/native-stack/utils/getDefaultHeaderHeight.d.ts.map +1 -0
- package/lib/typescript/native-stack/utils/getStatusBarHeight.d.ts +3 -0
- package/lib/typescript/native-stack/utils/getStatusBarHeight.d.ts.map +1 -0
- package/lib/typescript/native-stack/utils/useAnimatedHeaderHeight.d.ts +2 -1
- package/lib/typescript/native-stack/utils/useAnimatedHeaderHeight.d.ts.map +1 -0
- package/lib/typescript/native-stack/utils/useBackPressSubscription.d.ts +1 -0
- package/lib/typescript/native-stack/utils/useBackPressSubscription.d.ts.map +1 -0
- package/lib/typescript/native-stack/utils/useHeaderHeight.d.ts +1 -0
- package/lib/typescript/native-stack/utils/useHeaderHeight.d.ts.map +1 -0
- package/lib/typescript/native-stack/views/FontProcessor.d.ts +1 -0
- package/lib/typescript/native-stack/views/FontProcessor.d.ts.map +1 -0
- package/lib/typescript/native-stack/views/FooterComponent.d.ts +7 -0
- package/lib/typescript/native-stack/views/FooterComponent.d.ts.map +1 -0
- package/lib/typescript/native-stack/views/HeaderConfig.d.ts +4 -3
- package/lib/typescript/native-stack/views/HeaderConfig.d.ts.map +1 -0
- package/lib/typescript/native-stack/views/NativeStackView.d.ts +2 -1
- package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -0
- package/lib/typescript/reanimated/ReanimatedHeaderHeightContext.d.ts +1 -0
- package/lib/typescript/reanimated/ReanimatedHeaderHeightContext.d.ts.map +1 -0
- package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +3 -3
- package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts.map +1 -0
- package/lib/typescript/reanimated/ReanimatedScreen.d.ts +3 -3
- package/lib/typescript/reanimated/ReanimatedScreen.d.ts.map +1 -0
- package/lib/typescript/reanimated/ReanimatedScreenProvider.d.ts +1 -0
- package/lib/typescript/reanimated/ReanimatedScreenProvider.d.ts.map +1 -0
- package/lib/typescript/reanimated/ReanimatedTransitionProgressContext.d.ts +2 -1
- package/lib/typescript/reanimated/ReanimatedTransitionProgressContext.d.ts.map +1 -0
- package/lib/typescript/reanimated/index.d.ts +1 -0
- package/lib/typescript/reanimated/index.d.ts.map +1 -0
- package/lib/typescript/reanimated/useReanimatedHeaderHeight.d.ts +2 -3
- package/lib/typescript/reanimated/useReanimatedHeaderHeight.d.ts.map +1 -0
- package/lib/typescript/reanimated/useReanimatedTransitionProgress.d.ts +4 -9
- package/lib/typescript/reanimated/useReanimatedTransitionProgress.d.ts.map +1 -0
- package/lib/typescript/types.d.ts +187 -37
- package/lib/typescript/types.d.ts.map +1 -0
- package/lib/typescript/useTransitionProgress.d.ts +4 -3
- package/lib/typescript/useTransitionProgress.d.ts.map +1 -0
- package/lib/typescript/utils.d.ts +27 -1
- package/lib/typescript/utils.d.ts.map +1 -0
- package/native-stack/README.md +156 -108
- package/native-stack/package.json +4 -4
- package/oss-attribution/attribution.txt +77 -0
- package/oss-attribution/licenseInfos.json +27 -0
- package/package.json +196 -1
- package/react-native.config.js +19 -16
- package/reanimated/package.json +1 -1
- package/src/TransitionProgressContext.tsx +3 -1
- package/src/components/DebugContainer.tsx +46 -0
- package/src/components/DebugContainer.web.tsx +7 -0
- package/src/components/FullWindowOverlay.tsx +33 -0
- package/src/components/FullWindowOverlay.web.tsx +6 -0
- package/src/components/Screen.tsx +392 -0
- package/src/components/Screen.web.tsx +47 -0
- package/src/components/ScreenContainer.tsx +28 -0
- package/src/components/ScreenContainer.web.tsx +5 -0
- package/src/components/ScreenContentWrapper.tsx +9 -0
- package/src/components/ScreenContentWrapper.web.tsx +5 -0
- package/src/components/ScreenFooter.tsx +20 -0
- package/src/components/ScreenFooter.web.tsx +7 -0
- package/src/components/ScreenStack.tsx +112 -0
- package/src/components/ScreenStack.web.tsx +5 -0
- package/src/components/ScreenStackHeaderConfig.tsx +127 -0
- package/src/components/ScreenStackHeaderConfig.web.tsx +45 -0
- package/src/components/ScreenStackItem.tsx +174 -0
- package/src/components/SearchBar.tsx +105 -0
- package/src/components/SearchBar.web.tsx +5 -0
- package/src/components/helpers/DelayedFreeze.tsx +27 -0
- package/src/components/helpers/usePrevious.tsx +12 -0
- package/src/contexts.tsx +9 -0
- package/src/core.ts +45 -0
- package/src/fabric/FullWindowOverlayNativeComponent.ts +16 -0
- package/src/fabric/ModalScreenNativeComponent.ts +115 -0
- package/src/fabric/NativeScreensModule.ts +8 -0
- package/src/fabric/NativeScreensModule.web.ts +1 -0
- package/src/fabric/ScreenContainerNativeComponent.ts +3 -3
- package/src/fabric/ScreenContentWrapperNativeComponent.ts +14 -0
- package/src/fabric/ScreenFooterNativeComponent.ts +6 -0
- package/src/fabric/ScreenNativeComponent.ts +34 -23
- package/src/fabric/ScreenNavigationContainerNativeComponent.ts +3 -1
- package/src/fabric/ScreenStackHeaderConfigNativeComponent.ts +38 -2
- package/src/fabric/ScreenStackHeaderSubviewNativeComponent.ts +5 -1
- package/src/fabric/ScreenStackNativeComponent.ts +3 -2
- package/src/fabric/SearchBarNativeComponent.ts +17 -13
- package/src/gesture-handler/GestureDetectorProvider.tsx +16 -0
- package/src/gesture-handler/RNScreensTurboModule.ts +13 -0
- package/src/gesture-handler/ScreenGestureDetector.tsx +241 -0
- package/src/gesture-handler/constraints.ts +87 -0
- package/src/gesture-handler/defaults.ts +46 -0
- package/src/gesture-handler/fabricUtils.ts +86 -0
- package/src/gesture-handler/fabricUtils.web.ts +10 -0
- package/src/gesture-handler/index.tsx +4 -0
- package/src/index.tsx +49 -113
- package/src/native-stack/contexts/GHContext.tsx +9 -0
- package/src/native-stack/navigators/createNativeStackNavigator.tsx +6 -3
- package/src/native-stack/types.tsx +204 -31
- package/src/native-stack/utils/getDefaultHeaderHeight.tsx +2 -2
- package/src/native-stack/utils/getStatusBarHeight.tsx +22 -0
- package/src/native-stack/utils/useAnimatedHeaderHeight.tsx +1 -1
- package/src/native-stack/utils/useBackPressSubscription.tsx +3 -2
- package/src/native-stack/utils/useHeaderHeight.tsx +1 -1
- package/src/native-stack/views/FontProcessor.tsx +2 -2
- package/src/native-stack/views/FooterComponent.tsx +10 -0
- package/src/native-stack/views/HeaderConfig.tsx +22 -6
- package/src/native-stack/views/NativeStackView.tsx +141 -54
- package/src/reanimated/ReanimatedHeaderHeightContext.tsx +1 -1
- package/src/reanimated/ReanimatedNativeStackScreen.tsx +15 -13
- package/src/reanimated/ReanimatedScreen.tsx +4 -3
- package/src/reanimated/ReanimatedScreenProvider.tsx +3 -2
- package/src/reanimated/useReanimatedHeaderHeight.tsx +2 -2
- package/src/reanimated/useReanimatedTransitionProgress.tsx +1 -1
- package/src/types.tsx +213 -41
- package/src/useTransitionProgress.tsx +1 -1
- package/src/utils.ts +27 -5
- package/windows/README.md +4 -1
- package/windows/RNScreens/Screen.h +3 -1
- package/SystemBundles/3d72c1ccdc1866604203e2067a94f7ab2c45408da644bb242aa980ffea58a74d.bundle +0 -33190
- package/SystemBundles/3d72c1ccdc1866604203e2067a94f7ab2c45408da644bb242aa980ffea58a74d.map +0 -10181
- package/SystemModules/amzn__react-native-screens.modules.txt +0 -101
- package/SystemModules/amzn__react-native-screens.private.modules.txt +0 -243
- package/lib/commonjs/index.native.js +0 -409
- package/lib/commonjs/index.native.js.map +0 -1
- package/lib/module/index.native.js +0 -412
- package/lib/module/index.native.js.map +0 -1
- package/lib/typescript/index.native.d.ts +0 -2
- package/src/index.native.tsx +0 -601
|
@@ -2,12 +2,13 @@ package com.swmansion.rnscreens
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context
|
|
4
4
|
import android.graphics.PorterDuff
|
|
5
|
+
import android.graphics.PorterDuffColorFilter
|
|
5
6
|
import android.os.Build
|
|
6
7
|
import android.text.TextUtils
|
|
7
8
|
import android.util.TypedValue
|
|
8
9
|
import android.view.Gravity
|
|
9
10
|
import android.view.View.OnClickListener
|
|
10
|
-
import android.view.
|
|
11
|
+
import android.view.WindowInsets
|
|
11
12
|
import android.widget.ImageView
|
|
12
13
|
import android.widget.TextView
|
|
13
14
|
import androidx.appcompat.app.AppCompatActivity
|
|
@@ -21,88 +22,105 @@ import com.facebook.react.views.text.ReactTypefaceUtils
|
|
|
21
22
|
import com.swmansion.rnscreens.events.HeaderAttachedEvent
|
|
22
23
|
import com.swmansion.rnscreens.events.HeaderDetachedEvent
|
|
23
24
|
|
|
24
|
-
class ScreenStackHeaderConfig(
|
|
25
|
-
|
|
25
|
+
class ScreenStackHeaderConfig(
|
|
26
|
+
context: Context,
|
|
27
|
+
) : FabricEnabledHeaderConfigViewGroup(context) {
|
|
28
|
+
private val configSubviews = ArrayList<ScreenStackHeaderSubview>(3)
|
|
26
29
|
val toolbar: CustomToolbar
|
|
30
|
+
var isHeaderHidden = false // named this way to avoid conflict with platform's isHidden
|
|
31
|
+
var isHeaderTranslucent = false // named this way to avoid conflict with platform's isTranslucent
|
|
27
32
|
private var headerTopInset: Int? = null
|
|
28
|
-
private var
|
|
29
|
-
private var
|
|
30
|
-
private var
|
|
31
|
-
private var
|
|
32
|
-
private var
|
|
33
|
-
private var
|
|
34
|
-
private var
|
|
35
|
-
private var
|
|
36
|
-
private var
|
|
37
|
-
private var
|
|
38
|
-
private var
|
|
39
|
-
private var
|
|
40
|
-
private var
|
|
41
|
-
private var
|
|
42
|
-
private
|
|
43
|
-
private
|
|
44
|
-
private val
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
33
|
+
private var title: String? = null
|
|
34
|
+
private var titleColor = 0
|
|
35
|
+
private var titleFontFamily: String? = null
|
|
36
|
+
private var direction: String? = null
|
|
37
|
+
private var titleFontSize = 0f
|
|
38
|
+
private var titleFontWeight = 0
|
|
39
|
+
private var backgroundColor: Int? = null
|
|
40
|
+
private var isBackButtonHidden = false
|
|
41
|
+
private var isShadowHidden = false
|
|
42
|
+
private var isDestroyed = false
|
|
43
|
+
private var backButtonInCustomView = false
|
|
44
|
+
private var isTopInsetEnabled = true
|
|
45
|
+
private var tintColor = 0
|
|
46
|
+
private var isAttachedToWindow = false
|
|
47
|
+
private val defaultStartInset: Int
|
|
48
|
+
private val defaultStartInsetWithNavigation: Int
|
|
49
|
+
private val backClickListener =
|
|
50
|
+
OnClickListener {
|
|
51
|
+
screenFragment?.let {
|
|
52
|
+
val stack = screenStack
|
|
53
|
+
if (stack != null && stack.rootScreen == it.screen) {
|
|
54
|
+
val parentFragment = it.parentFragment
|
|
55
|
+
if (parentFragment is ScreenStackFragment) {
|
|
56
|
+
if (parentFragment.screen.nativeBackButtonDismissalEnabled) {
|
|
57
|
+
parentFragment.dismissFromContainer()
|
|
58
|
+
} else {
|
|
59
|
+
parentFragment.dispatchHeaderBackButtonClickedEvent()
|
|
60
|
+
}
|
|
56
61
|
}
|
|
57
|
-
}
|
|
58
|
-
} else {
|
|
59
|
-
if (it.screen.nativeBackButtonDismissalEnabled) {
|
|
60
|
-
it.dismiss()
|
|
61
62
|
} else {
|
|
62
|
-
it.
|
|
63
|
+
if (it.screen.nativeBackButtonDismissalEnabled) {
|
|
64
|
+
it.dismissFromContainer()
|
|
65
|
+
} else {
|
|
66
|
+
it.dispatchHeaderBackButtonClickedEvent()
|
|
67
|
+
}
|
|
63
68
|
}
|
|
64
69
|
}
|
|
65
70
|
}
|
|
66
|
-
}
|
|
67
71
|
|
|
68
|
-
override fun onLayout(
|
|
72
|
+
override fun onLayout(
|
|
73
|
+
changed: Boolean,
|
|
74
|
+
l: Int,
|
|
75
|
+
t: Int,
|
|
76
|
+
r: Int,
|
|
77
|
+
b: Int,
|
|
78
|
+
) {
|
|
69
79
|
// no-op
|
|
70
80
|
}
|
|
71
81
|
|
|
72
82
|
fun destroy() {
|
|
73
|
-
|
|
83
|
+
isDestroyed = true
|
|
74
84
|
}
|
|
75
85
|
|
|
76
86
|
override fun onAttachedToWindow() {
|
|
77
87
|
super.onAttachedToWindow()
|
|
78
|
-
|
|
88
|
+
isAttachedToWindow = true
|
|
79
89
|
val surfaceId = UIManagerHelper.getSurfaceId(this)
|
|
80
|
-
UIManagerHelper
|
|
90
|
+
UIManagerHelper
|
|
91
|
+
.getEventDispatcherForReactTag(context as ReactContext, id)
|
|
81
92
|
?.dispatchEvent(HeaderAttachedEvent(surfaceId, id))
|
|
82
93
|
// we want to save the top inset before the status bar can be hidden, which would resolve in
|
|
83
94
|
// inset being 0
|
|
84
95
|
if (headerTopInset == null) {
|
|
85
|
-
headerTopInset =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
96
|
+
headerTopInset =
|
|
97
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
|
98
|
+
rootWindowInsets.getInsets(WindowInsets.Type.systemBars()).top
|
|
99
|
+
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
100
|
+
rootWindowInsets.systemWindowInsetTop
|
|
101
|
+
} else {
|
|
102
|
+
// Hacky fallback for old android. Before Marshmallow, the status bar height was always 25
|
|
103
|
+
(25 * resources.displayMetrics.density).toInt()
|
|
104
|
+
}
|
|
90
105
|
}
|
|
91
106
|
onUpdate()
|
|
92
107
|
}
|
|
93
108
|
|
|
94
109
|
override fun onDetachedFromWindow() {
|
|
95
110
|
super.onDetachedFromWindow()
|
|
96
|
-
|
|
111
|
+
isAttachedToWindow = false
|
|
97
112
|
val surfaceId = UIManagerHelper.getSurfaceId(this)
|
|
98
|
-
UIManagerHelper
|
|
113
|
+
UIManagerHelper
|
|
114
|
+
.getEventDispatcherForReactTag(context as ReactContext, id)
|
|
99
115
|
?.dispatchEvent(HeaderDetachedEvent(surfaceId, id))
|
|
100
116
|
}
|
|
101
117
|
|
|
102
118
|
private val screen: Screen?
|
|
103
119
|
get() = parent as? Screen
|
|
120
|
+
|
|
104
121
|
private val screenStack: ScreenStack?
|
|
105
122
|
get() = screen?.container as? ScreenStack
|
|
123
|
+
|
|
106
124
|
val screenFragment: ScreenStackFragment?
|
|
107
125
|
get() {
|
|
108
126
|
val screen = parent
|
|
@@ -119,15 +137,15 @@ class ScreenStackHeaderConfig(context: Context) : ViewGroup(context) {
|
|
|
119
137
|
val stack = screenStack
|
|
120
138
|
val isTop = stack == null || stack.topScreen == parent
|
|
121
139
|
|
|
122
|
-
if (!
|
|
140
|
+
if (!isAttachedToWindow || !isTop || isDestroyed) {
|
|
123
141
|
return
|
|
124
142
|
}
|
|
125
143
|
|
|
126
144
|
val activity = screenFragment?.activity as AppCompatActivity? ?: return
|
|
127
|
-
if (
|
|
128
|
-
if (
|
|
145
|
+
if (direction != null) {
|
|
146
|
+
if (direction == "rtl") {
|
|
129
147
|
toolbar.layoutDirection = LAYOUT_DIRECTION_RTL
|
|
130
|
-
} else if (
|
|
148
|
+
} else if (direction == "ltr") {
|
|
131
149
|
toolbar.layoutDirection = LAYOUT_DIRECTION_LTR
|
|
132
150
|
}
|
|
133
151
|
}
|
|
@@ -138,15 +156,16 @@ class ScreenStackHeaderConfig(context: Context) : ViewGroup(context) {
|
|
|
138
156
|
// because sometimes we don't have the Fragment and Activity available then yet, e.g. on the
|
|
139
157
|
// first setting of props. Similar thing is done for Screens of ScreenContainers, but in
|
|
140
158
|
// `onContainerUpdate` of their Fragment
|
|
141
|
-
val reactContext =
|
|
142
|
-
context
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
159
|
+
val reactContext =
|
|
160
|
+
if (context is ReactContext) {
|
|
161
|
+
context as ReactContext
|
|
162
|
+
} else {
|
|
163
|
+
it.fragmentWrapper?.tryGetContext()
|
|
164
|
+
}
|
|
146
165
|
ScreenWindowTraits.trySetWindowTraits(it, activity, reactContext)
|
|
147
166
|
}
|
|
148
167
|
|
|
149
|
-
if (
|
|
168
|
+
if (isHeaderHidden) {
|
|
150
169
|
if (toolbar.parent != null) {
|
|
151
170
|
screenFragment?.removeToolbar()
|
|
152
171
|
}
|
|
@@ -157,7 +176,7 @@ class ScreenStackHeaderConfig(context: Context) : ViewGroup(context) {
|
|
|
157
176
|
screenFragment?.setToolbar(toolbar)
|
|
158
177
|
}
|
|
159
178
|
|
|
160
|
-
if (
|
|
179
|
+
if (isTopInsetEnabled) {
|
|
161
180
|
headerTopInset.let {
|
|
162
181
|
toolbar.setPadding(0, it ?: 0, 0, 0)
|
|
163
182
|
}
|
|
@@ -176,57 +195,62 @@ class ScreenStackHeaderConfig(context: Context) : ViewGroup(context) {
|
|
|
176
195
|
// reset startWithNavigation inset which corresponds to the distance between navigation icon and
|
|
177
196
|
// title. If title isn't set we clear that value few lines below to give more space to custom
|
|
178
197
|
// center-mounted views.
|
|
179
|
-
toolbar.contentInsetStartWithNavigation =
|
|
180
|
-
toolbar.setContentInsetsRelative(
|
|
198
|
+
toolbar.contentInsetStartWithNavigation = defaultStartInsetWithNavigation
|
|
199
|
+
toolbar.setContentInsetsRelative(defaultStartInset, defaultStartInset)
|
|
181
200
|
|
|
182
201
|
// hide back button
|
|
183
202
|
actionBar.setDisplayHomeAsUpEnabled(
|
|
184
|
-
screenFragment?.canNavigateBack() == true && !
|
|
203
|
+
screenFragment?.canNavigateBack() == true && !isBackButtonHidden,
|
|
185
204
|
)
|
|
186
205
|
|
|
187
206
|
// when setSupportActionBar is called a toolbar wrapper gets initialized that overwrites
|
|
188
207
|
// navigation click listener. The default behavior set in the wrapper is to call into
|
|
189
208
|
// menu options handlers, but we prefer the back handling logic to stay here instead.
|
|
190
|
-
toolbar.setNavigationOnClickListener(
|
|
209
|
+
toolbar.setNavigationOnClickListener(backClickListener)
|
|
191
210
|
|
|
192
211
|
// shadow
|
|
193
|
-
screenFragment?.setToolbarShadowHidden(
|
|
212
|
+
screenFragment?.setToolbarShadowHidden(isShadowHidden)
|
|
194
213
|
|
|
195
214
|
// translucent
|
|
196
|
-
screenFragment?.setToolbarTranslucent(
|
|
215
|
+
screenFragment?.setToolbarTranslucent(isHeaderTranslucent)
|
|
197
216
|
|
|
198
217
|
// title
|
|
199
|
-
actionBar.title =
|
|
200
|
-
if (TextUtils.isEmpty(
|
|
218
|
+
actionBar.title = title
|
|
219
|
+
if (TextUtils.isEmpty(title)) {
|
|
201
220
|
// if title is empty we set start navigation inset to 0 to give more space to custom rendered
|
|
202
221
|
// views. When it is set to default it'd take up additional distance from the back button
|
|
203
222
|
// which would impact the position of custom header views rendered at the center.
|
|
204
223
|
toolbar.contentInsetStartWithNavigation = 0
|
|
205
224
|
}
|
|
206
225
|
|
|
207
|
-
val titleTextView =
|
|
208
|
-
if (
|
|
209
|
-
toolbar.setTitleTextColor(
|
|
226
|
+
val titleTextView = findTitleTextViewInToolbar(toolbar)
|
|
227
|
+
if (titleColor != 0) {
|
|
228
|
+
toolbar.setTitleTextColor(titleColor)
|
|
210
229
|
}
|
|
211
230
|
|
|
212
231
|
if (titleTextView != null) {
|
|
213
|
-
if (
|
|
214
|
-
val titleTypeface =
|
|
215
|
-
|
|
216
|
-
|
|
232
|
+
if (titleFontFamily != null || titleFontWeight > 0) {
|
|
233
|
+
val titleTypeface =
|
|
234
|
+
ReactTypefaceUtils.applyStyles(
|
|
235
|
+
null,
|
|
236
|
+
0,
|
|
237
|
+
titleFontWeight,
|
|
238
|
+
titleFontFamily,
|
|
239
|
+
context.assets,
|
|
240
|
+
)
|
|
217
241
|
titleTextView.typeface = titleTypeface
|
|
218
242
|
}
|
|
219
|
-
if (
|
|
220
|
-
titleTextView.textSize =
|
|
243
|
+
if (titleFontSize > 0) {
|
|
244
|
+
titleTextView.textSize = titleFontSize
|
|
221
245
|
}
|
|
222
246
|
}
|
|
223
247
|
|
|
224
248
|
// background
|
|
225
|
-
|
|
249
|
+
backgroundColor?.let { toolbar.setBackgroundColor(it) }
|
|
226
250
|
|
|
227
251
|
// color
|
|
228
|
-
if (
|
|
229
|
-
toolbar.navigationIcon?.
|
|
252
|
+
if (tintColor != 0) {
|
|
253
|
+
toolbar.navigationIcon?.colorFilter = PorterDuffColorFilter(tintColor, PorterDuff.Mode.SRC_ATOP)
|
|
230
254
|
}
|
|
231
255
|
|
|
232
256
|
// subviews
|
|
@@ -237,17 +261,18 @@ class ScreenStackHeaderConfig(context: Context) : ViewGroup(context) {
|
|
|
237
261
|
}
|
|
238
262
|
|
|
239
263
|
var i = 0
|
|
240
|
-
val size =
|
|
264
|
+
val size = configSubviews.size
|
|
241
265
|
while (i < size) {
|
|
242
|
-
val view =
|
|
266
|
+
val view = configSubviews[i]
|
|
243
267
|
val type = view.type
|
|
244
268
|
if (type === ScreenStackHeaderSubview.Type.BACK) {
|
|
245
269
|
// we special case BACK button header config type as we don't add it as a view into toolbar
|
|
246
270
|
// but instead just copy the drawable from imageview that's added as a first child to it.
|
|
247
|
-
val firstChild =
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
271
|
+
val firstChild =
|
|
272
|
+
view.getChildAt(0) as? ImageView
|
|
273
|
+
?: throw JSApplicationIllegalArgumentException(
|
|
274
|
+
"Back button header config view should have Image as first child",
|
|
275
|
+
)
|
|
251
276
|
actionBar.setHomeAsUpIndicator(firstChild.drawable)
|
|
252
277
|
i++
|
|
253
278
|
continue
|
|
@@ -257,7 +282,7 @@ class ScreenStackHeaderConfig(context: Context) : ViewGroup(context) {
|
|
|
257
282
|
ScreenStackHeaderSubview.Type.LEFT -> {
|
|
258
283
|
// when there is a left item we need to disable navigation icon by default
|
|
259
284
|
// we also hide title as there is no other way to display left side items
|
|
260
|
-
if (!
|
|
285
|
+
if (!backButtonInCustomView) {
|
|
261
286
|
toolbar.navigationIcon = null
|
|
262
287
|
}
|
|
263
288
|
toolbar.title = null
|
|
@@ -278,101 +303,94 @@ class ScreenStackHeaderConfig(context: Context) : ViewGroup(context) {
|
|
|
278
303
|
}
|
|
279
304
|
|
|
280
305
|
private fun maybeUpdate() {
|
|
281
|
-
if (parent != null && !
|
|
306
|
+
if (parent != null && !isDestroyed && screen?.isBeingRemoved == false) {
|
|
282
307
|
onUpdate()
|
|
283
308
|
}
|
|
284
309
|
}
|
|
285
310
|
|
|
286
|
-
fun getConfigSubview(index: Int): ScreenStackHeaderSubview =
|
|
311
|
+
fun getConfigSubview(index: Int): ScreenStackHeaderSubview = configSubviews[index]
|
|
287
312
|
|
|
288
313
|
val configSubviewsCount: Int
|
|
289
|
-
get() =
|
|
314
|
+
get() = configSubviews.size
|
|
290
315
|
|
|
291
316
|
fun removeConfigSubview(index: Int) {
|
|
292
|
-
|
|
317
|
+
configSubviews.removeAt(index)
|
|
293
318
|
maybeUpdate()
|
|
294
319
|
}
|
|
295
320
|
|
|
296
321
|
fun removeAllConfigSubviews() {
|
|
297
|
-
|
|
322
|
+
configSubviews.clear()
|
|
298
323
|
maybeUpdate()
|
|
299
324
|
}
|
|
300
325
|
|
|
301
|
-
fun addConfigSubview(
|
|
302
|
-
|
|
326
|
+
fun addConfigSubview(
|
|
327
|
+
child: ScreenStackHeaderSubview,
|
|
328
|
+
index: Int,
|
|
329
|
+
) {
|
|
330
|
+
configSubviews.add(index, child)
|
|
303
331
|
maybeUpdate()
|
|
304
332
|
}
|
|
305
333
|
|
|
306
|
-
private val titleTextView: TextView?
|
|
307
|
-
get() {
|
|
308
|
-
for (i in 0 until toolbar.childCount) {
|
|
309
|
-
val view = toolbar.getChildAt(i)
|
|
310
|
-
if (view is TextView) {
|
|
311
|
-
if (view.text == toolbar.title) {
|
|
312
|
-
return view
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
return null
|
|
317
|
-
}
|
|
318
|
-
|
|
319
334
|
fun setTitle(title: String?) {
|
|
320
|
-
|
|
335
|
+
this.title = title
|
|
321
336
|
}
|
|
322
337
|
|
|
323
338
|
fun setTitleFontFamily(titleFontFamily: String?) {
|
|
324
|
-
|
|
339
|
+
this.titleFontFamily = titleFontFamily
|
|
325
340
|
}
|
|
326
341
|
|
|
327
342
|
fun setTitleFontWeight(fontWeightString: String?) {
|
|
328
|
-
|
|
343
|
+
titleFontWeight = ReactTypefaceUtils.parseFontWeight(fontWeightString)
|
|
329
344
|
}
|
|
330
345
|
|
|
331
346
|
fun setTitleFontSize(titleFontSize: Float) {
|
|
332
|
-
|
|
347
|
+
this.titleFontSize = titleFontSize
|
|
333
348
|
}
|
|
334
349
|
|
|
335
350
|
fun setTitleColor(color: Int) {
|
|
336
|
-
|
|
351
|
+
titleColor = color
|
|
337
352
|
}
|
|
338
353
|
|
|
339
354
|
fun setTintColor(color: Int) {
|
|
340
|
-
|
|
355
|
+
tintColor = color
|
|
341
356
|
}
|
|
342
357
|
|
|
343
358
|
fun setTopInsetEnabled(topInsetEnabled: Boolean) {
|
|
344
|
-
|
|
359
|
+
isTopInsetEnabled = topInsetEnabled
|
|
345
360
|
}
|
|
346
361
|
|
|
347
362
|
fun setBackgroundColor(color: Int?) {
|
|
348
|
-
|
|
363
|
+
backgroundColor = color
|
|
349
364
|
}
|
|
350
365
|
|
|
351
366
|
fun setHideShadow(hideShadow: Boolean) {
|
|
352
|
-
|
|
367
|
+
isShadowHidden = hideShadow
|
|
353
368
|
}
|
|
354
369
|
|
|
355
370
|
fun setHideBackButton(hideBackButton: Boolean) {
|
|
356
|
-
|
|
371
|
+
isBackButtonHidden = hideBackButton
|
|
357
372
|
}
|
|
358
373
|
|
|
359
374
|
fun setHidden(hidden: Boolean) {
|
|
360
|
-
|
|
375
|
+
isHeaderHidden = hidden
|
|
361
376
|
}
|
|
362
377
|
|
|
363
378
|
fun setTranslucent(translucent: Boolean) {
|
|
364
|
-
|
|
379
|
+
isHeaderTranslucent = translucent
|
|
365
380
|
}
|
|
366
381
|
|
|
367
382
|
fun setBackButtonInCustomView(backButtonInCustomView: Boolean) {
|
|
368
|
-
|
|
383
|
+
this.backButtonInCustomView = backButtonInCustomView
|
|
369
384
|
}
|
|
370
385
|
|
|
371
386
|
fun setDirection(direction: String?) {
|
|
372
|
-
|
|
387
|
+
this.direction = direction
|
|
373
388
|
}
|
|
374
389
|
|
|
375
|
-
private class DebugMenuToolbar(
|
|
390
|
+
private class DebugMenuToolbar(
|
|
391
|
+
context: Context,
|
|
392
|
+
config: ScreenStackHeaderConfig,
|
|
393
|
+
) : CustomToolbar(context, config) {
|
|
376
394
|
override fun showOverflowMenu(): Boolean {
|
|
377
395
|
(context.applicationContext as ReactApplication)
|
|
378
396
|
.reactNativeHost
|
|
@@ -385,14 +403,28 @@ class ScreenStackHeaderConfig(context: Context) : ViewGroup(context) {
|
|
|
385
403
|
init {
|
|
386
404
|
visibility = GONE
|
|
387
405
|
toolbar = if (BuildConfig.DEBUG) DebugMenuToolbar(context, this) else CustomToolbar(context, this)
|
|
388
|
-
|
|
389
|
-
|
|
406
|
+
defaultStartInset = toolbar.contentInsetStart
|
|
407
|
+
defaultStartInsetWithNavigation = toolbar.contentInsetStartWithNavigation
|
|
390
408
|
|
|
391
409
|
// set primary color as background by default
|
|
392
410
|
val tv = TypedValue()
|
|
393
|
-
if (context.theme.resolveAttribute(R.attr.colorPrimary, tv, true)) {
|
|
411
|
+
if (context.theme.resolveAttribute(android.R.attr.colorPrimary, tv, true)) {
|
|
394
412
|
toolbar.setBackgroundColor(tv.data)
|
|
395
413
|
}
|
|
396
414
|
toolbar.clipChildren = false
|
|
397
415
|
}
|
|
416
|
+
|
|
417
|
+
companion object {
|
|
418
|
+
fun findTitleTextViewInToolbar(toolbar: Toolbar): TextView? {
|
|
419
|
+
for (i in 0 until toolbar.childCount) {
|
|
420
|
+
val view = toolbar.getChildAt(i)
|
|
421
|
+
if (view is TextView) {
|
|
422
|
+
if (view.text == toolbar.title) {
|
|
423
|
+
return view
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
return null
|
|
428
|
+
}
|
|
429
|
+
}
|
|
398
430
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package com.swmansion.rnscreens
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactContext
|
|
4
|
+
import com.facebook.react.uimanager.LayoutShadowNode
|
|
5
|
+
import com.facebook.react.uimanager.Spacing
|
|
6
|
+
import com.swmansion.rnscreens.utils.PaddingBundle
|
|
7
|
+
|
|
8
|
+
internal class ScreenStackHeaderConfigShadowNode(
|
|
9
|
+
private var context: ReactContext,
|
|
10
|
+
) : LayoutShadowNode() {
|
|
11
|
+
var paddingStart: Float = 0f
|
|
12
|
+
var paddingEnd: Float = 0f
|
|
13
|
+
|
|
14
|
+
override fun setLocalData(data: Any?) {
|
|
15
|
+
if (data is PaddingBundle) {
|
|
16
|
+
paddingStart = data.paddingStart
|
|
17
|
+
paddingEnd = data.paddingEnd
|
|
18
|
+
|
|
19
|
+
setPadding(Spacing.START, paddingStart)
|
|
20
|
+
setPadding(Spacing.END, paddingEnd)
|
|
21
|
+
} else {
|
|
22
|
+
super.setLocalData(data)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|