hybrid-navigation 2.7.1 → 2.7.5

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/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ ## 2.7.5 (2022-02-21)
2
+
3
+ ### Android specific
4
+
5
+ - 修复 `IllegalStateException: Fragment not associated with a fragment manager.`
6
+
7
+ ## 2.7.4 (2022-02-14)
8
+
9
+ ### Android specific
10
+
11
+ - 修复 `FragmentManager is already executing transactions`
12
+
13
+ ### iOS specific
14
+
15
+ - 确保生命周期函数执行顺序
16
+
17
+ ## 2.7.3 (2022-02-10)
18
+
19
+ ### Android specific
20
+
21
+ - 修复 `Can not perform this action after onSaveInstanceState`
22
+
23
+ ## 2.7.2 (2022-01-10)
24
+
25
+ ### Android specific
26
+
27
+ - 修复调用 `setDefinesPresentationContext` 导致空指针的问题
28
+
1
29
  ## 2.7.1 (2022-01-05)
2
30
 
3
31
  ### iOS specific
@@ -33,5 +33,5 @@ dependencies {
33
33
  implementation fileTree(dir: 'libs', include: ['*.jar'])
34
34
  implementation 'com.facebook.react:react-native:+'
35
35
  // api project(':navigation')
36
- api 'io.github.listenzz:AndroidNavigation:12.0.0'
36
+ api 'io.github.listenzz:AndroidNavigation:12.0.5'
37
37
  }
@@ -75,16 +75,11 @@
75
75
  HBDNavigationController *navVC = [[HBDNavigationController alloc] initWithRootViewController:viewController];
76
76
  navVC.modalPresentationStyle = UIModalPresentationCurrentContext;
77
77
  [navVC setRequestCode:requestCode];
78
- [target beginAppearanceTransition:NO animated:YES];
79
- [target endAppearanceTransition];
80
78
  [target presentViewController:navVC animated:YES completion:^{
81
79
  resolve(@(YES));
82
80
  }];
83
81
  } else if ([action isEqualToString:@"dismiss"]) {
84
82
  UIViewController *presenting = target.presentingViewController;
85
- // make sure extra lifecycle excuting order
86
- [target beginAppearanceTransition:NO animated:YES];
87
- [target endAppearanceTransition];
88
83
  if (presenting) {
89
84
  [presenting dismissViewControllerAnimated:YES completion:^{
90
85
  resolve(@(YES));
@@ -110,8 +105,6 @@
110
105
  viewController = [[HBDReactBridgeManager get] controllerWithLayout:layout];
111
106
  [viewController setRequestCode:requestCode];
112
107
  viewController.modalPresentationStyle = UIModalPresentationCurrentContext;
113
- [target beginAppearanceTransition:NO animated:YES];
114
- [target endAppearanceTransition];
115
108
  [target presentViewController:viewController animated:YES completion:^{
116
109
  resolve(@(YES));
117
110
  }];
@@ -429,10 +429,11 @@
429
429
 
430
430
  - (void)hbd_showViewController:(UIViewController *)vc requestCode:(NSInteger)requestCode animated:(BOOL)animated completion:(void (^)(BOOL))completion {
431
431
  if (![self canShowModal]) {
432
+ [self didReceiveResultCode:0 resultData:nil requestCode:requestCode];
433
+
432
434
  if (completion) {
433
435
  completion(NO);
434
436
  }
435
- [self didReceiveResultCode:0 resultData:nil requestCode:requestCode];
436
437
  return;
437
438
  }
438
439
 
@@ -482,13 +483,14 @@
482
483
  }
483
484
 
484
485
  [self.hbd_modalViewController hideWithAnimated:animated completion:^(BOOL finished) {
485
- if (completion) {
486
- completion(finished);
487
- }
488
486
  UIViewController *target = self.hbd_targetViewController;
489
487
  [target beginAppearanceTransition:YES animated:YES];
490
488
  [target endAppearanceTransition];
491
489
  [target didReceiveResultCode:self.resultCode resultData:self.resultData requestCode:self.requestCode];
490
+
491
+ if (completion) {
492
+ completion(finished);
493
+ }
492
494
  }];
493
495
  }
494
496
 
@@ -135,7 +135,10 @@ void printViewHierarchy(UIView *view, NSString *prefix) {
135
135
  }
136
136
 
137
137
  - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer API_AVAILABLE(ios(7.0)){
138
- return YES;
138
+ if (gestureRecognizer == self.nav.interactivePopGestureRecognizer) {
139
+ return YES;
140
+ }
141
+ return NO;
139
142
  }
140
143
 
141
144
  - (void)handleNavigationTransition:(UIScreenEdgePanGestureRecognizer *)pan {
@@ -40,10 +40,10 @@
40
40
 
41
41
  - (void)hbd_presentViewController:(UIViewController *)viewController animated:(BOOL)flag completion:(void (^)(void))completion {
42
42
  if (![self canPresentViewController]) {
43
+ [self didReceiveResultCode:0 resultData:nil requestCode:viewController.requestCode];
43
44
  if (completion) {
44
45
  completion();
45
46
  }
46
- [self didReceiveResultCode:0 resultData:nil requestCode:viewController.requestCode];
47
47
  return;
48
48
  }
49
49
  [self hbd_presentViewController:viewController animated:flag completion:completion];
@@ -81,13 +81,13 @@
81
81
  }
82
82
 
83
83
  [self hbd_dismissViewControllerAnimated:animated completion:^{
84
- if (completion) {
85
- completion();
86
- }
87
-
88
84
  if (![presented isKindOfClass:[UIAlertController class]]) {
89
85
  [presenting didReceiveResultCode:presented.resultCode resultData:presented.resultData requestCode:presented.requestCode];
90
86
  }
87
+
88
+ if (completion) {
89
+ completion();
90
+ }
91
91
  }];
92
92
  }
93
93
 
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": "2.7.1",
4
+ "version": "2.7.5",
5
5
  "keywords": [
6
6
  "react-native",
7
7
  "navigation",
@@ -52,9 +52,9 @@
52
52
  "babel-jest": "^27.2.0",
53
53
  "babel-plugin-module-resolver": "^4.0.0",
54
54
  "jest": "^27.2.0",
55
- "metro-react-native-babel-preset": "^0.66.2",
55
+ "metro-react-native-babel-preset": "^0.68.0",
56
56
  "react": "17.0.2",
57
- "react-native": "^0.66.2",
57
+ "react-native": "^0.67.2",
58
58
  "react-native-fast-image": "^8.5.11",
59
59
  "react-native-iphone-x-helper": "^1.2.0",
60
60
  "react-native-keyboard-aware-scroll-view": "^0.9.5",