react-native-screens 3.19.0 → 3.21.0
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 +2 -1
- package/RNScreens.podspec +1 -1
- package/android/build.gradle +24 -6
- package/android/src/main/java/com/swmansion/rnscreens/CustomSearchView.kt +4 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt +7 -9
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigViewManager.kt +12 -4
- package/android/src/main/java/com/swmansion/rnscreens/SearchBarManager.kt +32 -8
- package/android/src/main/java/com/swmansion/rnscreens/SearchBarView.kt +36 -15
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderAttachedEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderDetachedEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarBlurEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarChangeTextEvent.kt +29 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarCloseEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarFocusEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarOpenEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarSearchButtonPressEvent.kt +26 -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/RNSScreenStackHeaderConfigManagerDelegate.java +3 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerInterface.java +1 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.h +1 -2
- package/ios/RCTImageComponentView+RNSScreenStackHeaderConfig.h +11 -0
- package/ios/RCTImageComponentView+RNSScreenStackHeaderConfig.mm +14 -0
- package/ios/RNSConvert.h +2 -2
- package/ios/RNSConvert.mm +2 -2
- package/ios/RNSFullWindowOverlay.h +5 -5
- package/ios/RNSFullWindowOverlay.mm +13 -13
- package/ios/RNSScreen.h +7 -6
- package/ios/RNSScreen.mm +35 -33
- package/ios/RNSScreenContainer.h +2 -2
- package/ios/RNSScreenContainer.mm +5 -5
- package/ios/RNSScreenNavigationContainer.mm +3 -3
- package/ios/RNSScreenStack.h +4 -4
- package/ios/RNSScreenStack.mm +62 -23
- package/ios/RNSScreenStackHeaderConfig.h +10 -3
- package/ios/RNSScreenStackHeaderConfig.mm +138 -81
- package/ios/RNSScreenStackHeaderSubview.h +5 -6
- package/ios/RNSScreenStackHeaderSubview.mm +20 -11
- package/ios/RNSScreenWindowTraits.mm +21 -2
- package/ios/RNSSearchBar.h +5 -4
- package/ios/RNSSearchBar.mm +87 -12
- package/ios/RNScreens.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/RNScreens.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/RNScreens.xcodeproj/project.xcworkspace/xcuserdata/wojciechlewicki.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNScreens.xcodeproj/xcuserdata/wojciechlewicki.xcuserdatad/xcschemes/xcschememanagement.plist +19 -0
- package/lib/commonjs/TransitionProgressContext.js.map +1 -1
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +0 -5
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js +0 -5
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenNativeComponent.js +0 -5
- package/lib/commonjs/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js +0 -5
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js +0 -8
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js +0 -8
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js +0 -5
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/SearchBarNativeComponent.js +7 -7
- package/lib/commonjs/fabric/SearchBarNativeComponent.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.native.js +53 -11
- package/lib/commonjs/index.native.js.map +1 -1
- package/lib/commonjs/native-stack/index.js.map +1 -1
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js +18 -16
- 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/HeaderHeightContext.js.map +1 -1
- 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/useBackPressSubscription.js.map +1 -1
- package/lib/commonjs/native-stack/utils/useHeaderHeight.js.map +1 -1
- package/lib/commonjs/native-stack/views/FontProcessor.js +1 -0
- package/lib/commonjs/native-stack/views/FontProcessor.js.map +1 -1
- package/lib/commonjs/native-stack/views/HeaderConfig.js +3 -1
- package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.js +14 -1
- package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedScreen.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js +3 -1
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js.map +1 -1
- package/lib/commonjs/reanimated/index.js.map +1 -1
- package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/useTransitionProgress.js.map +1 -1
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js +0 -5
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenContainerNativeComponent.js +0 -5
- package/lib/module/fabric/ScreenContainerNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNativeComponent.js +0 -5
- package/lib/module/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js +0 -5
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js +0 -6
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js +0 -6
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackNativeComponent.js +0 -5
- package/lib/module/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/module/fabric/SearchBarNativeComponent.js +4 -6
- package/lib/module/fabric/SearchBarNativeComponent.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.native.js +54 -11
- package/lib/module/index.native.js.map +1 -1
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js +18 -16
- 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/SafeAreaProviderCompat.js.map +1 -1
- package/lib/module/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
- 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 +1 -0
- package/lib/module/native-stack/views/FontProcessor.js.map +1 -1
- package/lib/module/native-stack/views/HeaderConfig.js +3 -1
- package/lib/module/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/module/native-stack/views/NativeStackView.js +15 -1
- package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/module/reanimated/ReanimatedScreen.js.map +1 -1
- package/lib/module/reanimated/ReanimatedScreenProvider.js +3 -1
- package/lib/module/reanimated/ReanimatedScreenProvider.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.map +1 -1
- package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts +6 -0
- package/lib/typescript/fabric/ScreenContainerNativeComponent.d.ts +6 -0
- package/lib/typescript/fabric/ScreenNativeComponent.d.ts +62 -0
- package/lib/typescript/fabric/ScreenNavigationContainerNativeComponent.d.ts +6 -0
- package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts +34 -0
- package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts +9 -0
- package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts +9 -0
- package/lib/typescript/fabric/SearchBarNativeComponent.d.ts +46 -0
- package/lib/typescript/index.d.ts +2 -2
- package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +2 -2
- package/lib/typescript/native-stack/types.d.ts +55 -1
- package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +1 -1
- package/lib/typescript/reanimated/ReanimatedScreen.d.ts +1 -1
- package/lib/typescript/types.d.ts +81 -2
- package/lib/typescript/useTransitionProgress.d.ts +3 -3
- package/native-stack/README.md +59 -1
- package/package.json +11 -14
- package/src/fabric/FullWindowOverlayNativeComponent.ts +6 -0
- package/src/fabric/ScreenContainerNativeComponent.ts +6 -0
- package/src/fabric/ScreenNativeComponent.ts +97 -0
- package/src/fabric/ScreenNavigationContainerNativeComponent.ts +9 -0
- package/src/fabric/ScreenStackHeaderConfigNativeComponent.ts +43 -0
- package/src/fabric/ScreenStackHeaderSubviewNativeComponent.ts +20 -0
- package/src/fabric/ScreenStackNativeComponent.ts +12 -0
- package/src/fabric/SearchBarNativeComponent.ts +73 -0
- package/src/index.native.tsx +107 -14
- package/src/index.tsx +4 -3
- package/src/native-stack/navigators/createNativeStackNavigator.tsx +23 -19
- package/src/native-stack/types.tsx +55 -0
- package/src/native-stack/views/FontProcessor.tsx +1 -0
- package/src/native-stack/views/HeaderConfig.tsx +3 -1
- package/src/native-stack/views/NativeStackView.tsx +14 -2
- package/src/types.tsx +84 -2
- package/android/src/main/java/com/swmansion/rnscreens/LifecycleHelper.kt +0 -60
- package/createNativeStackNavigator/README.md +0 -522
- package/createNativeStackNavigator/package.json +0 -6
- package/lib/commonjs/createNativeStackNavigator.js +0 -374
- package/lib/commonjs/createNativeStackNavigator.js.map +0 -1
- package/lib/module/createNativeStackNavigator.js +0 -366
- package/lib/module/createNativeStackNavigator.js.map +0 -1
- package/lib/typescript/createNativeStackNavigator.d.ts +0 -51
- package/src/createNativeStackNavigator.tsx +0 -594
- package/src/fabric/FullWindowOverlayNativeComponent.js +0 -19
- package/src/fabric/ScreenContainerNativeComponent.js +0 -19
- package/src/fabric/ScreenNativeComponent.js +0 -104
- package/src/fabric/ScreenNavigationContainerNativeComponent.js +0 -19
- package/src/fabric/ScreenStackHeaderConfigNativeComponent.js +0 -54
- package/src/fabric/ScreenStackHeaderSubviewNativeComponent.js +0 -31
- package/src/fabric/ScreenStackNativeComponent.js +0 -23
- package/src/fabric/SearchBarNativeComponent.js +0 -62
- /package/android/src/main/res/{anim → base/anim}/rns_default_enter_in.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_default_enter_out.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_default_exit_in.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_default_exit_out.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_fade_from_bottom.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_fade_in.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_fade_out.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_fade_to_bottom.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_no_animation_20.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_no_animation_250.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_no_animation_350.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_no_animation_medium.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_in_from_bottom.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_in_from_left.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_in_from_right.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_out_to_bottom.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_out_to_left.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_out_to_right.xml +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
|
|
3
|
+
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
|
4
|
+
android:shareInterpolator="false">
|
|
5
|
+
|
|
6
|
+
<alpha
|
|
7
|
+
android:fromAlpha="1.0"
|
|
8
|
+
android:toAlpha="1.0"
|
|
9
|
+
android:fillEnabled="true"
|
|
10
|
+
android:fillBefore="true"
|
|
11
|
+
android:fillAfter="true"
|
|
12
|
+
android:interpolator="@android:interpolator/linear"
|
|
13
|
+
android:startOffset="0"
|
|
14
|
+
android:duration="450" />
|
|
15
|
+
|
|
16
|
+
<translate
|
|
17
|
+
android:fromXDelta="-10%"
|
|
18
|
+
android:toXDelta="0"
|
|
19
|
+
android:fillEnabled="true"
|
|
20
|
+
android:fillBefore="true"
|
|
21
|
+
android:fillAfter="true"
|
|
22
|
+
android:interpolator="@android:interpolator/fast_out_extra_slow_in"
|
|
23
|
+
android:startOffset="0"
|
|
24
|
+
android:duration="450" />
|
|
25
|
+
|
|
26
|
+
<extend
|
|
27
|
+
android:fromExtendLeft="0"
|
|
28
|
+
android:fromExtendTop="0"
|
|
29
|
+
android:fromExtendRight="10%"
|
|
30
|
+
android:fromExtendBottom="0"
|
|
31
|
+
android:toExtendLeft="0"
|
|
32
|
+
android:toExtendTop="0"
|
|
33
|
+
android:toExtendRight="10%"
|
|
34
|
+
android:toExtendBottom="0"
|
|
35
|
+
android:interpolator="@android:interpolator/fast_out_extra_slow_in"
|
|
36
|
+
android:startOffset="0"
|
|
37
|
+
android:duration="450" />
|
|
38
|
+
</set>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
|
|
3
|
+
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
|
4
|
+
android:shareInterpolator="false">
|
|
5
|
+
|
|
6
|
+
<alpha
|
|
7
|
+
android:fromAlpha="1.0"
|
|
8
|
+
android:toAlpha="0.0"
|
|
9
|
+
android:fillEnabled="true"
|
|
10
|
+
android:fillBefore="true"
|
|
11
|
+
android:fillAfter="true"
|
|
12
|
+
android:interpolator="@android:interpolator/linear"
|
|
13
|
+
android:startOffset="35"
|
|
14
|
+
android:duration="83" />
|
|
15
|
+
|
|
16
|
+
<translate
|
|
17
|
+
android:fromXDelta="0"
|
|
18
|
+
android:toXDelta="10%"
|
|
19
|
+
android:fillEnabled="true"
|
|
20
|
+
android:fillBefore="true"
|
|
21
|
+
android:fillAfter="true"
|
|
22
|
+
android:interpolator="@android:interpolator/fast_out_extra_slow_in"
|
|
23
|
+
android:startOffset="0"
|
|
24
|
+
android:duration="450" />
|
|
25
|
+
|
|
26
|
+
<extend
|
|
27
|
+
android:fromExtendLeft="10%"
|
|
28
|
+
android:fromExtendTop="0"
|
|
29
|
+
android:fromExtendRight="0"
|
|
30
|
+
android:fromExtendBottom="0"
|
|
31
|
+
android:toExtendLeft="10%"
|
|
32
|
+
android:toExtendTop="0"
|
|
33
|
+
android:toExtendRight="0"
|
|
34
|
+
android:toExtendBottom="0"
|
|
35
|
+
android:interpolator="@android:interpolator/fast_out_extra_slow_in"
|
|
36
|
+
android:startOffset="0"
|
|
37
|
+
android:duration="450" />
|
|
38
|
+
</set>
|
|
@@ -34,6 +34,9 @@ public class RNSScreenStackHeaderConfigManagerDelegate<T extends View, U extends
|
|
|
34
34
|
case "backTitleFontSize":
|
|
35
35
|
mViewManager.setBackTitleFontSize(view, value == null ? 0 : ((Double) value).intValue());
|
|
36
36
|
break;
|
|
37
|
+
case "backTitleVisible":
|
|
38
|
+
mViewManager.setBackTitleVisible(view, value == null ? true : (boolean) value);
|
|
39
|
+
break;
|
|
37
40
|
case "color":
|
|
38
41
|
mViewManager.setColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
39
42
|
break;
|
|
@@ -17,6 +17,7 @@ public interface RNSScreenStackHeaderConfigManagerInterface<T extends View> {
|
|
|
17
17
|
void setBackTitle(T view, @Nullable String value);
|
|
18
18
|
void setBackTitleFontFamily(T view, @Nullable String value);
|
|
19
19
|
void setBackTitleFontSize(T view, int value);
|
|
20
|
+
void setBackTitleVisible(T view, boolean value);
|
|
20
21
|
void setColor(T view, @Nullable Integer value);
|
|
21
22
|
void setDirection(T view, @Nullable String value);
|
|
22
23
|
void setHidden(T view, boolean value);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
|
+
|
|
3
|
+
#include "RCTImageComponentView+RNSScreenStackHeaderConfig.h"
|
|
4
|
+
|
|
5
|
+
@implementation RCTImageComponentView (RNSScreenStackHeaderConfig)
|
|
6
|
+
|
|
7
|
+
- (UIImage *)image
|
|
8
|
+
{
|
|
9
|
+
return _imageView.image;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@end
|
|
13
|
+
|
|
14
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
package/ios/RNSConvert.h
CHANGED
package/ios/RNSConvert.mm
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#import "RNSConvert.h"
|
|
2
2
|
|
|
3
|
-
#ifdef
|
|
3
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
4
4
|
@implementation RNSConvert
|
|
5
5
|
|
|
6
6
|
+ (RNSScreenStackPresentation)RNSScreenStackPresentationFromCppEquivalent:
|
|
@@ -143,4 +143,4 @@
|
|
|
143
143
|
|
|
144
144
|
@end
|
|
145
145
|
|
|
146
|
-
#endif //
|
|
146
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#import <React/RCTViewManager.h>
|
|
2
2
|
|
|
3
|
-
#ifdef
|
|
3
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
4
4
|
#import <React/RCTViewComponentView.h>
|
|
5
5
|
#else
|
|
6
6
|
#import <React/RCTInvalidating.h>
|
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
@end
|
|
17
17
|
|
|
18
18
|
@interface RNSFullWindowOverlay :
|
|
19
|
-
#ifdef
|
|
19
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
20
20
|
RCTViewComponentView
|
|
21
21
|
#else
|
|
22
22
|
RCTView <RCTInvalidating>
|
|
23
|
-
#endif //
|
|
23
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
24
24
|
|
|
25
|
-
#ifdef
|
|
25
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
26
26
|
@property (nonatomic) facebook::react::LayoutMetrics oldLayoutMetrics;
|
|
27
27
|
@property (nonatomic) facebook::react::LayoutMetrics newLayoutMetrics;
|
|
28
|
-
#endif //
|
|
28
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
29
29
|
|
|
30
30
|
@end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
#import "RNSFullWindowOverlay.h"
|
|
4
4
|
|
|
5
|
-
#ifdef
|
|
5
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
6
6
|
#import <React/RCTConversions.h>
|
|
7
7
|
#import <React/RCTFabricComponentsPlugins.h>
|
|
8
8
|
#import <React/RCTSurfaceTouchHandler.h>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#import <react/renderer/components/rnscreens/RCTComponentViewHelpers.h>
|
|
12
12
|
#else
|
|
13
13
|
#import <React/RCTTouchHandler.h>
|
|
14
|
-
#endif //
|
|
14
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
15
15
|
|
|
16
16
|
@implementation RNSFullWindowOverlayContainer
|
|
17
17
|
|
|
@@ -63,14 +63,14 @@
|
|
|
63
63
|
__weak RCTBridge *_bridge;
|
|
64
64
|
RNSFullWindowOverlayContainer *_container;
|
|
65
65
|
CGRect _reactFrame;
|
|
66
|
-
#ifdef
|
|
66
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
67
67
|
RCTSurfaceTouchHandler *_touchHandler;
|
|
68
68
|
#else
|
|
69
69
|
RCTTouchHandler *_touchHandler;
|
|
70
|
-
#endif //
|
|
70
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
#ifdef
|
|
73
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
74
74
|
- (instancetype)init
|
|
75
75
|
{
|
|
76
76
|
if (self = [super init]) {
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
}
|
|
81
81
|
return self;
|
|
82
82
|
}
|
|
83
|
-
#endif //
|
|
83
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
84
84
|
|
|
85
85
|
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
86
86
|
{
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
}
|
|
129
129
|
} else {
|
|
130
130
|
if (_touchHandler == nil) {
|
|
131
|
-
#ifdef
|
|
131
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
132
132
|
_touchHandler = [RCTSurfaceTouchHandler new];
|
|
133
133
|
#else
|
|
134
134
|
_touchHandler = [[RCTTouchHandler alloc] initWithBridge:_bridge];
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
#ifdef
|
|
141
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
142
142
|
#pragma mark - Fabric Specific
|
|
143
143
|
|
|
144
144
|
// When the component unmounts we remove it from window's children,
|
|
@@ -205,27 +205,27 @@
|
|
|
205
205
|
_container = nil;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
#endif //
|
|
208
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
209
209
|
|
|
210
210
|
@end
|
|
211
211
|
|
|
212
|
-
#ifdef
|
|
212
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
213
213
|
Class<RCTComponentViewProtocol> RNSFullWindowOverlayCls(void)
|
|
214
214
|
{
|
|
215
215
|
return RNSFullWindowOverlay.class;
|
|
216
216
|
}
|
|
217
|
-
#endif //
|
|
217
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
218
218
|
|
|
219
219
|
@implementation RNSFullWindowOverlayManager
|
|
220
220
|
|
|
221
221
|
RCT_EXPORT_MODULE()
|
|
222
222
|
|
|
223
|
-
#ifdef
|
|
223
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
224
224
|
#else
|
|
225
225
|
- (UIView *)view
|
|
226
226
|
{
|
|
227
227
|
return [[RNSFullWindowOverlay alloc] initWithBridge:self.bridge];
|
|
228
228
|
}
|
|
229
|
-
#endif //
|
|
229
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
230
230
|
|
|
231
231
|
@end
|
package/ios/RNSScreen.h
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
#import "RNSEnums.h"
|
|
5
5
|
#import "RNSScreenContainer.h"
|
|
6
6
|
|
|
7
|
-
#if
|
|
7
|
+
#if RCT_NEW_ARCH_ENABLED
|
|
8
8
|
#import <React/RCTViewComponentView.h>
|
|
9
9
|
#else
|
|
10
10
|
#import <React/RCTView.h>
|
|
@@ -33,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
33
33
|
- (UIViewController *)findChildVCForConfigAndTrait:(RNSWindowTrait)trait includingModals:(BOOL)includingModals;
|
|
34
34
|
- (void)notifyFinishTransitioning;
|
|
35
35
|
- (RNSScreenView *)screenView;
|
|
36
|
-
#ifdef
|
|
36
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
37
37
|
- (void)setViewToSnapshot:(UIView *)snapshot;
|
|
38
38
|
- (void)resetViewToScreen;
|
|
39
39
|
#endif
|
|
@@ -41,7 +41,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
41
41
|
@end
|
|
42
42
|
|
|
43
43
|
@interface RNSScreenView :
|
|
44
|
-
#ifdef
|
|
44
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
45
45
|
RCTViewComponentView
|
|
46
46
|
#else
|
|
47
47
|
RCTView
|
|
@@ -84,7 +84,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
84
84
|
@property (nonatomic) BOOL sheetExpandsWhenScrolledToEdge;
|
|
85
85
|
#endif // !TARGET_OS_TV
|
|
86
86
|
|
|
87
|
-
#ifdef
|
|
87
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
88
88
|
// we recreate the behavior of `reactSetFrame` on new architecture
|
|
89
89
|
@property (nonatomic) facebook::react::LayoutMetrics oldLayoutMetrics;
|
|
90
90
|
@property (nonatomic) facebook::react::LayoutMetrics newLayoutMetrics;
|
|
@@ -97,11 +97,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
97
97
|
@property (nonatomic, copy) RCTDirectEventBlock onWillDisappear;
|
|
98
98
|
@property (nonatomic, copy) RCTDirectEventBlock onNativeDismissCancelled;
|
|
99
99
|
@property (nonatomic, copy) RCTDirectEventBlock onTransitionProgress;
|
|
100
|
-
#endif //
|
|
100
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
101
101
|
|
|
102
102
|
- (void)notifyFinishTransitioning;
|
|
103
103
|
|
|
104
|
-
#ifdef
|
|
104
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
105
105
|
- (void)notifyWillAppear;
|
|
106
106
|
- (void)notifyWillDisappear;
|
|
107
107
|
- (void)notifyAppear;
|
|
@@ -111,6 +111,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
111
111
|
#endif
|
|
112
112
|
|
|
113
113
|
- (void)notifyTransitionProgress:(double)progress closing:(BOOL)closing goingForward:(BOOL)goingForward;
|
|
114
|
+
- (void)notifyDismissCancelledWithDismissCount:(int)dismissCount;
|
|
114
115
|
- (BOOL)isModal;
|
|
115
116
|
|
|
116
117
|
@end
|
package/ios/RNSScreen.mm
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
#import "RNSScreenContainer.h"
|
|
5
5
|
#import "RNSScreenWindowTraits.h"
|
|
6
6
|
|
|
7
|
-
#ifdef
|
|
7
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
8
8
|
#import <React/RCTConversions.h>
|
|
9
9
|
#import <React/RCTFabricComponentsPlugins.h>
|
|
10
10
|
#import <React/RCTRootComponentView.h>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
#import "RNSScreenStackHeaderConfig.h"
|
|
26
26
|
|
|
27
27
|
@interface RNSScreenView ()
|
|
28
|
-
#ifdef
|
|
28
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
29
29
|
<RCTRNSScreenViewProtocol, UIAdaptivePresentationControllerDelegate>
|
|
30
30
|
#else
|
|
31
31
|
<UIAdaptivePresentationControllerDelegate, RCTInvalidating>
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
@implementation RNSScreenView {
|
|
36
36
|
__weak RCTBridge *_bridge;
|
|
37
|
-
#ifdef
|
|
37
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
38
38
|
RCTSurfaceTouchHandler *_touchHandler;
|
|
39
39
|
facebook::react::RNSScreenShadowNode::ConcreteState::Shared _state;
|
|
40
40
|
// on fabric, they are not available by default so we need them exposed here too
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
#endif
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
#ifdef
|
|
48
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
49
49
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
50
50
|
{
|
|
51
51
|
if (self = [super initWithFrame:frame]) {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
|
|
58
58
|
return self;
|
|
59
59
|
}
|
|
60
|
-
#endif //
|
|
60
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
61
61
|
|
|
62
62
|
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
63
63
|
{
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
return _controller;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
#ifdef
|
|
95
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
96
96
|
- (NSArray<UIView *> *)reactSubviews
|
|
97
97
|
{
|
|
98
98
|
return _reactSubviews;
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
|
|
102
102
|
- (void)updateBounds
|
|
103
103
|
{
|
|
104
|
-
#ifdef
|
|
104
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
105
105
|
if (_state != nullptr) {
|
|
106
106
|
auto newState = facebook::react::RNSScreenState{RCTSizeFromCGSize(self.bounds.size)};
|
|
107
107
|
_state->updateState(std::move(newState));
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
// https://developer.apple.com/documentation/uikit/uiviewcontroller/1621426-presentationcontroller?language=objc
|
|
162
162
|
_controller.presentationController.delegate = self;
|
|
163
163
|
} else if (_stackPresentation != RNSScreenStackPresentationPush) {
|
|
164
|
-
#ifdef
|
|
164
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
165
165
|
// TODO: on Fabric, same controllers can be used as modals and then recycled and used a push which would result in
|
|
166
166
|
// this error. It would be good to check if it doesn't leak in such case.
|
|
167
167
|
#else
|
|
@@ -280,7 +280,7 @@
|
|
|
280
280
|
|
|
281
281
|
- (void)notifyDismissedWithCount:(int)dismissCount
|
|
282
282
|
{
|
|
283
|
-
#ifdef
|
|
283
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
284
284
|
// If screen is already unmounted then there will be no event emitter
|
|
285
285
|
// it will be cleaned in prepareForRecycle
|
|
286
286
|
if (_eventEmitter != nullptr) {
|
|
@@ -302,7 +302,7 @@
|
|
|
302
302
|
|
|
303
303
|
- (void)notifyDismissCancelledWithDismissCount:(int)dismissCount
|
|
304
304
|
{
|
|
305
|
-
#ifdef
|
|
305
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
306
306
|
// If screen is already unmounted then there will be no event emitter
|
|
307
307
|
// it will be cleaned in prepareForRecycle
|
|
308
308
|
if (_eventEmitter != nullptr) {
|
|
@@ -319,7 +319,7 @@
|
|
|
319
319
|
|
|
320
320
|
- (void)notifyWillAppear
|
|
321
321
|
{
|
|
322
|
-
#ifdef
|
|
322
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
323
323
|
// If screen is already unmounted then there will be no event emitter
|
|
324
324
|
// it will be cleaned in prepareForRecycle
|
|
325
325
|
if (_eventEmitter != nullptr) {
|
|
@@ -342,7 +342,7 @@
|
|
|
342
342
|
if (_hideKeyboardOnSwipe) {
|
|
343
343
|
[self endEditing:YES];
|
|
344
344
|
}
|
|
345
|
-
#ifdef
|
|
345
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
346
346
|
// If screen is already unmounted then there will be no event emitter
|
|
347
347
|
// it will be cleaned in prepareForRecycle
|
|
348
348
|
if (_eventEmitter != nullptr) {
|
|
@@ -358,7 +358,7 @@
|
|
|
358
358
|
|
|
359
359
|
- (void)notifyAppear
|
|
360
360
|
{
|
|
361
|
-
#ifdef
|
|
361
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
362
362
|
// If screen is already unmounted then there will be no event emitter
|
|
363
363
|
// it will be cleaned in prepareForRecycle
|
|
364
364
|
if (_eventEmitter != nullptr) {
|
|
@@ -378,7 +378,7 @@
|
|
|
378
378
|
|
|
379
379
|
- (void)notifyDisappear
|
|
380
380
|
{
|
|
381
|
-
#ifdef
|
|
381
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
382
382
|
// If screen is already unmounted then there will be no event emitter
|
|
383
383
|
// it will be cleaned in prepareForRecycle
|
|
384
384
|
if (_eventEmitter != nullptr) {
|
|
@@ -394,7 +394,7 @@
|
|
|
394
394
|
|
|
395
395
|
- (BOOL)isMountedUnderScreenOrReactRoot
|
|
396
396
|
{
|
|
397
|
-
#ifdef
|
|
397
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
398
398
|
#define RNS_EXPECTED_VIEW RCTRootComponentView
|
|
399
399
|
#else
|
|
400
400
|
#define RNS_EXPECTED_VIEW RCTRootView
|
|
@@ -415,7 +415,7 @@
|
|
|
415
415
|
// root application window.
|
|
416
416
|
if (self.window != nil && ![self isMountedUnderScreenOrReactRoot]) {
|
|
417
417
|
if (_touchHandler == nil) {
|
|
418
|
-
#ifdef
|
|
418
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
419
419
|
_touchHandler = [RCTSurfaceTouchHandler new];
|
|
420
420
|
#else
|
|
421
421
|
_touchHandler = [[RCTTouchHandler alloc] initWithBridge:_bridge];
|
|
@@ -427,7 +427,7 @@
|
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
429
|
|
|
430
|
-
#ifdef
|
|
430
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
431
431
|
- (RCTSurfaceTouchHandler *)touchHandler
|
|
432
432
|
#else
|
|
433
433
|
- (RCTTouchHandler *)touchHandler
|
|
@@ -452,7 +452,7 @@
|
|
|
452
452
|
|
|
453
453
|
- (void)notifyTransitionProgress:(double)progress closing:(BOOL)closing goingForward:(BOOL)goingForward
|
|
454
454
|
{
|
|
455
|
-
#ifdef
|
|
455
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
456
456
|
if (_eventEmitter != nullptr) {
|
|
457
457
|
std::dynamic_pointer_cast<const facebook::react::RNSScreenEventEmitter>(_eventEmitter)
|
|
458
458
|
->onTransitionProgress(facebook::react::RNSScreenEventEmitter::OnTransitionProgress{
|
|
@@ -487,7 +487,7 @@
|
|
|
487
487
|
// pulling down starting at some touchable item. Without "reset" the touchable
|
|
488
488
|
// will never go back from highlighted state even when the modal start sliding
|
|
489
489
|
// down.
|
|
490
|
-
#ifdef
|
|
490
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
491
491
|
[_touchHandler setEnabled:NO];
|
|
492
492
|
[_touchHandler setEnabled:YES];
|
|
493
493
|
#else
|
|
@@ -572,7 +572,7 @@
|
|
|
572
572
|
#endif // !TARGET_OS_TV
|
|
573
573
|
|
|
574
574
|
#pragma mark - Fabric specific
|
|
575
|
-
#ifdef
|
|
575
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
576
576
|
|
|
577
577
|
+ (facebook::react::ComponentDescriptorProvider)componentDescriptorProvider
|
|
578
578
|
{
|
|
@@ -693,11 +693,6 @@
|
|
|
693
693
|
[self setStackPresentation:newStackPresentation];
|
|
694
694
|
}
|
|
695
695
|
|
|
696
|
-
#if !TARGET_OS_TV
|
|
697
|
-
// This must be called after setter for stackPresentation
|
|
698
|
-
[self updatePresentationStyle];
|
|
699
|
-
#endif // !TARGET_OS_TV
|
|
700
|
-
|
|
701
696
|
if (newScreenProps.stackAnimation != oldScreenProps.stackAnimation) {
|
|
702
697
|
[self setStackAnimation:[RNSConvert RNSScreenStackAnimationFromCppEquivalent:newScreenProps.stackAnimation]];
|
|
703
698
|
}
|
|
@@ -733,6 +728,13 @@
|
|
|
733
728
|
// Explanation taken from `reactSetFrame`, which is old arch equivalent of this code.
|
|
734
729
|
}
|
|
735
730
|
|
|
731
|
+
- (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask
|
|
732
|
+
{
|
|
733
|
+
#if !TARGET_OS_TV
|
|
734
|
+
[self updatePresentationStyle];
|
|
735
|
+
#endif // !TARGET_OS_TV
|
|
736
|
+
}
|
|
737
|
+
|
|
736
738
|
#pragma mark - Paper specific
|
|
737
739
|
#else
|
|
738
740
|
|
|
@@ -773,7 +775,7 @@
|
|
|
773
775
|
|
|
774
776
|
@end
|
|
775
777
|
|
|
776
|
-
#ifdef
|
|
778
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
777
779
|
Class<RCTComponentViewProtocol> RNSScreenCls(void)
|
|
778
780
|
{
|
|
779
781
|
return RNSScreenView.class;
|
|
@@ -804,7 +806,7 @@ Class<RCTComponentViewProtocol> RNSScreenCls(void)
|
|
|
804
806
|
self.view = view;
|
|
805
807
|
_fakeView = [UIView new];
|
|
806
808
|
_shouldNotify = YES;
|
|
807
|
-
#ifdef
|
|
809
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
808
810
|
_initialView = (RNSScreenView *)view;
|
|
809
811
|
#endif
|
|
810
812
|
}
|
|
@@ -893,7 +895,7 @@ Class<RCTComponentViewProtocol> RNSScreenCls(void)
|
|
|
893
895
|
- (void)viewDidDisappear:(BOOL)animated
|
|
894
896
|
{
|
|
895
897
|
[super viewDidDisappear:animated];
|
|
896
|
-
#ifdef
|
|
898
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
897
899
|
[self resetViewToScreen];
|
|
898
900
|
#endif
|
|
899
901
|
if (self.parentViewController == nil && self.presentingViewController == nil) {
|
|
@@ -915,7 +917,7 @@ Class<RCTComponentViewProtocol> RNSScreenCls(void)
|
|
|
915
917
|
|
|
916
918
|
_isSwiping = NO;
|
|
917
919
|
_shouldNotify = YES;
|
|
918
|
-
#ifdef
|
|
920
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
919
921
|
#else
|
|
920
922
|
[self traverseForScrollView:self.screenView];
|
|
921
923
|
#endif
|
|
@@ -935,7 +937,7 @@ Class<RCTComponentViewProtocol> RNSScreenCls(void)
|
|
|
935
937
|
BOOL isPresentedAsNativeModal = self.parentViewController == nil && self.presentingViewController != nil;
|
|
936
938
|
|
|
937
939
|
if (isDisplayedWithinUINavController || isPresentedAsNativeModal) {
|
|
938
|
-
#ifdef
|
|
940
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
939
941
|
[self.screenView updateBounds];
|
|
940
942
|
#else
|
|
941
943
|
if (!CGRectEqualToRect(_lastViewFrame, self.screenView.frame)) {
|
|
@@ -1157,7 +1159,7 @@ Class<RCTComponentViewProtocol> RNSScreenCls(void)
|
|
|
1157
1159
|
// when we want to check props of ScreenView, we need to get them from _initialView
|
|
1158
1160
|
- (RNSScreenView *)screenView
|
|
1159
1161
|
{
|
|
1160
|
-
#ifdef
|
|
1162
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
1161
1163
|
return _initialView;
|
|
1162
1164
|
#else
|
|
1163
1165
|
return (RNSScreenView *)self.view;
|
|
@@ -1184,7 +1186,7 @@ Class<RCTComponentViewProtocol> RNSScreenCls(void)
|
|
|
1184
1186
|
|
|
1185
1187
|
BOOL wasSearchBarActive = prevNavigationItem.searchController.active;
|
|
1186
1188
|
|
|
1187
|
-
#ifdef
|
|
1189
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
1188
1190
|
BOOL shouldHideHeader = !config.show;
|
|
1189
1191
|
#else
|
|
1190
1192
|
BOOL shouldHideHeader = config.hide;
|
|
@@ -1201,7 +1203,7 @@ Class<RCTComponentViewProtocol> RNSScreenCls(void)
|
|
|
1201
1203
|
#endif
|
|
1202
1204
|
}
|
|
1203
1205
|
|
|
1204
|
-
#ifdef
|
|
1206
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
1205
1207
|
#pragma mark - Fabric specific
|
|
1206
1208
|
|
|
1207
1209
|
- (void)setViewToSnapshot:(UIView *)snapshot
|
package/ios/RNSScreenContainer.h
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#ifdef
|
|
1
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
2
|
#import <React/RCTViewComponentView.h>
|
|
3
3
|
#else
|
|
4
4
|
#endif
|
|
@@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
29
29
|
@end
|
|
30
30
|
|
|
31
31
|
@interface RNSScreenContainerView :
|
|
32
|
-
#ifdef
|
|
32
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
33
33
|
RCTViewComponentView <RNSScreenContainerDelegate>
|
|
34
34
|
#else
|
|
35
35
|
UIView <RNSScreenContainerDelegate, RCTInvalidating>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#import "RNSScreenContainer.h"
|
|
2
2
|
#import "RNSScreen.h"
|
|
3
3
|
|
|
4
|
-
#ifdef
|
|
4
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
5
5
|
#import <React/RCTConversions.h>
|
|
6
6
|
#import <React/RCTFabricComponentsPlugins.h>
|
|
7
7
|
#import <react/renderer/components/rnscreens/ComponentDescriptors.h>
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
- (instancetype)init
|
|
59
59
|
{
|
|
60
60
|
if (self = [super init]) {
|
|
61
|
-
#ifdef
|
|
61
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
62
62
|
static const auto defaultProps = std::make_shared<const facebook::react::RNSScreenContainerProps>();
|
|
63
63
|
_props = defaultProps;
|
|
64
64
|
#endif
|
|
@@ -234,7 +234,7 @@
|
|
|
234
234
|
[super layoutSubviews];
|
|
235
235
|
_controller.view.frame = self.bounds;
|
|
236
236
|
for (RNSScreenView *subview in _reactSubviews) {
|
|
237
|
-
#ifdef
|
|
237
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
238
238
|
facebook::react::LayoutMetrics screenLayoutMetrics = subview.newLayoutMetrics;
|
|
239
239
|
screenLayoutMetrics.frame = RCTRectFromCGRect(CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height));
|
|
240
240
|
[subview updateLayoutMetrics:screenLayoutMetrics oldLayoutMetrics:subview.oldLayoutMetrics];
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
#pragma mark-- Fabric specific
|
|
249
|
-
#ifdef
|
|
249
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
250
250
|
|
|
251
251
|
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
252
252
|
{
|
|
@@ -321,7 +321,7 @@
|
|
|
321
321
|
|
|
322
322
|
@end
|
|
323
323
|
|
|
324
|
-
#ifdef
|
|
324
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
325
325
|
Class<RCTComponentViewProtocol> RNSScreenContainerCls(void)
|
|
326
326
|
{
|
|
327
327
|
return RNSScreenContainerView.class;
|