react-native-screens 4.0.0 → 4.1.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/android/src/main/cpp/jni-adapter.cpp +3 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.cpp +1 -1
- package/ios/RNSConvert.h +0 -2
- package/ios/RNSConvert.mm +82 -68
- package/ios/RNSFullWindowOverlay.mm +4 -0
- package/ios/RNSScreen.mm +5 -0
- package/ios/RNSScreenContainer.mm +5 -0
- package/ios/RNSScreenFooter.mm +24 -25
- package/ios/RNSScreenStack.mm +8 -1
- package/ios/RNSScreenStackHeaderConfig.h +9 -6
- package/ios/RNSScreenStackHeaderConfig.mm +10 -1
- package/ios/RNSScreenStackHeaderSubview.mm +4 -0
- package/ios/utils/RNSDefines.h +7 -0
- package/package.json +1 -1
|
@@ -26,10 +26,10 @@ findHeaderConfigChild(const YogaLayoutableShadowNode &screenShadowNode) {
|
|
|
26
26
|
return {};
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
#ifdef ANDROID
|
|
29
30
|
static constexpr const char *kScreenDummyLayoutHelperClass =
|
|
30
31
|
"com/swmansion/rnscreens/utils/ScreenDummyLayoutHelper";
|
|
31
32
|
|
|
32
|
-
#ifdef ANDROID
|
|
33
33
|
std::optional<float> findHeaderHeight(
|
|
34
34
|
const int fontSize,
|
|
35
35
|
const bool isTitleEmpty) {
|
package/ios/RNSConvert.h
CHANGED
|
@@ -43,8 +43,6 @@ namespace react = facebook::react;
|
|
|
43
43
|
|
|
44
44
|
+ (RNSSearchBarPlacement)RNSScreenSearchBarPlacementFromCppEquivalent:(react::RNSSearchBarPlacement)placement;
|
|
45
45
|
|
|
46
|
-
+ (NSMutableArray<NSNumber *> *)NSNumberMutableArrayFromFloatVector:(const std::vector<CGFloat> &)vector;
|
|
47
|
-
|
|
48
46
|
+ (NSMutableArray<NSNumber *> *)arrayFromVector:(const std::vector<CGFloat> &)vector;
|
|
49
47
|
|
|
50
48
|
+ (RNSBlurEffectStyle)RNSBlurEffectStyleFromCppEquivalent:(react::RNSScreenStackHeaderConfigBlurEffect)blurEffect;
|
package/ios/RNSConvert.mm
CHANGED
|
@@ -11,9 +11,11 @@
|
|
|
11
11
|
(react::RNSScreenStackHeaderConfigDirection)direction
|
|
12
12
|
{
|
|
13
13
|
switch (direction) {
|
|
14
|
-
|
|
14
|
+
using enum react::RNSScreenStackHeaderConfigDirection;
|
|
15
|
+
|
|
16
|
+
case Rtl:
|
|
15
17
|
return UISemanticContentAttributeForceRightToLeft;
|
|
16
|
-
case
|
|
18
|
+
case Ltr:
|
|
17
19
|
return UISemanticContentAttributeForceLeftToRight;
|
|
18
20
|
}
|
|
19
21
|
}
|
|
@@ -22,11 +24,13 @@
|
|
|
22
24
|
(react::RNSScreenStackHeaderConfigBackButtonDisplayMode)backButtonDisplayMode
|
|
23
25
|
{
|
|
24
26
|
switch (backButtonDisplayMode) {
|
|
25
|
-
|
|
27
|
+
using enum react::RNSScreenStackHeaderConfigBackButtonDisplayMode;
|
|
28
|
+
|
|
29
|
+
case Default:
|
|
26
30
|
return UINavigationItemBackButtonDisplayModeDefault;
|
|
27
|
-
case
|
|
31
|
+
case Generic:
|
|
28
32
|
return UINavigationItemBackButtonDisplayModeGeneric;
|
|
29
|
-
case
|
|
33
|
+
case Minimal:
|
|
30
34
|
return UINavigationItemBackButtonDisplayModeMinimal;
|
|
31
35
|
}
|
|
32
36
|
}
|
|
@@ -35,19 +39,21 @@
|
|
|
35
39
|
(react::RNSScreenStackPresentation)stackPresentation
|
|
36
40
|
{
|
|
37
41
|
switch (stackPresentation) {
|
|
38
|
-
|
|
42
|
+
using enum react::RNSScreenStackPresentation;
|
|
43
|
+
|
|
44
|
+
case Push:
|
|
39
45
|
return RNSScreenStackPresentationPush;
|
|
40
|
-
case
|
|
46
|
+
case Modal:
|
|
41
47
|
return RNSScreenStackPresentationModal;
|
|
42
|
-
case
|
|
48
|
+
case FullScreenModal:
|
|
43
49
|
return RNSScreenStackPresentationFullScreenModal;
|
|
44
|
-
case
|
|
50
|
+
case FormSheet:
|
|
45
51
|
return RNSScreenStackPresentationFormSheet;
|
|
46
|
-
case
|
|
52
|
+
case ContainedModal:
|
|
47
53
|
return RNSScreenStackPresentationContainedModal;
|
|
48
|
-
case
|
|
54
|
+
case TransparentModal:
|
|
49
55
|
return RNSScreenStackPresentationTransparentModal;
|
|
50
|
-
case
|
|
56
|
+
case ContainedTransparentModal:
|
|
51
57
|
return RNSScreenStackPresentationContainedTransparentModal;
|
|
52
58
|
}
|
|
53
59
|
}
|
|
@@ -55,26 +61,27 @@
|
|
|
55
61
|
+ (RNSScreenStackAnimation)RNSScreenStackAnimationFromCppEquivalent:(react::RNSScreenStackAnimation)stackAnimation
|
|
56
62
|
{
|
|
57
63
|
switch (stackAnimation) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
case
|
|
61
|
-
case
|
|
64
|
+
using enum react::RNSScreenStackAnimation;
|
|
65
|
+
// these three are intentionally grouped
|
|
66
|
+
case Slide_from_right:
|
|
67
|
+
case Ios_from_right:
|
|
68
|
+
case Default:
|
|
62
69
|
return RNSScreenStackAnimationDefault;
|
|
63
70
|
// these two are intentionally grouped
|
|
64
|
-
case
|
|
65
|
-
case
|
|
71
|
+
case Slide_from_left:
|
|
72
|
+
case Ios_from_left:
|
|
66
73
|
return RNSScreenStackAnimationSlideFromLeft;
|
|
67
|
-
case
|
|
74
|
+
case Flip:
|
|
68
75
|
return RNSScreenStackAnimationFlip;
|
|
69
|
-
case
|
|
76
|
+
case Simple_push:
|
|
70
77
|
return RNSScreenStackAnimationSimplePush;
|
|
71
|
-
case
|
|
78
|
+
case None:
|
|
72
79
|
return RNSScreenStackAnimationNone;
|
|
73
|
-
case
|
|
80
|
+
case Fade:
|
|
74
81
|
return RNSScreenStackAnimationFade;
|
|
75
|
-
case
|
|
82
|
+
case Slide_from_bottom:
|
|
76
83
|
return RNSScreenStackAnimationSlideFromBottom;
|
|
77
|
-
case
|
|
84
|
+
case Fade_from_bottom:
|
|
78
85
|
return RNSScreenStackAnimationFadeFromBottom;
|
|
79
86
|
}
|
|
80
87
|
}
|
|
@@ -83,17 +90,19 @@
|
|
|
83
90
|
(react::RNSScreenStackHeaderSubviewType)subviewType
|
|
84
91
|
{
|
|
85
92
|
switch (subviewType) {
|
|
86
|
-
|
|
93
|
+
using enum react::RNSScreenStackHeaderSubviewType;
|
|
94
|
+
|
|
95
|
+
case Left:
|
|
87
96
|
return RNSScreenStackHeaderSubviewTypeLeft;
|
|
88
|
-
case
|
|
97
|
+
case Right:
|
|
89
98
|
return RNSScreenStackHeaderSubviewTypeRight;
|
|
90
|
-
case
|
|
99
|
+
case Title:
|
|
91
100
|
return RNSScreenStackHeaderSubviewTypeTitle;
|
|
92
|
-
case
|
|
101
|
+
case Center:
|
|
93
102
|
return RNSScreenStackHeaderSubviewTypeCenter;
|
|
94
|
-
case
|
|
103
|
+
case SearchBar:
|
|
95
104
|
return RNSScreenStackHeaderSubviewTypeSearchBar;
|
|
96
|
-
case
|
|
105
|
+
case Back:
|
|
97
106
|
return RNSScreenStackHeaderSubviewTypeBackButton;
|
|
98
107
|
}
|
|
99
108
|
}
|
|
@@ -102,9 +111,10 @@
|
|
|
102
111
|
(react::RNSScreenReplaceAnimation)replaceAnimation
|
|
103
112
|
{
|
|
104
113
|
switch (replaceAnimation) {
|
|
105
|
-
|
|
114
|
+
using enum react::RNSScreenReplaceAnimation;
|
|
115
|
+
case Pop:
|
|
106
116
|
return RNSScreenReplaceAnimationPop;
|
|
107
|
-
case
|
|
117
|
+
case Push:
|
|
108
118
|
return RNSScreenReplaceAnimationPush;
|
|
109
119
|
}
|
|
110
120
|
}
|
|
@@ -112,9 +122,10 @@
|
|
|
112
122
|
+ (RNSScreenSwipeDirection)RNSScreenSwipeDirectionFromCppEquivalent:(react::RNSScreenSwipeDirection)swipeDirection
|
|
113
123
|
{
|
|
114
124
|
switch (swipeDirection) {
|
|
115
|
-
|
|
125
|
+
using enum react::RNSScreenSwipeDirection;
|
|
126
|
+
case Horizontal:
|
|
116
127
|
return RNSScreenSwipeDirectionHorizontal;
|
|
117
|
-
case
|
|
128
|
+
case Vertical:
|
|
118
129
|
return RNSScreenSwipeDirectionVertical;
|
|
119
130
|
}
|
|
120
131
|
}
|
|
@@ -144,13 +155,14 @@
|
|
|
144
155
|
(react::RNSSearchBarAutoCapitalize)autoCapitalize
|
|
145
156
|
{
|
|
146
157
|
switch (autoCapitalize) {
|
|
147
|
-
|
|
158
|
+
using enum react::RNSSearchBarAutoCapitalize;
|
|
159
|
+
case Words:
|
|
148
160
|
return UITextAutocapitalizationTypeWords;
|
|
149
|
-
case
|
|
161
|
+
case Sentences:
|
|
150
162
|
return UITextAutocapitalizationTypeSentences;
|
|
151
|
-
case
|
|
163
|
+
case Characters:
|
|
152
164
|
return UITextAutocapitalizationTypeAllCharacters;
|
|
153
|
-
case
|
|
165
|
+
case None:
|
|
154
166
|
return UITextAutocapitalizationTypeNone;
|
|
155
167
|
}
|
|
156
168
|
}
|
|
@@ -159,11 +171,12 @@
|
|
|
159
171
|
+ (RNSSearchBarPlacement)RNSScreenSearchBarPlacementFromCppEquivalent:(react::RNSSearchBarPlacement)placement
|
|
160
172
|
{
|
|
161
173
|
switch (placement) {
|
|
162
|
-
|
|
174
|
+
using enum react::RNSSearchBarPlacement;
|
|
175
|
+
case Stacked:
|
|
163
176
|
return RNSSearchBarPlacementStacked;
|
|
164
|
-
case
|
|
177
|
+
case Automatic:
|
|
165
178
|
return RNSSearchBarPlacementAutomatic;
|
|
166
|
-
case
|
|
179
|
+
case Inline:
|
|
167
180
|
return RNSSearchBarPlacementInline;
|
|
168
181
|
}
|
|
169
182
|
}
|
|
@@ -179,68 +192,69 @@
|
|
|
179
192
|
|
|
180
193
|
+ (RNSBlurEffectStyle)RNSBlurEffectStyleFromCppEquivalent:(react::RNSScreenStackHeaderConfigBlurEffect)blurEffect
|
|
181
194
|
{
|
|
195
|
+
using enum react::RNSScreenStackHeaderConfigBlurEffect;
|
|
182
196
|
#if !TARGET_OS_TV && defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
|
|
183
197
|
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
|
|
184
198
|
if (@available(iOS 13.0, *)) {
|
|
185
199
|
switch (blurEffect) {
|
|
186
|
-
case
|
|
200
|
+
case None:
|
|
187
201
|
return RNSBlurEffectStyleNone;
|
|
188
|
-
case
|
|
202
|
+
case ExtraLight:
|
|
189
203
|
return RNSBlurEffectStyleExtraLight;
|
|
190
|
-
case
|
|
204
|
+
case Light:
|
|
191
205
|
return RNSBlurEffectStyleLight;
|
|
192
|
-
case
|
|
206
|
+
case Dark:
|
|
193
207
|
return RNSBlurEffectStyleDark;
|
|
194
|
-
case
|
|
208
|
+
case Regular:
|
|
195
209
|
return RNSBlurEffectStyleRegular;
|
|
196
|
-
case
|
|
210
|
+
case Prominent:
|
|
197
211
|
return RNSBlurEffectStyleProminent;
|
|
198
|
-
case
|
|
212
|
+
case SystemUltraThinMaterial:
|
|
199
213
|
return RNSBlurEffectStyleSystemUltraThinMaterial;
|
|
200
|
-
case
|
|
214
|
+
case SystemThinMaterial:
|
|
201
215
|
return RNSBlurEffectStyleSystemThinMaterial;
|
|
202
|
-
case
|
|
216
|
+
case SystemMaterial:
|
|
203
217
|
return RNSBlurEffectStyleSystemMaterial;
|
|
204
|
-
case
|
|
218
|
+
case SystemThickMaterial:
|
|
205
219
|
return RNSBlurEffectStyleSystemThickMaterial;
|
|
206
|
-
case
|
|
220
|
+
case SystemChromeMaterial:
|
|
207
221
|
return RNSBlurEffectStyleSystemChromeMaterial;
|
|
208
|
-
case
|
|
222
|
+
case SystemUltraThinMaterialLight:
|
|
209
223
|
return RNSBlurEffectStyleSystemUltraThinMaterialLight;
|
|
210
|
-
case
|
|
224
|
+
case SystemThinMaterialLight:
|
|
211
225
|
return RNSBlurEffectStyleSystemThinMaterialLight;
|
|
212
|
-
case
|
|
226
|
+
case SystemMaterialLight:
|
|
213
227
|
return RNSBlurEffectStyleSystemMaterialLight;
|
|
214
|
-
case
|
|
228
|
+
case SystemThickMaterialLight:
|
|
215
229
|
return RNSBlurEffectStyleSystemThickMaterialLight;
|
|
216
|
-
case
|
|
230
|
+
case SystemChromeMaterialLight:
|
|
217
231
|
return RNSBlurEffectStyleSystemChromeMaterialLight;
|
|
218
|
-
case
|
|
232
|
+
case SystemUltraThinMaterialDark:
|
|
219
233
|
return RNSBlurEffectStyleSystemUltraThinMaterialDark;
|
|
220
|
-
case
|
|
234
|
+
case SystemThinMaterialDark:
|
|
221
235
|
return RNSBlurEffectStyleSystemThinMaterialDark;
|
|
222
|
-
case
|
|
236
|
+
case SystemMaterialDark:
|
|
223
237
|
return RNSBlurEffectStyleSystemMaterialDark;
|
|
224
|
-
case
|
|
238
|
+
case SystemThickMaterialDark:
|
|
225
239
|
return RNSBlurEffectStyleSystemThickMaterialDark;
|
|
226
|
-
case
|
|
240
|
+
case SystemChromeMaterialDark:
|
|
227
241
|
return RNSBlurEffectStyleSystemChromeMaterialDark;
|
|
228
242
|
}
|
|
229
243
|
}
|
|
230
244
|
#endif
|
|
231
245
|
|
|
232
246
|
switch (blurEffect) {
|
|
233
|
-
case
|
|
247
|
+
case None:
|
|
234
248
|
return RNSBlurEffectStyleNone;
|
|
235
|
-
case
|
|
249
|
+
case Light:
|
|
236
250
|
return RNSBlurEffectStyleLight;
|
|
237
|
-
case
|
|
251
|
+
case Dark:
|
|
238
252
|
return RNSBlurEffectStyleDark;
|
|
239
|
-
case
|
|
253
|
+
case Regular:
|
|
240
254
|
return RNSBlurEffectStyleRegular;
|
|
241
|
-
case
|
|
255
|
+
case Prominent:
|
|
242
256
|
return RNSBlurEffectStyleProminent;
|
|
243
|
-
case
|
|
257
|
+
case ExtraLight:
|
|
244
258
|
default:
|
|
245
259
|
return RNSBlurEffectStyleNone;
|
|
246
260
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#import <UIKit/UIKit.h>
|
|
2
2
|
|
|
3
|
+
#import "RNSDefines.h"
|
|
3
4
|
#import "RNSFullWindowOverlay.h"
|
|
4
5
|
|
|
5
6
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -198,6 +199,8 @@
|
|
|
198
199
|
[childComponentView removeFromSuperview];
|
|
199
200
|
}
|
|
200
201
|
|
|
202
|
+
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
203
|
+
// We do not set frame for ouselves, but rather for the container.
|
|
201
204
|
- (void)updateLayoutMetrics:(react::LayoutMetrics const &)layoutMetrics
|
|
202
205
|
oldLayoutMetrics:(react::LayoutMetrics const &)oldLayoutMetrics
|
|
203
206
|
{
|
|
@@ -205,6 +208,7 @@
|
|
|
205
208
|
_reactFrame = frame;
|
|
206
209
|
[_container setFrame:frame];
|
|
207
210
|
}
|
|
211
|
+
RNS_IGNORE_SUPER_CALL_END
|
|
208
212
|
|
|
209
213
|
#else
|
|
210
214
|
#pragma mark - Paper specific
|
package/ios/RNSScreen.mm
CHANGED
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
#import "RNSScreenStack.h"
|
|
32
32
|
#import "RNSScreenStackHeaderConfig.h"
|
|
33
33
|
|
|
34
|
+
#import "RNSDefines.h"
|
|
34
35
|
#import "UIView+RNSUtility.h"
|
|
35
36
|
|
|
36
37
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -136,10 +137,12 @@ constexpr NSInteger SHEET_LARGEST_UNDIMMED_DETENT_NONE = -1;
|
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
140
|
+
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
139
141
|
- (NSArray<UIView *> *)reactSubviews
|
|
140
142
|
{
|
|
141
143
|
return _reactSubviews;
|
|
142
144
|
}
|
|
145
|
+
RNS_IGNORE_SUPER_CALL_END
|
|
143
146
|
#endif
|
|
144
147
|
|
|
145
148
|
- (void)updateBounds
|
|
@@ -374,10 +377,12 @@ constexpr NSInteger SHEET_LARGEST_UNDIMMED_DETENT_NONE = -1;
|
|
|
374
377
|
}
|
|
375
378
|
#endif
|
|
376
379
|
|
|
380
|
+
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
377
381
|
- (UIView *)reactSuperview
|
|
378
382
|
{
|
|
379
383
|
return _reactSuperview;
|
|
380
384
|
}
|
|
385
|
+
RNS_IGNORE_SUPER_CALL_END
|
|
381
386
|
|
|
382
387
|
/// This is RNSScreenContentWrapperDelegate method, where we do get notified when React did update frame of our child.
|
|
383
388
|
- (void)reactDidSetFrame:(CGRect)reactFrame forContentWrapper:(RNSScreenContentWrapper *)contentWrapepr
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#import "RNSScreenContainer.h"
|
|
2
|
+
#import "RNSDefines.h"
|
|
2
3
|
#import "RNSScreen.h"
|
|
3
4
|
|
|
4
5
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -89,6 +90,9 @@ namespace react = facebook::react;
|
|
|
89
90
|
[self updateContainer];
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
94
|
+
// We do not call super as we do not want to update UIKit model. It will
|
|
95
|
+
// be updated after we receive all mutations.
|
|
92
96
|
- (void)insertReactSubview:(RNSScreenView *)subview atIndex:(NSInteger)atIndex
|
|
93
97
|
{
|
|
94
98
|
subview.reactSuperview = self;
|
|
@@ -106,6 +110,7 @@ namespace react = facebook::react;
|
|
|
106
110
|
{
|
|
107
111
|
return _reactSubviews;
|
|
108
112
|
}
|
|
113
|
+
RNS_IGNORE_SUPER_CALL_END
|
|
109
114
|
|
|
110
115
|
- (UIViewController *)reactViewController
|
|
111
116
|
{
|
package/ios/RNSScreenFooter.mm
CHANGED
|
@@ -26,35 +26,34 @@
|
|
|
26
26
|
- (void)willMoveToSuperview:(UIView *)newSuperview
|
|
27
27
|
{
|
|
28
28
|
[super willMoveToSuperview:newSuperview];
|
|
29
|
-
if ([newSuperview isKindOfClass:RNSScreenView.class]) {
|
|
30
|
-
RNSScreenView *screen = (RNSScreenView *)newSuperview;
|
|
31
|
-
_parent = (RNSScreenView *)newSuperview;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
29
|
+
// if ([newSuperview isKindOfClass:RNSScreenView.class]) {
|
|
30
|
+
// RNSScreenView *screen = (RNSScreenView *)newSuperview;
|
|
31
|
+
// _parent = (RNSScreenView *)newSuperview;
|
|
32
|
+
|
|
33
|
+
// [NSLayoutConstraint activateConstraints:@[
|
|
34
|
+
// [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeBottom
|
|
35
|
+
// relatedBy:NSLayoutRelationEqual toItem:screen attribute:NSLayoutAttributeBottom multiplier:1.0
|
|
36
|
+
// constant:0.0], [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeLeft
|
|
37
|
+
// relatedBy:NSLayoutRelationEqual toItem:screen attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0.0],
|
|
38
|
+
// [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual
|
|
39
|
+
// toItem:screen attribute:NSLayoutAttributeRight multiplier:1.0 constant:0.0], [NSLayoutConstraint
|
|
40
|
+
// constraintWithItem:self attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:screen
|
|
41
|
+
// attribute:NSLayoutAttributeTop multiplier:1.0 constant:0.0], [NSLayoutConstraint constraintWithItem:screen
|
|
42
|
+
// attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self
|
|
43
|
+
// attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0.0], [NSLayoutConstraint
|
|
44
|
+
// constraintWithItem:screen attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self
|
|
45
|
+
// attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0.0], [NSLayoutConstraint constraintWithItem:screen
|
|
46
|
+
// attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self
|
|
47
|
+
// attribute:NSLayoutAttributeRight multiplier:1.0 constant:0.0], [NSLayoutConstraint constraintWithItem:screen
|
|
48
|
+
// attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop
|
|
49
|
+
// multiplier:1.0 constant:0.0],
|
|
50
|
+
// ]];
|
|
51
|
+
// [self setNeedsLayout];
|
|
52
|
+
// }
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
- (void)didMoveToSuperview
|
|
56
56
|
{
|
|
57
|
-
NSLog(@"Adding constraints between %@ and %@", self, _parent);
|
|
58
57
|
if (_parent != nil) {
|
|
59
58
|
// [NSLayoutConstraint activateConstraints:@[
|
|
60
59
|
// [NSLayoutConstraint constraintWithItem:self
|
package/ios/RNSScreenStack.mm
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
#import "RCTTouchHandler+RNSUtility.h"
|
|
21
21
|
#endif // RCT_NEW_ARCH_ENABLED
|
|
22
22
|
|
|
23
|
+
#import "RNSDefines.h"
|
|
23
24
|
#import "RNSPercentDrivenInteractiveTransition.h"
|
|
24
25
|
#import "RNSScreen.h"
|
|
25
26
|
#import "RNSScreenStack.h"
|
|
@@ -290,10 +291,12 @@ namespace react = facebook::react;
|
|
|
290
291
|
}
|
|
291
292
|
}
|
|
292
293
|
|
|
294
|
+
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
293
295
|
- (NSArray<UIView *> *)reactSubviews
|
|
294
296
|
{
|
|
295
297
|
return _reactSubviews;
|
|
296
298
|
}
|
|
299
|
+
RNS_IGNORE_SUPER_CALL_END
|
|
297
300
|
|
|
298
301
|
- (void)didMoveToWindow
|
|
299
302
|
{
|
|
@@ -1086,6 +1089,9 @@ namespace react = facebook::react;
|
|
|
1086
1089
|
|
|
1087
1090
|
#endif // !TARGET_OS_TV
|
|
1088
1091
|
|
|
1092
|
+
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
1093
|
+
// We hijack the udpates as we don't want to update UIKit model yet.
|
|
1094
|
+
// This is done after all mutations are processed.
|
|
1089
1095
|
- (void)insertReactSubview:(RNSScreenView *)subview atIndex:(NSInteger)atIndex
|
|
1090
1096
|
{
|
|
1091
1097
|
if (![subview isKindOfClass:[RNSScreenView class]]) {
|
|
@@ -1101,6 +1107,7 @@ namespace react = facebook::react;
|
|
|
1101
1107
|
subview.reactSuperview = nil;
|
|
1102
1108
|
[_reactSubviews removeObject:subview];
|
|
1103
1109
|
}
|
|
1110
|
+
RNS_IGNORE_SUPER_CALL_END
|
|
1104
1111
|
|
|
1105
1112
|
- (void)didUpdateReactSubviews
|
|
1106
1113
|
{
|
|
@@ -1288,7 +1295,7 @@ namespace react = facebook::react;
|
|
|
1288
1295
|
// with modal presentation or foreign modal presented from inside a Screen.
|
|
1289
1296
|
- (void)dismissAllRelatedModals
|
|
1290
1297
|
{
|
|
1291
|
-
[_controller dismissViewControllerAnimated:
|
|
1298
|
+
[_controller dismissViewControllerAnimated:YES completion:nil];
|
|
1292
1299
|
|
|
1293
1300
|
// This loop seems to be excessive. Above message send to `_controller` should
|
|
1294
1301
|
// be enough, because system dismisses the controllers recursively,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
@interface NSString (RNSStringUtil)
|
|
14
14
|
|
|
15
|
-
+ (BOOL)RNSisBlank:(NSString *)string;
|
|
15
|
+
+ (BOOL)RNSisBlank:(nullable NSString *)string;
|
|
16
16
|
|
|
17
17
|
@end
|
|
18
18
|
|
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
@property (nonatomic) BOOL hide;
|
|
32
32
|
#endif
|
|
33
33
|
|
|
34
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
35
|
+
|
|
34
36
|
@property (nonatomic, retain) NSString *title;
|
|
35
37
|
@property (nonatomic, retain) NSString *titleFontFamily;
|
|
36
38
|
@property (nonatomic, retain) NSNumber *titleFontSize;
|
|
@@ -58,9 +60,11 @@
|
|
|
58
60
|
@property (nonatomic) UINavigationItemBackButtonDisplayMode backButtonDisplayMode;
|
|
59
61
|
@property (nonatomic) RNSBlurEffectStyle blurEffect;
|
|
60
62
|
|
|
61
|
-
|
|
63
|
+
NS_ASSUME_NONNULL_END
|
|
64
|
+
|
|
65
|
+
+ (void)willShowViewController:(nonnull UIViewController *)vc
|
|
62
66
|
animated:(BOOL)animated
|
|
63
|
-
withConfig:(RNSScreenStackHeaderConfig *)config;
|
|
67
|
+
withConfig:(nonnull RNSScreenStackHeaderConfig *)config;
|
|
64
68
|
|
|
65
69
|
/**
|
|
66
70
|
* Allows to send information with insets to the corresponding node in shadow tree.
|
|
@@ -132,8 +136,7 @@
|
|
|
132
136
|
|
|
133
137
|
@interface RCTConvert (RNSScreenStackHeader)
|
|
134
138
|
|
|
135
|
-
+ (
|
|
136
|
-
+ (
|
|
137
|
-
+ (UINavigationItemBackButtonDisplayMode)UINavigationItemBackButtonDisplayMode:(id)json;
|
|
139
|
+
+ (UISemanticContentAttribute)UISemanticContentAttribute:(nonnull id)json;
|
|
140
|
+
+ (UINavigationItemBackButtonDisplayMode)UINavigationItemBackButtonDisplayMode:(nonnull id)json;
|
|
138
141
|
|
|
139
142
|
@end
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
#import <React/RCTImageLoader.h>
|
|
22
22
|
#import <React/RCTImageSource.h>
|
|
23
23
|
#import "RNSConvert.h"
|
|
24
|
+
#import "RNSDefines.h"
|
|
24
25
|
#import "RNSScreen.h"
|
|
25
26
|
#import "RNSScreenStackHeaderConfig.h"
|
|
26
27
|
#import "RNSSearchBar.h"
|
|
@@ -113,6 +114,7 @@ namespace react = facebook::react;
|
|
|
113
114
|
_blurEffect = RNSBlurEffectStyleNone;
|
|
114
115
|
}
|
|
115
116
|
|
|
117
|
+
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
116
118
|
- (UIView *)reactSuperview
|
|
117
119
|
{
|
|
118
120
|
return _screenView;
|
|
@@ -122,6 +124,7 @@ namespace react = facebook::react;
|
|
|
122
124
|
{
|
|
123
125
|
return _reactSubviews;
|
|
124
126
|
}
|
|
127
|
+
RNS_IGNORE_SUPER_CALL_END
|
|
125
128
|
|
|
126
129
|
- (void)removeFromSuperview
|
|
127
130
|
{
|
|
@@ -785,6 +788,7 @@ namespace react = facebook::react;
|
|
|
785
788
|
}
|
|
786
789
|
}
|
|
787
790
|
|
|
791
|
+
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
788
792
|
- (void)insertReactSubview:(RNSScreenStackHeaderSubview *)subview atIndex:(NSInteger)atIndex
|
|
789
793
|
{
|
|
790
794
|
[_reactSubviews insertObject:subview atIndex:atIndex];
|
|
@@ -795,6 +799,7 @@ namespace react = facebook::react;
|
|
|
795
799
|
{
|
|
796
800
|
[_reactSubviews removeObject:subview];
|
|
797
801
|
}
|
|
802
|
+
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
798
803
|
|
|
799
804
|
- (void)didUpdateReactSubviews
|
|
800
805
|
{
|
|
@@ -879,6 +884,9 @@ static RCTResizeMode resizeModeFromCppEquiv(react::ImageResizeMode resizeMode)
|
|
|
879
884
|
return RCTResizeModeCenter;
|
|
880
885
|
case react::ImageResizeMode::Repeat:
|
|
881
886
|
return RCTResizeModeRepeat;
|
|
887
|
+
default:
|
|
888
|
+
// Both RCTConvert and ImageProps use this as a default as of RN 0.76
|
|
889
|
+
return RCTResizeModeStretch;
|
|
882
890
|
}
|
|
883
891
|
}
|
|
884
892
|
|
|
@@ -956,7 +964,8 @@ static RCTResizeMode resizeModeFromCppEquiv(react::ImageResizeMode resizeMode)
|
|
|
956
964
|
_largeTitleFontWeight = RCTNSStringFromStringNilIfEmpty(newScreenProps.largeTitleFontWeight);
|
|
957
965
|
_largeTitleFontSize = [self getFontSizePropValue:newScreenProps.largeTitleFontSize];
|
|
958
966
|
_largeTitleHideShadow = newScreenProps.largeTitleHideShadow;
|
|
959
|
-
|
|
967
|
+
_largeTitleBackgroundColor = RCTUIColorFromSharedColor(newScreenProps.largeTitleBackgroundColor);
|
|
968
|
+
|
|
960
969
|
_backTitle = RCTNSStringFromStringNilIfEmpty(newScreenProps.backTitle);
|
|
961
970
|
if (newScreenProps.backTitleFontFamily != oldScreenProps.backTitleFontFamily) {
|
|
962
971
|
_backTitleFontFamily = RCTNSStringFromStringNilIfEmpty(newScreenProps.backTitleFontFamily);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#import "RNSScreenStackHeaderSubview.h"
|
|
2
2
|
#import "RNSConvert.h"
|
|
3
|
+
#import "RNSDefines.h"
|
|
3
4
|
#import "RNSScreenStackHeaderConfig.h"
|
|
4
5
|
|
|
5
6
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
@@ -86,6 +87,8 @@ namespace react = facebook::react;
|
|
|
86
87
|
return react::concreteComponentDescriptorProvider<react::RNSScreenStackHeaderSubviewComponentDescriptor>();
|
|
87
88
|
}
|
|
88
89
|
|
|
90
|
+
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
91
|
+
// System layouts the subviews.
|
|
89
92
|
- (void)updateLayoutMetrics:(const react::LayoutMetrics &)layoutMetrics
|
|
90
93
|
oldLayoutMetrics:(const react::LayoutMetrics &)oldLayoutMetrics
|
|
91
94
|
{
|
|
@@ -105,6 +108,7 @@ namespace react = facebook::react;
|
|
|
105
108
|
[self layoutNavigationBarIfNeeded];
|
|
106
109
|
}
|
|
107
110
|
}
|
|
111
|
+
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
108
112
|
|
|
109
113
|
+ (BOOL)shouldBeRecycled
|
|
110
114
|
{
|
package/package.json
CHANGED