react-native-screens 3.13.1 → 3.14.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 -2
- package/RNScreens.podspec +5 -4
- package/android/build.gradle +18 -1
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt +8 -4
- package/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt +24 -6
- package/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt +14 -18
- package/android/src/main/jni/Android.mk +1 -2
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerDelegate.java +39 -14
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerInterface.java +15 -6
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerDelegate.java +3 -3
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerInterface.java +1 -1
- package/common/cpp/Android.mk +1 -2
- package/createNativeStackNavigator/README.md +4 -0
- package/ios/RNSConvert.h +30 -0
- package/ios/RNSConvert.mm +120 -0
- package/ios/RNSEnums.h +59 -0
- package/ios/RNSFullWindowOverlay.h +17 -2
- package/ios/RNSFullWindowOverlay.mm +199 -0
- package/ios/RNSScreen.h +70 -79
- package/ios/{RNSScreen.m → RNSScreen.mm} +679 -302
- package/ios/RNSScreenContainer.h +15 -1
- package/ios/{RNSScreenContainer.m → RNSScreenContainer.mm} +99 -8
- package/ios/{RNSScreenNavigationContainer.m → RNSScreenNavigationContainer.mm} +22 -0
- package/ios/RNSScreenStack.h +19 -3
- package/ios/{RNSScreenStack.m → RNSScreenStack.mm} +377 -126
- package/ios/{RNSScreenStackAnimator.m → RNSScreenStackAnimator.mm} +19 -14
- package/ios/RNSScreenStackHeaderConfig.h +20 -21
- package/ios/{RNSScreenStackHeaderConfig.m → RNSScreenStackHeaderConfig.mm} +232 -117
- package/ios/RNSScreenStackHeaderSubview.h +45 -0
- package/ios/RNSScreenStackHeaderSubview.mm +137 -0
- package/ios/RNSScreenViewEvent.h +12 -0
- package/ios/RNSScreenViewEvent.mm +59 -0
- package/ios/{RNSScreenWindowTraits.m → RNSScreenWindowTraits.mm} +3 -2
- package/ios/RNSSearchBar.h +14 -1
- package/ios/RNSSearchBar.mm +351 -0
- package/ios/{UIViewController+RNScreens.m → UIViewController+RNScreens.mm} +0 -0
- package/ios/{UIWindow+RNScreens.m → UIWindow+RNScreens.mm} +0 -0
- package/lib/commonjs/fabric/FullWindowOverlay.js +26 -0
- package/lib/commonjs/fabric/FullWindowOverlay.js.map +1 -0
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +21 -0
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenContainer.js +28 -0
- package/lib/commonjs/fabric/ScreenContainer.js.map +1 -0
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js +21 -0
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenNavigationContainer.js +28 -0
- package/lib/commonjs/fabric/ScreenNavigationContainer.js.map +1 -0
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js +21 -0
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/SearchBar.js +37 -0
- package/lib/commonjs/fabric/SearchBar.js.map +1 -0
- package/lib/commonjs/fabric/SearchBarNativeComponent.js +25 -0
- package/lib/commonjs/fabric/SearchBarNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/index.js +32 -0
- package/lib/commonjs/fabric/index.js.map +1 -1
- package/lib/commonjs/index.native.js +5 -18
- package/lib/commonjs/index.native.js.map +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.js +30 -0
- package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js +8 -2
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/module/fabric/FullWindowOverlay.js +15 -0
- package/lib/module/fabric/FullWindowOverlay.js.map +1 -0
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js +9 -0
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenContainer.js +17 -0
- package/lib/module/fabric/ScreenContainer.js.map +1 -0
- package/lib/module/fabric/ScreenContainerNativeComponent.js +9 -0
- package/lib/module/fabric/ScreenContainerNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNavigationContainer.js +17 -0
- package/lib/module/fabric/ScreenNavigationContainer.js.map +1 -0
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js +9 -0
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/module/fabric/SearchBar.js +24 -0
- package/lib/module/fabric/SearchBar.js.map +1 -0
- package/lib/module/fabric/SearchBarNativeComponent.js +11 -0
- package/lib/module/fabric/SearchBarNativeComponent.js.map +1 -0
- package/lib/module/fabric/index.js +5 -1
- package/lib/module/fabric/index.js.map +1 -1
- package/lib/module/index.native.js +6 -20
- package/lib/module/index.native.js.map +1 -1
- package/lib/module/native-stack/views/NativeStackView.js +30 -0
- package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js +7 -2
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/typescript/native-stack/types.d.ts +12 -0
- package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +1 -1
- package/lib/typescript/reanimated/ReanimatedScreen.d.ts +1 -1
- package/lib/typescript/types.d.ts +24 -0
- package/native-stack/README.md +21 -0
- package/package.json +2 -2
- package/src/fabric/FullWindowOverlay.js +13 -0
- package/src/fabric/FullWindowOverlayNativeComponent.js +19 -0
- package/src/fabric/ScreenContainer.js +16 -0
- package/src/fabric/ScreenContainerNativeComponent.js +19 -0
- package/src/fabric/ScreenNativeComponent.js +41 -8
- package/src/fabric/ScreenNavigationContainer.js +16 -0
- package/src/fabric/ScreenNavigationContainerNativeComponent.js +19 -0
- package/src/fabric/ScreenStackHeaderConfigNativeComponent.js +1 -1
- package/src/fabric/ScreenStackNativeComponent.js +4 -0
- package/src/fabric/SearchBar.js +20 -0
- package/src/fabric/SearchBarNativeComponent.js +62 -0
- package/src/fabric/index.js +8 -0
- package/src/index.native.tsx +13 -19
- package/src/native-stack/types.tsx +12 -0
- package/src/native-stack/views/NativeStackView.tsx +27 -0
- package/src/reanimated/ReanimatedNativeStackScreen.tsx +6 -0
- package/src/types.tsx +25 -0
- package/ios/RNSFullWindowOverlay.m +0 -105
- package/ios/RNSScreenComponentView.h +0 -23
- package/ios/RNSScreenComponentView.mm +0 -159
- package/ios/RNSScreenController.h +0 -10
- package/ios/RNSScreenController.mm +0 -79
- package/ios/RNSScreenStackComponentView.h +0 -15
- package/ios/RNSScreenStackComponentView.mm +0 -295
- package/ios/RNSScreenStackHeaderConfigComponentView.h +0 -42
- package/ios/RNSScreenStackHeaderConfigComponentView.mm +0 -662
- package/ios/RNSScreenStackHeaderSubviewComponentView.h +0 -14
- package/ios/RNSScreenStackHeaderSubviewComponentView.mm +0 -77
- package/ios/RNSSearchBar.m +0 -198
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#import "RNSScreenStackAnimator.h"
|
|
2
|
-
#import "RNSScreen.h"
|
|
3
2
|
#import "RNSScreenStack.h"
|
|
4
3
|
|
|
4
|
+
#import "RNSScreen.h"
|
|
5
|
+
|
|
5
6
|
// proportions to default transition duration
|
|
6
7
|
static const float RNSSlideOpenTransitionDurationProportion = 1;
|
|
7
8
|
static const float RNSFadeOpenTransitionDurationProportion = 0.2 / 0.35;
|
|
@@ -29,11 +30,11 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
|
|
|
29
30
|
if (_operation == UINavigationControllerOperationPush) {
|
|
30
31
|
UIViewController *toViewController =
|
|
31
32
|
[transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
|
|
32
|
-
screen = (
|
|
33
|
+
screen = ((RNSScreen *)toViewController).screenView;
|
|
33
34
|
} else if (_operation == UINavigationControllerOperationPop) {
|
|
34
35
|
UIViewController *fromViewController =
|
|
35
36
|
[transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
|
|
36
|
-
screen = (
|
|
37
|
+
screen = ((RNSScreen *)fromViewController).screenView;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
if (screen != nil && screen.stackAnimation == RNSScreenStackAnimationNone) {
|
|
@@ -57,9 +58,9 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
|
|
|
57
58
|
|
|
58
59
|
RNSScreenView *screen;
|
|
59
60
|
if (_operation == UINavigationControllerOperationPush) {
|
|
60
|
-
screen = (
|
|
61
|
+
screen = ((RNSScreen *)toViewController).screenView;
|
|
61
62
|
} else if (_operation == UINavigationControllerOperationPop) {
|
|
62
|
-
screen = (
|
|
63
|
+
screen = ((RNSScreen *)fromViewController).screenView;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
if (screen != nil) {
|
|
@@ -111,6 +112,7 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
|
|
|
111
112
|
}
|
|
112
113
|
completion:^(BOOL finished) {
|
|
113
114
|
fromViewController.view.transform = CGAffineTransformIdentity;
|
|
115
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
114
116
|
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
|
|
115
117
|
}];
|
|
116
118
|
} else if (_operation == UINavigationControllerOperationPop) {
|
|
@@ -122,9 +124,8 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
|
|
|
122
124
|
fromViewController.view.transform = rightTransform;
|
|
123
125
|
};
|
|
124
126
|
void (^completionBlock)(BOOL) = ^(BOOL finished) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
127
|
+
fromViewController.view.transform = CGAffineTransformIdentity;
|
|
128
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
128
129
|
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
|
|
129
130
|
};
|
|
130
131
|
|
|
@@ -157,6 +158,7 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
|
|
|
157
158
|
toViewController.view.alpha = 1.0;
|
|
158
159
|
}
|
|
159
160
|
completion:^(BOOL finished) {
|
|
161
|
+
toViewController.view.alpha = 1.0;
|
|
160
162
|
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
|
|
161
163
|
}];
|
|
162
164
|
} else if (_operation == UINavigationControllerOperationPop) {
|
|
@@ -167,9 +169,8 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
|
|
|
167
169
|
fromViewController.view.alpha = 0.0;
|
|
168
170
|
}
|
|
169
171
|
completion:^(BOOL finished) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
172
|
+
fromViewController.view.alpha = 1.0;
|
|
173
|
+
|
|
173
174
|
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
|
|
174
175
|
}];
|
|
175
176
|
}
|
|
@@ -192,6 +193,7 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
|
|
|
192
193
|
}
|
|
193
194
|
completion:^(BOOL finished) {
|
|
194
195
|
fromViewController.view.transform = CGAffineTransformIdentity;
|
|
196
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
195
197
|
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
|
|
196
198
|
}];
|
|
197
199
|
} else if (_operation == UINavigationControllerOperationPop) {
|
|
@@ -203,9 +205,8 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
|
|
|
203
205
|
fromViewController.view.transform = topBottomTransform;
|
|
204
206
|
};
|
|
205
207
|
void (^completionBlock)(BOOL) = ^(BOOL finished) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
208
|
+
fromViewController.view.transform = CGAffineTransformIdentity;
|
|
209
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
209
210
|
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
|
|
210
211
|
};
|
|
211
212
|
|
|
@@ -273,6 +274,10 @@ static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
|
|
|
273
274
|
fromViewController.view.transform = topBottomTransform;
|
|
274
275
|
}
|
|
275
276
|
completion:^(BOOL finished) {
|
|
277
|
+
fromViewController.view.transform = CGAffineTransformIdentity;
|
|
278
|
+
toViewController.view.transform = CGAffineTransformIdentity;
|
|
279
|
+
fromViewController.view.alpha = 1.0;
|
|
280
|
+
toViewController.view.alpha = 1.0;
|
|
276
281
|
[transitionContext completeTransition:![transitionContext transitionWasCancelled]];
|
|
277
282
|
}];
|
|
278
283
|
[UIView animateWithDuration:transitionDuration * RNSFadeCloseTransitionDurationProportion // defaults to 0.15 s
|
|
@@ -1,13 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
#ifdef RN_FABRIC_ENABLED
|
|
2
|
+
#import <React/RCTViewComponentView.h>
|
|
3
|
+
#else
|
|
2
4
|
#import <React/RCTViewManager.h>
|
|
5
|
+
#endif
|
|
3
6
|
|
|
7
|
+
#import <React/RCTConvert.h>
|
|
4
8
|
#import "RNSScreen.h"
|
|
9
|
+
#import "RNSScreenStackHeaderSubview.h"
|
|
5
10
|
#import "RNSSearchBar.h"
|
|
6
11
|
|
|
7
|
-
@interface RNSScreenStackHeaderConfig :
|
|
12
|
+
@interface RNSScreenStackHeaderConfig :
|
|
13
|
+
#ifdef RN_FABRIC_ENABLED
|
|
14
|
+
RCTViewComponentView
|
|
15
|
+
#else
|
|
16
|
+
UIView
|
|
17
|
+
#endif
|
|
8
18
|
|
|
9
19
|
@property (nonatomic, weak) RNSScreenView *screenView;
|
|
10
20
|
|
|
21
|
+
#ifdef RN_FABRIC_ENABLED
|
|
22
|
+
@property (nonatomic) BOOL show;
|
|
23
|
+
#else
|
|
24
|
+
@property (nonatomic) UIBlurEffectStyle blurEffect;
|
|
25
|
+
@property (nonatomic) BOOL hide;
|
|
26
|
+
#endif
|
|
27
|
+
|
|
11
28
|
@property (nonatomic, retain) NSString *title;
|
|
12
29
|
@property (nonatomic, retain) NSString *titleFontFamily;
|
|
13
30
|
@property (nonatomic, retain) NSNumber *titleFontSize;
|
|
@@ -17,9 +34,7 @@
|
|
|
17
34
|
@property (nonatomic, retain) NSString *backTitleFontFamily;
|
|
18
35
|
@property (nonatomic, retain) NSNumber *backTitleFontSize;
|
|
19
36
|
@property (nonatomic, retain) UIColor *backgroundColor;
|
|
20
|
-
@property (nonatomic) UIBlurEffectStyle blurEffect;
|
|
21
37
|
@property (nonatomic, retain) UIColor *color;
|
|
22
|
-
@property (nonatomic) BOOL hide;
|
|
23
38
|
@property (nonatomic) BOOL largeTitle;
|
|
24
39
|
@property (nonatomic, retain) NSString *largeTitleFontFamily;
|
|
25
40
|
@property (nonatomic, retain) NSNumber *largeTitleFontSize;
|
|
@@ -28,10 +43,10 @@
|
|
|
28
43
|
@property (nonatomic) BOOL largeTitleHideShadow;
|
|
29
44
|
@property (nonatomic, retain) UIColor *largeTitleColor;
|
|
30
45
|
@property (nonatomic) BOOL hideBackButton;
|
|
31
|
-
@property (nonatomic) BOOL backButtonInCustomView;
|
|
32
46
|
@property (nonatomic) BOOL disableBackButtonMenu;
|
|
33
47
|
@property (nonatomic) BOOL hideShadow;
|
|
34
48
|
@property (nonatomic) BOOL translucent;
|
|
49
|
+
@property (nonatomic) BOOL backButtonInCustomView;
|
|
35
50
|
@property (nonatomic) UISemanticContentAttribute direction;
|
|
36
51
|
|
|
37
52
|
+ (void)willShowViewController:(UIViewController *)vc
|
|
@@ -44,25 +59,9 @@
|
|
|
44
59
|
|
|
45
60
|
@end
|
|
46
61
|
|
|
47
|
-
typedef NS_ENUM(NSInteger, RNSScreenStackHeaderSubviewType) {
|
|
48
|
-
RNSScreenStackHeaderSubviewTypeBackButton,
|
|
49
|
-
RNSScreenStackHeaderSubviewTypeLeft,
|
|
50
|
-
RNSScreenStackHeaderSubviewTypeRight,
|
|
51
|
-
RNSScreenStackHeaderSubviewTypeTitle,
|
|
52
|
-
RNSScreenStackHeaderSubviewTypeCenter,
|
|
53
|
-
RNSScreenStackHeaderSubviewTypeSearchBar,
|
|
54
|
-
};
|
|
55
|
-
|
|
56
62
|
@interface RCTConvert (RNSScreenStackHeader)
|
|
57
63
|
|
|
58
|
-
+ (RNSScreenStackHeaderSubviewType)RNSScreenStackHeaderSubviewType:(id)json;
|
|
59
64
|
+ (UIBlurEffectStyle)UIBlurEffectStyle:(id)json;
|
|
60
65
|
+ (UISemanticContentAttribute)UISemanticContentAttribute:(id)json;
|
|
61
66
|
|
|
62
67
|
@end
|
|
63
|
-
|
|
64
|
-
@interface RNSScreenStackHeaderSubviewManager : RCTViewManager
|
|
65
|
-
|
|
66
|
-
@property (nonatomic) RNSScreenStackHeaderSubviewType type;
|
|
67
|
-
|
|
68
|
-
@end
|
|
@@ -1,16 +1,28 @@
|
|
|
1
|
-
#
|
|
2
|
-
#import
|
|
3
|
-
#import
|
|
4
|
-
|
|
1
|
+
#ifdef RN_FABRIC_ENABLED
|
|
2
|
+
#import <React/RCTConversions.h>
|
|
3
|
+
#import <React/UIView+React.h>
|
|
4
|
+
#import <react/renderer/components/rnscreens/ComponentDescriptors.h>
|
|
5
|
+
#import <react/renderer/components/rnscreens/EventEmitters.h>
|
|
6
|
+
#import <react/renderer/components/rnscreens/Props.h>
|
|
7
|
+
#import <react/renderer/components/rnscreens/RCTComponentViewHelpers.h>
|
|
8
|
+
#import "RCTFabricComponentsPlugins.h"
|
|
9
|
+
#else
|
|
5
10
|
#import <React/RCTBridge.h>
|
|
6
|
-
#import <React/RCTFont.h>
|
|
7
11
|
#import <React/RCTImageLoader.h>
|
|
8
12
|
#import <React/RCTImageSource.h>
|
|
9
13
|
#import <React/RCTImageView.h>
|
|
10
14
|
#import <React/RCTShadowView.h>
|
|
11
15
|
#import <React/RCTUIManager.h>
|
|
12
16
|
#import <React/RCTUIManagerUtils.h>
|
|
17
|
+
#endif
|
|
18
|
+
#import <React/RCTFont.h>
|
|
19
|
+
#import "RNSScreen.h"
|
|
20
|
+
#import "RNSScreenStackHeaderConfig.h"
|
|
21
|
+
#import "RNSSearchBar.h"
|
|
22
|
+
#import "RNSUIBarButtonItem.h"
|
|
13
23
|
|
|
24
|
+
#ifdef RN_FABRIC_ENABLED
|
|
25
|
+
#else
|
|
14
26
|
// Some RN private method hacking below. Couldn't figure out better way to access image data
|
|
15
27
|
// of a given RCTImageView. See more comments in the code section processing SubviewTypeBackButton
|
|
16
28
|
@interface RCTImageView (Private)
|
|
@@ -20,67 +32,30 @@
|
|
|
20
32
|
@interface RCTImageLoader (Private)
|
|
21
33
|
- (id<RCTImageCache>)imageCache;
|
|
22
34
|
@end
|
|
23
|
-
|
|
24
|
-
@interface RNSScreenStackHeaderSubview : UIView
|
|
25
|
-
|
|
26
|
-
@property (nonatomic, weak) RCTBridge *bridge;
|
|
27
|
-
@property (nonatomic, weak) UIView *reactSuperview;
|
|
28
|
-
@property (nonatomic) RNSScreenStackHeaderSubviewType type;
|
|
29
|
-
|
|
30
|
-
- (instancetype)initWithBridge:(RCTBridge *)bridge;
|
|
31
|
-
|
|
32
|
-
@end
|
|
33
|
-
|
|
34
|
-
@implementation RNSScreenStackHeaderSubview
|
|
35
|
-
|
|
36
|
-
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
37
|
-
{
|
|
38
|
-
if (self = [super init]) {
|
|
39
|
-
_bridge = bridge;
|
|
40
|
-
}
|
|
41
|
-
return self;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
- (void)reactSetFrame:(CGRect)frame
|
|
45
|
-
{
|
|
46
|
-
// Block any attempt to set coordinates on RNSScreenStackHeaderSubview. This
|
|
47
|
-
// makes UINavigationBar the only one to control the position of header content.
|
|
48
|
-
[super reactSetFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@end
|
|
52
|
-
|
|
53
|
-
@interface RNSUIBarButtonItem : UIBarButtonItem
|
|
54
|
-
|
|
55
|
-
@property (nonatomic) BOOL menuHidden;
|
|
56
|
-
|
|
57
|
-
@end
|
|
58
|
-
|
|
59
|
-
@implementation RNSUIBarButtonItem
|
|
60
|
-
|
|
61
|
-
- (void)setMenuHidden:(BOOL)menuHidden
|
|
62
|
-
{
|
|
63
|
-
_menuHidden = menuHidden;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_14_0) && \
|
|
67
|
-
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_0
|
|
68
|
-
- (void)setMenu:(UIMenu *)menu
|
|
69
|
-
{
|
|
70
|
-
if (@available(iOS 14.0, *)) {
|
|
71
|
-
if (!_menuHidden) {
|
|
72
|
-
super.menu = menu;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
35
|
#endif
|
|
77
36
|
|
|
78
|
-
@end
|
|
79
|
-
|
|
80
37
|
@implementation RNSScreenStackHeaderConfig {
|
|
81
38
|
NSMutableArray<RNSScreenStackHeaderSubview *> *_reactSubviews;
|
|
39
|
+
#ifdef RN_FABRIC_ENABLED
|
|
40
|
+
BOOL _initialPropsSet;
|
|
41
|
+
#else
|
|
42
|
+
#endif
|
|
82
43
|
}
|
|
83
44
|
|
|
45
|
+
#ifdef RN_FABRIC_ENABLED
|
|
46
|
+
- (instancetype)initWithFrame:(CGRect)frame
|
|
47
|
+
{
|
|
48
|
+
if (self = [super initWithFrame:frame]) {
|
|
49
|
+
static const auto defaultProps = std::make_shared<const facebook::react::RNSScreenStackHeaderConfigProps>();
|
|
50
|
+
_props = defaultProps;
|
|
51
|
+
self.hidden = YES;
|
|
52
|
+
_show = YES;
|
|
53
|
+
_translucent = NO;
|
|
54
|
+
_reactSubviews = [NSMutableArray new];
|
|
55
|
+
}
|
|
56
|
+
return self;
|
|
57
|
+
}
|
|
58
|
+
#else
|
|
84
59
|
- (instancetype)init
|
|
85
60
|
{
|
|
86
61
|
if (self = [super init]) {
|
|
@@ -90,16 +65,11 @@
|
|
|
90
65
|
}
|
|
91
66
|
return self;
|
|
92
67
|
}
|
|
68
|
+
#endif
|
|
93
69
|
|
|
94
|
-
- (
|
|
95
|
-
{
|
|
96
|
-
[_reactSubviews insertObject:subview atIndex:atIndex];
|
|
97
|
-
subview.reactSuperview = self;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
- (void)removeReactSubview:(RNSScreenStackHeaderSubview *)subview
|
|
70
|
+
- (UIView *)reactSuperview
|
|
101
71
|
{
|
|
102
|
-
|
|
72
|
+
return _screenView;
|
|
103
73
|
}
|
|
104
74
|
|
|
105
75
|
- (NSArray<UIView *> *)reactSubviews
|
|
@@ -107,11 +77,6 @@
|
|
|
107
77
|
return _reactSubviews;
|
|
108
78
|
}
|
|
109
79
|
|
|
110
|
-
- (UIView *)reactSuperview
|
|
111
|
-
{
|
|
112
|
-
return _screenView;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
80
|
- (void)removeFromSuperview
|
|
116
81
|
{
|
|
117
82
|
[super removeFromSuperview];
|
|
@@ -164,27 +129,12 @@
|
|
|
164
129
|
|
|
165
130
|
- (void)layoutNavigationControllerView
|
|
166
131
|
{
|
|
167
|
-
UIViewController *vc = _screenView.controller;
|
|
168
|
-
UINavigationController *navctr = vc.navigationController;
|
|
169
|
-
[navctr.view setNeedsLayout];
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
- (void)didSetProps:(NSArray<NSString *> *)changedProps
|
|
173
|
-
{
|
|
174
|
-
[super didSetProps:changedProps];
|
|
175
|
-
[self updateViewControllerIfNeeded];
|
|
176
132
|
// We need to layout navigation controller view after translucent prop changes, because otherwise
|
|
177
133
|
// frame of RNSScreen will not be changed and screen content will remain the same size.
|
|
178
134
|
// For more details look at https://github.com/software-mansion/react-native-screens/issues/1158
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
- (void)didUpdateReactSubviews
|
|
185
|
-
{
|
|
186
|
-
[super didUpdateReactSubviews];
|
|
187
|
-
[self updateViewControllerIfNeeded];
|
|
135
|
+
UIViewController *vc = _screenView.controller;
|
|
136
|
+
UINavigationController *navctr = vc.navigationController;
|
|
137
|
+
[navctr.view setNeedsLayout];
|
|
188
138
|
}
|
|
189
139
|
|
|
190
140
|
+ (void)setAnimatedConfig:(UIViewController *)vc withConfig:(RNSScreenStackHeaderConfig *)config
|
|
@@ -293,6 +243,9 @@
|
|
|
293
243
|
|
|
294
244
|
+ (UIImage *)loadBackButtonImageInViewController:(UIViewController *)vc withConfig:(RNSScreenStackHeaderConfig *)config
|
|
295
245
|
{
|
|
246
|
+
#ifdef RN_FABRIC_ENABLED
|
|
247
|
+
@throw([NSException exceptionWithName:@"UNIMPLEMENTED" reason:@"Implement" userInfo:nil]);
|
|
248
|
+
#else
|
|
296
249
|
BOOL hasBackButtonImage = NO;
|
|
297
250
|
for (RNSScreenStackHeaderSubview *subview in config.reactSubviews) {
|
|
298
251
|
if (subview.type == RNSScreenStackHeaderSubviewTypeBackButton && subview.subviews.count > 0) {
|
|
@@ -359,6 +312,7 @@
|
|
|
359
312
|
}
|
|
360
313
|
}
|
|
361
314
|
}
|
|
315
|
+
#endif // RN_FABRIC_ENABLED
|
|
362
316
|
return nil;
|
|
363
317
|
}
|
|
364
318
|
|
|
@@ -388,9 +342,13 @@
|
|
|
388
342
|
appearance.backgroundColor = config.backgroundColor;
|
|
389
343
|
}
|
|
390
344
|
|
|
345
|
+
// TODO: implement blurEffect on Fabric
|
|
346
|
+
#ifdef RN_FABRIC_ENABLED
|
|
347
|
+
#else
|
|
391
348
|
if (config.blurEffect) {
|
|
392
349
|
appearance.backgroundEffect = [UIBlurEffect effectWithStyle:config.blurEffect];
|
|
393
350
|
}
|
|
351
|
+
#endif
|
|
394
352
|
|
|
395
353
|
if (config.hideShadow) {
|
|
396
354
|
appearance.shadowColor = nil;
|
|
@@ -446,12 +404,16 @@
|
|
|
446
404
|
appearance.largeTitleTextAttributes = largeAttrs;
|
|
447
405
|
}
|
|
448
406
|
|
|
407
|
+
#ifdef RN_FABRIC_ENABLED
|
|
408
|
+
[appearance setBackIndicatorImage:nil transitionMaskImage:nil];
|
|
409
|
+
#else
|
|
449
410
|
UIImage *backButtonImage = [self loadBackButtonImageInViewController:vc withConfig:config];
|
|
450
411
|
if (backButtonImage) {
|
|
451
412
|
[appearance setBackIndicatorImage:backButtonImage transitionMaskImage:backButtonImage];
|
|
452
413
|
} else if (appearance.backIndicatorImage) {
|
|
453
414
|
[appearance setBackIndicatorImage:nil transitionMaskImage:nil];
|
|
454
415
|
}
|
|
416
|
+
#endif // RN_FABRIC_ENABLED
|
|
455
417
|
return appearance;
|
|
456
418
|
}
|
|
457
419
|
#endif
|
|
@@ -468,7 +430,11 @@
|
|
|
468
430
|
currentIndex > 0 ? [navctr.viewControllers objectAtIndex:currentIndex - 1].navigationItem : nil;
|
|
469
431
|
|
|
470
432
|
BOOL wasHidden = navctr.navigationBarHidden;
|
|
433
|
+
#ifdef RN_FABRIC_ENABLED
|
|
434
|
+
BOOL shouldHide = config == nil || !config.show;
|
|
435
|
+
#else
|
|
471
436
|
BOOL shouldHide = config == nil || config.hide;
|
|
437
|
+
#endif
|
|
472
438
|
|
|
473
439
|
if (!shouldHide && !config.translucent) {
|
|
474
440
|
// when nav bar is not translucent we chage edgesForExtendedLayout to avoid system laying out
|
|
@@ -572,6 +538,7 @@
|
|
|
572
538
|
navitem.leftBarButtonItem = nil;
|
|
573
539
|
navitem.rightBarButtonItem = nil;
|
|
574
540
|
navitem.titleView = nil;
|
|
541
|
+
|
|
575
542
|
for (RNSScreenStackHeaderSubview *subview in config.reactSubviews) {
|
|
576
543
|
switch (subview.type) {
|
|
577
544
|
case RNSScreenStackHeaderSubviewTypeLeft: {
|
|
@@ -609,8 +576,12 @@
|
|
|
609
576
|
}
|
|
610
577
|
#endif
|
|
611
578
|
}
|
|
579
|
+
break;
|
|
612
580
|
}
|
|
613
581
|
case RNSScreenStackHeaderSubviewTypeBackButton: {
|
|
582
|
+
#ifdef RN_FABRIC_ENABLED
|
|
583
|
+
RCTLogWarn(@"Back button subivew is not yet Fabric compatible in react-native-screens");
|
|
584
|
+
#endif
|
|
614
585
|
break;
|
|
615
586
|
}
|
|
616
587
|
}
|
|
@@ -647,8 +618,178 @@
|
|
|
647
618
|
}
|
|
648
619
|
}
|
|
649
620
|
|
|
621
|
+
- (void)insertReactSubview:(RNSScreenStackHeaderSubview *)subview atIndex:(NSInteger)atIndex
|
|
622
|
+
{
|
|
623
|
+
[_reactSubviews insertObject:subview atIndex:atIndex];
|
|
624
|
+
subview.reactSuperview = self;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
- (void)removeReactSubview:(RNSScreenStackHeaderSubview *)subview
|
|
628
|
+
{
|
|
629
|
+
[_reactSubviews removeObject:subview];
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
- (void)didUpdateReactSubviews
|
|
633
|
+
{
|
|
634
|
+
[super didUpdateReactSubviews];
|
|
635
|
+
[self updateViewControllerIfNeeded];
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
#ifdef RN_FABRIC_ENABLED
|
|
639
|
+
#pragma mark - Fabric specific
|
|
640
|
+
|
|
641
|
+
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
642
|
+
{
|
|
643
|
+
if (![childComponentView isKindOfClass:[RNSScreenStackHeaderSubview class]]) {
|
|
644
|
+
RCTLogError(@"ScreenStackHeader only accepts children of type ScreenStackHeaderSubview");
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
RCTAssert(
|
|
649
|
+
childComponentView.superview == nil,
|
|
650
|
+
@"Attempt to mount already mounted component view. (parent: %@, child: %@, index: %@, existing parent: %@)",
|
|
651
|
+
self,
|
|
652
|
+
childComponentView,
|
|
653
|
+
@(index),
|
|
654
|
+
@([childComponentView.superview tag]));
|
|
655
|
+
|
|
656
|
+
// [_reactSubviews insertObject:(RNSScreenStackHeaderSubview *)childComponentView atIndex:index];
|
|
657
|
+
[self insertReactSubview:(RNSScreenStackHeaderSubview *)childComponentView atIndex:index];
|
|
658
|
+
[self updateViewControllerIfNeeded];
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
662
|
+
{
|
|
663
|
+
[_reactSubviews removeObject:(RNSScreenStackHeaderSubview *)childComponentView];
|
|
664
|
+
[childComponentView removeFromSuperview];
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
#pragma mark - RCTComponentViewProtocol
|
|
668
|
+
|
|
669
|
+
- (void)prepareForRecycle
|
|
670
|
+
{
|
|
671
|
+
[super prepareForRecycle];
|
|
672
|
+
_initialPropsSet = NO;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
+ (facebook::react::ComponentDescriptorProvider)componentDescriptorProvider
|
|
676
|
+
{
|
|
677
|
+
return facebook::react::concreteComponentDescriptorProvider<
|
|
678
|
+
facebook::react::RNSScreenStackHeaderConfigComponentDescriptor>();
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
- (NSNumber *)getFontSizePropValue:(int)value
|
|
682
|
+
{
|
|
683
|
+
if (value > 0)
|
|
684
|
+
return [NSNumber numberWithInt:value];
|
|
685
|
+
return nil;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
- (UISemanticContentAttribute)getDirectionPropValue:(facebook::react::RNSScreenStackHeaderConfigDirection)direction
|
|
689
|
+
{
|
|
690
|
+
switch (direction) {
|
|
691
|
+
case facebook::react::RNSScreenStackHeaderConfigDirection::Rtl:
|
|
692
|
+
return UISemanticContentAttributeForceRightToLeft;
|
|
693
|
+
case facebook::react::RNSScreenStackHeaderConfigDirection::Ltr:
|
|
694
|
+
return UISemanticContentAttributeForceLeftToRight;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
- (void)updateProps:(facebook::react::Props::Shared const &)props
|
|
699
|
+
oldProps:(facebook::react::Props::Shared const &)oldProps
|
|
700
|
+
{
|
|
701
|
+
[super updateProps:props oldProps:oldProps];
|
|
702
|
+
|
|
703
|
+
const auto &oldScreenProps =
|
|
704
|
+
*std::static_pointer_cast<const facebook::react::RNSScreenStackHeaderConfigProps>(_props);
|
|
705
|
+
const auto &newScreenProps = *std::static_pointer_cast<const facebook::react::RNSScreenStackHeaderConfigProps>(props);
|
|
706
|
+
|
|
707
|
+
BOOL needsNavigationControllerLayout = !_initialPropsSet;
|
|
708
|
+
|
|
709
|
+
if (newScreenProps.hidden != !_show) {
|
|
710
|
+
_show = !newScreenProps.hidden;
|
|
711
|
+
needsNavigationControllerLayout = YES;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
if (newScreenProps.translucent != _translucent) {
|
|
715
|
+
_translucent = newScreenProps.translucent;
|
|
716
|
+
needsNavigationControllerLayout = YES;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
if (newScreenProps.backButtonInCustomView != _backButtonInCustomView) {
|
|
720
|
+
[self setBackButtonInCustomView:newScreenProps.backButtonInCustomView];
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
_title = RCTNSStringFromStringNilIfEmpty(newScreenProps.title);
|
|
724
|
+
if (newScreenProps.titleFontFamily != oldScreenProps.titleFontFamily) {
|
|
725
|
+
_titleFontFamily = RCTNSStringFromStringNilIfEmpty(newScreenProps.titleFontFamily);
|
|
726
|
+
}
|
|
727
|
+
_titleFontWeight = RCTNSStringFromStringNilIfEmpty(newScreenProps.titleFontWeight);
|
|
728
|
+
_titleFontSize = [self getFontSizePropValue:newScreenProps.titleFontSize];
|
|
729
|
+
_hideShadow = newScreenProps.hideShadow;
|
|
730
|
+
|
|
731
|
+
_largeTitle = newScreenProps.largeTitle;
|
|
732
|
+
if (newScreenProps.largeTitleFontFamily != oldScreenProps.largeTitleFontFamily) {
|
|
733
|
+
_largeTitleFontFamily = RCTNSStringFromStringNilIfEmpty(newScreenProps.largeTitleFontFamily);
|
|
734
|
+
}
|
|
735
|
+
_largeTitleFontWeight = RCTNSStringFromStringNilIfEmpty(newScreenProps.largeTitleFontWeight);
|
|
736
|
+
_largeTitleFontSize = [self getFontSizePropValue:newScreenProps.largeTitleFontSize];
|
|
737
|
+
_largeTitleHideShadow = newScreenProps.largeTitleHideShadow;
|
|
738
|
+
|
|
739
|
+
_backTitle = RCTNSStringFromStringNilIfEmpty(newScreenProps.backTitle);
|
|
740
|
+
if (newScreenProps.backTitleFontFamily != oldScreenProps.backTitleFontFamily) {
|
|
741
|
+
_backTitleFontFamily = RCTNSStringFromStringNilIfEmpty(newScreenProps.backTitleFontFamily);
|
|
742
|
+
}
|
|
743
|
+
_backTitleFontSize = [self getFontSizePropValue:newScreenProps.backTitleFontSize];
|
|
744
|
+
_hideBackButton = newScreenProps.hideBackButton;
|
|
745
|
+
_disableBackButtonMenu = newScreenProps.disableBackButtonMenu;
|
|
746
|
+
|
|
747
|
+
if (newScreenProps.direction != oldScreenProps.direction) {
|
|
748
|
+
_direction = [self getDirectionPropValue:newScreenProps.direction];
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
// We cannot compare SharedColor because it is shared value.
|
|
752
|
+
// We could compare color value, but it is more performant to just assign new value
|
|
753
|
+
_titleColor = RCTUIColorFromSharedColor(newScreenProps.titleColor);
|
|
754
|
+
_largeTitleColor = RCTUIColorFromSharedColor(newScreenProps.largeTitleColor);
|
|
755
|
+
_color = RCTUIColorFromSharedColor(newScreenProps.color);
|
|
756
|
+
_backgroundColor = RCTUIColorFromSharedColor(newScreenProps.backgroundColor);
|
|
757
|
+
|
|
758
|
+
[self updateViewControllerIfNeeded];
|
|
759
|
+
|
|
760
|
+
if (needsNavigationControllerLayout) {
|
|
761
|
+
[self layoutNavigationControllerView];
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
_initialPropsSet = YES;
|
|
765
|
+
_props = std::static_pointer_cast<facebook::react::RNSScreenStackHeaderConfigProps const>(props);
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
#else
|
|
769
|
+
#pragma mark - Paper specific
|
|
770
|
+
|
|
771
|
+
- (void)didSetProps:(NSArray<NSString *> *)changedProps
|
|
772
|
+
{
|
|
773
|
+
[super didSetProps:changedProps];
|
|
774
|
+
[self updateViewControllerIfNeeded];
|
|
775
|
+
// We need to layout navigation controller view after translucent prop changes, because otherwise
|
|
776
|
+
// frame of RNSScreen will not be changed and screen content will remain the same size.
|
|
777
|
+
// For more details look at https://github.com/software-mansion/react-native-screens/issues/1158
|
|
778
|
+
if ([changedProps containsObject:@"translucent"]) {
|
|
779
|
+
[self layoutNavigationControllerView];
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
#endif
|
|
650
784
|
@end
|
|
651
785
|
|
|
786
|
+
#ifdef RN_FABRIC_ENABLED
|
|
787
|
+
Class<RCTComponentViewProtocol> RNSScreenStackHeaderConfigCls(void)
|
|
788
|
+
{
|
|
789
|
+
return RNSScreenStackHeaderConfig.class;
|
|
790
|
+
}
|
|
791
|
+
#endif
|
|
792
|
+
|
|
652
793
|
@implementation RNSScreenStackHeaderConfigManager
|
|
653
794
|
|
|
654
795
|
RCT_EXPORT_MODULE()
|
|
@@ -729,19 +870,6 @@ RCT_EXPORT_VIEW_PROPERTY(translucent, BOOL)
|
|
|
729
870
|
return blurEffects;
|
|
730
871
|
}
|
|
731
872
|
|
|
732
|
-
RCT_ENUM_CONVERTER(
|
|
733
|
-
RNSScreenStackHeaderSubviewType,
|
|
734
|
-
(@{
|
|
735
|
-
@"back" : @(RNSScreenStackHeaderSubviewTypeBackButton),
|
|
736
|
-
@"left" : @(RNSScreenStackHeaderSubviewTypeLeft),
|
|
737
|
-
@"right" : @(RNSScreenStackHeaderSubviewTypeRight),
|
|
738
|
-
@"title" : @(RNSScreenStackHeaderSubviewTypeTitle),
|
|
739
|
-
@"center" : @(RNSScreenStackHeaderSubviewTypeCenter),
|
|
740
|
-
@"searchBar" : @(RNSScreenStackHeaderSubviewTypeSearchBar),
|
|
741
|
-
}),
|
|
742
|
-
RNSScreenStackHeaderSubviewTypeTitle,
|
|
743
|
-
integerValue)
|
|
744
|
-
|
|
745
873
|
RCT_ENUM_CONVERTER(
|
|
746
874
|
UISemanticContentAttribute,
|
|
747
875
|
(@{
|
|
@@ -754,16 +882,3 @@ RCT_ENUM_CONVERTER(
|
|
|
754
882
|
RCT_ENUM_CONVERTER(UIBlurEffectStyle, ([self blurEffectsForIOSVersion]), UIBlurEffectStyleExtraLight, integerValue)
|
|
755
883
|
|
|
756
884
|
@end
|
|
757
|
-
|
|
758
|
-
@implementation RNSScreenStackHeaderSubviewManager
|
|
759
|
-
|
|
760
|
-
RCT_EXPORT_MODULE()
|
|
761
|
-
|
|
762
|
-
RCT_EXPORT_VIEW_PROPERTY(type, RNSScreenStackHeaderSubviewType)
|
|
763
|
-
|
|
764
|
-
- (UIView *)view
|
|
765
|
-
{
|
|
766
|
-
return [[RNSScreenStackHeaderSubview alloc] initWithBridge:self.bridge];
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
@end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
#ifdef RN_FABRIC_ENABLED
|
|
3
|
+
#import <React/RCTViewComponentView.h>
|
|
4
|
+
#endif
|
|
5
|
+
|
|
6
|
+
#import <React/RCTConvert.h>
|
|
7
|
+
#import <react/RCTViewManager.h>
|
|
8
|
+
#import "RNSEnums.h"
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@interface RNSScreenStackHeaderSubview :
|
|
13
|
+
#ifdef RN_FABRIC_ENABLED
|
|
14
|
+
RCTViewComponentView
|
|
15
|
+
#else
|
|
16
|
+
UIView
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
@property (nonatomic) RNSScreenStackHeaderSubviewType type;
|
|
20
|
+
|
|
21
|
+
@property (nonatomic, weak) UIView *reactSuperview;
|
|
22
|
+
|
|
23
|
+
#ifdef RN_FABRIC_ENABLED
|
|
24
|
+
#else
|
|
25
|
+
@property (nonatomic, weak) RCTBridge *bridge;
|
|
26
|
+
|
|
27
|
+
- (instancetype)initWithBridge:(RCTBridge *)bridge;
|
|
28
|
+
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
@end
|
|
32
|
+
|
|
33
|
+
@interface RNSScreenStackHeaderSubviewManager : RCTViewManager
|
|
34
|
+
|
|
35
|
+
@property (nonatomic) RNSScreenStackHeaderSubviewType type;
|
|
36
|
+
|
|
37
|
+
@end
|
|
38
|
+
|
|
39
|
+
@interface RCTConvert (RNSScreenStackHeaderSubview)
|
|
40
|
+
|
|
41
|
+
+ (RNSScreenStackHeaderSubviewType)RNSScreenStackHeaderSubviewType:(id)json;
|
|
42
|
+
|
|
43
|
+
@end
|
|
44
|
+
|
|
45
|
+
NS_ASSUME_NONNULL_END
|