hybrid-navigation 2.7.0 → 2.7.4

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.4 (2022-02-14)
2
+
3
+ ### Android specific
4
+
5
+ - 修复 `FragmentManager is already executing transactions`
6
+
7
+ ### iOS specific
8
+
9
+ - 确保生命周期函数执行顺序
10
+
11
+ ## 2.7.3 (2022-02-10)
12
+
13
+ ### Android specific
14
+
15
+ - 修复 `Can not perform this action after onSaveInstanceState`
16
+
17
+ ## 2.7.2 (2022-01-10)
18
+
19
+ ### Android specific
20
+
21
+ - 修复调用 `setDefinesPresentationContext` 导致空指针的问题
22
+
23
+ ## 2.7.1 (2022-01-05)
24
+
25
+ ### iOS specific
26
+
27
+ - 修复 iOS 15.2 下,自定义返回图标无效的问题
28
+
1
29
  ## 2.7.0(2021-12-28)
2
30
 
3
31
  ### Android 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.4'
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 {
@@ -331,7 +334,7 @@ void printViewHierarchy(UIView *view, NSString *prefix) {
331
334
  [self.nav showFakeBarFrom:from to:to];
332
335
  } else {
333
336
  [self.nav updateNavigationBarForViewController:viewController];
334
- if (@available(iOS 15.0, *)) {
337
+ if (@available(iOS 13.0, *)) {
335
338
  if (to == viewController) {
336
339
  self.nav.navigationBar.scrollEdgeAppearance.backgroundColor = viewController.hbd_barTintColor;
337
340
  self.nav.navigationBar.standardAppearance.backgroundColor = viewController.hbd_barTintColor;
@@ -341,7 +344,7 @@ void printViewHierarchy(UIView *view, NSString *prefix) {
341
344
  } completion:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
342
345
  self.nav.poppingViewController = nil;
343
346
 
344
- if (@available(iOS 15.0, *)) {
347
+ if (@available(iOS 13.0, *)) {
345
348
  self.nav.navigationBar.scrollEdgeAppearance.backgroundColor = UIColor.clearColor;
346
349
  self.nav.navigationBar.standardAppearance.backgroundColor = UIColor.clearColor;
347
350
  }
@@ -470,11 +473,12 @@ void printViewHierarchy(UIView *view, NSString *prefix) {
470
473
  [self.navigationBar setTranslucent:YES];
471
474
  [self.navigationBar setShadowImage:[UINavigationBar appearance].shadowImage];
472
475
 
473
- if (@available(iOS 15.0, *)) {
476
+ if (@available(iOS 13.0, *)) {
474
477
  UINavigationBarAppearance *scrollEdgeAppearance = [[UINavigationBarAppearance alloc] init];
475
478
  [scrollEdgeAppearance configureWithTransparentBackground];
476
479
  scrollEdgeAppearance.shadowColor = UIColor.clearColor;
477
480
  scrollEdgeAppearance.backgroundColor = UIColor.clearColor;
481
+ [scrollEdgeAppearance setBackIndicatorImage:[UINavigationBar appearance].backIndicatorImage transitionMaskImage:[UINavigationBar appearance].backIndicatorTransitionMaskImage];
478
482
  self.navigationBar.scrollEdgeAppearance = scrollEdgeAppearance;
479
483
  self.navigationBar.standardAppearance = [scrollEdgeAppearance copy];
480
484
  }
@@ -626,7 +630,7 @@ void printViewHierarchy(UIView *view, NSString *prefix) {
626
630
  - (void)updateNavigationBarTinitColorForViewController:(UIViewController *)vc {
627
631
  self.navigationBar.tintColor = vc.hbd_tintColor;
628
632
  self.navigationBar.titleTextAttributes = vc.hbd_titleTextAttributes;
629
- if (@available(iOS 15.0, *)) {
633
+ if (@available(iOS 13.0, *)) {
630
634
  self.navigationBar.scrollEdgeAppearance.titleTextAttributes = vc.hbd_titleTextAttributes;
631
635
  self.navigationBar.standardAppearance.titleTextAttributes = vc.hbd_titleTextAttributes;
632
636
  }
@@ -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.0",
4
+ "version": "2.7.4",
5
5
  "keywords": [
6
6
  "react-native",
7
7
  "navigation",