hybrid-navigation 5.3.0 → 5.4.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/java/com/reactnative/hybridnavigation/ReactFragment.java +10 -1
- package/dist/Options.d.ts +1 -0
- package/ios/Navigator/HBDStackNavigator.mm +2 -2
- package/ios/ViewController/HBDReactViewController.h +2 -0
- package/ios/ViewController/HBDReactViewController.mm +9 -1
- package/package.json +1 -1
- package/src/Options.ts +1 -0
|
@@ -59,13 +59,22 @@ public class ReactFragment extends HybridFragment implements ReactManager.ReactB
|
|
|
59
59
|
return false;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
@SuppressWarnings("deprecation")
|
|
63
|
+
private boolean shouldPrewarmPush() {
|
|
64
|
+
Object value = getOptions().get("prewarmPush");
|
|
65
|
+
if (value instanceof Boolean) {
|
|
66
|
+
return (Boolean) value;
|
|
67
|
+
}
|
|
68
|
+
return getReactManager().getGlobalStyle().isPrewarmPush();
|
|
69
|
+
}
|
|
70
|
+
|
|
62
71
|
public boolean prepareForAnimatedPush(
|
|
63
72
|
@NonNull StackFragment stackFragment,
|
|
64
73
|
@NonNull View container,
|
|
65
74
|
long timeoutMs,
|
|
66
75
|
@NonNull Runnable onReady
|
|
67
76
|
) {
|
|
68
|
-
if (!
|
|
77
|
+
if (!shouldPrewarmPush()
|
|
69
78
|
|| !isReactModuleRegisterCompleted()
|
|
70
79
|
|| !shouldAnimatedTransition()
|
|
71
80
|
|| reactSurface != null) {
|
package/dist/Options.d.ts
CHANGED
|
@@ -147,8 +147,8 @@ static const NSTimeInterval HBDPushPrewarmTimeoutSeconds = 0.18;
|
|
|
147
147
|
|
|
148
148
|
NSString *sceneId = vc.hbd_sceneId;
|
|
149
149
|
if (animated) {
|
|
150
|
-
BOOL canPrewarm = [
|
|
151
|
-
[vc
|
|
150
|
+
BOOL canPrewarm = [vc isKindOfClass:[HBDReactViewController class]] &&
|
|
151
|
+
[(HBDReactViewController *)vc shouldPrewarmPush] &&
|
|
152
152
|
nav.tabBarController == nil &&
|
|
153
153
|
nav.presentingViewController == nil &&
|
|
154
154
|
nav.view.window != nil &&
|
|
@@ -247,8 +247,16 @@
|
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
+
- (BOOL)shouldPrewarmPush {
|
|
251
|
+
id value = self.options[@"prewarmPush"];
|
|
252
|
+
if ([value isKindOfClass:[NSNumber class]]) {
|
|
253
|
+
return [value boolValue];
|
|
254
|
+
}
|
|
255
|
+
return [self hbd_globalStyle].prewarmPush;
|
|
256
|
+
}
|
|
257
|
+
|
|
250
258
|
- (BOOL)prepareForAnimatedPushInView:(UIView *)hostView timeout:(NSTimeInterval)timeout completion:(dispatch_block_t)completion {
|
|
251
|
-
if (![self
|
|
259
|
+
if (![self shouldPrewarmPush] || !completion || !hostView.window || CGRectIsEmpty(hostView.bounds) || ![self canUseCurrentWindowGeometry]) {
|
|
252
260
|
return NO;
|
|
253
261
|
}
|
|
254
262
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hybrid-navigation",
|
|
3
3
|
"description": "React Native Navigation that supports seamless navigation between Native and React.",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.4.0",
|
|
5
5
|
"main": "./dist/index",
|
|
6
6
|
"module": "./dist/index",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
package/src/Options.ts
CHANGED