hybrid-navigation 4.0.0 → 4.0.2

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.
Files changed (58) hide show
  1. package/android/src/main/java/com/navigation/androidx/DrawerFragment.java +224 -12
  2. package/android/src/main/java/com/navigation/androidx/HybridDrawerLayout.java +636 -0
  3. package/android/src/main/java/com/navigation/androidx/StackFragment.java +4 -0
  4. package/android/src/main/java/com/navigation/androidx/TabBarFragment.java +4 -0
  5. package/android/src/main/java/com/reactnative/hybridnavigation/HBDRootView.java +36 -10
  6. package/android/src/main/java/com/reactnative/hybridnavigation/ReactAppCompatActivity.java +9 -0
  7. package/android/src/main/java/com/reactnative/hybridnavigation/ReactAppCompatActivityDelegate.java +1 -1
  8. package/android/src/main/java/com/reactnative/hybridnavigation/ReactFragment.java +2 -1
  9. package/android/src/main/java/com/reactnative/hybridnavigation/ReactSurfaceCleanup.java +54 -0
  10. package/android/src/main/res/layout/nav_fragment_drawer.xml +2 -2
  11. package/ios/Navigator/HBDStackNavigator.mm +1 -23
  12. package/ios/React/HBDNativeNavigation.mm +21 -5
  13. package/ios/ViewController/HBDDrawerController.mm +615 -87
  14. package/ios/ViewController/HBDNavigationController.mm +28 -1
  15. package/ios/ViewController/HBDViewController.mm +2 -2
  16. package/package.json +1 -1
  17. /package/dist/{src/DeepLink.d.ts → DeepLink.d.ts} +0 -0
  18. /package/dist/{src/DeepLink.js → DeepLink.js} +0 -0
  19. /package/dist/{src/NativeEvent.d.ts → NativeEvent.d.ts} +0 -0
  20. /package/dist/{src/NativeEvent.js → NativeEvent.js} +0 -0
  21. /package/dist/{src/NativeGarden.d.ts → NativeGarden.d.ts} +0 -0
  22. /package/dist/{src/NativeGarden.js → NativeGarden.js} +0 -0
  23. /package/dist/{src/NativeNavigation.d.ts → NativeNavigation.d.ts} +0 -0
  24. /package/dist/{src/NativeNavigation.js → NativeNavigation.js} +0 -0
  25. /package/dist/{src/Navigation.d.ts → Navigation.d.ts} +0 -0
  26. /package/dist/{src/Navigation.js → Navigation.js} +0 -0
  27. /package/dist/{src/NavigationComponentWrap.d.ts → NavigationComponentWrap.d.ts} +0 -0
  28. /package/dist/{src/NavigationComponentWrap.js → NavigationComponentWrap.js} +0 -0
  29. /package/dist/{src/Navigator.d.ts → Navigator.d.ts} +0 -0
  30. /package/dist/{src/Navigator.js → Navigator.js} +0 -0
  31. /package/dist/{src/Options.d.ts → Options.d.ts} +0 -0
  32. /package/dist/{src/Options.js → Options.js} +0 -0
  33. /package/dist/{src/Route.d.ts → Route.d.ts} +0 -0
  34. /package/dist/{src/Route.js → Route.js} +0 -0
  35. /package/dist/{src/handler → handler}/DispatchCommandHandler.d.ts +0 -0
  36. /package/dist/{src/handler → handler}/DispatchCommandHandler.js +0 -0
  37. /package/dist/{src/handler → handler}/LayoutCommandHandler.d.ts +0 -0
  38. /package/dist/{src/handler → handler}/LayoutCommandHandler.js +0 -0
  39. /package/dist/{src/handler → handler}/ResultEventHandler.d.ts +0 -0
  40. /package/dist/{src/handler → handler}/ResultEventHandler.js +0 -0
  41. /package/dist/{src/handler → handler}/VisibilityEventHandler.d.ts +0 -0
  42. /package/dist/{src/handler → handler}/VisibilityEventHandler.js +0 -0
  43. /package/dist/{src/hooks.d.ts → hooks.d.ts} +0 -0
  44. /package/dist/{src/hooks.js → hooks.js} +0 -0
  45. /package/dist/{src/index.d.ts → index.d.ts} +0 -0
  46. /package/dist/{src/index.js → index.js} +0 -0
  47. /package/dist/{src/router → router}/drawer.d.ts +0 -0
  48. /package/dist/{src/router → router}/drawer.js +0 -0
  49. /package/dist/{src/router → router}/index.d.ts +0 -0
  50. /package/dist/{src/router → router}/index.js +0 -0
  51. /package/dist/{src/router → router}/screen.d.ts +0 -0
  52. /package/dist/{src/router → router}/screen.js +0 -0
  53. /package/dist/{src/router → router}/stack.d.ts +0 -0
  54. /package/dist/{src/router → router}/stack.js +0 -0
  55. /package/dist/{src/router → router}/tabs.d.ts +0 -0
  56. /package/dist/{src/router → router}/tabs.js +0 -0
  57. /package/dist/{src/store.d.ts → store.d.ts} +0 -0
  58. /package/dist/{src/store.js → store.js} +0 -0
@@ -12,6 +12,7 @@
12
12
 
13
13
  - (UIGestureRecognizer *)superInteractivePopGestureRecognizer;
14
14
  - (void)handleNavigationTransition:(UIScreenEdgePanGestureRecognizer *)pan;
15
+ - (void)hideSystemNavigationBar;
15
16
 
16
17
  @end
17
18
 
@@ -54,6 +55,11 @@
54
55
  return self.topViewController;
55
56
  }
56
57
 
58
+ - (void)hideSystemNavigationBar {
59
+ [super setNavigationBarHidden:YES animated:NO];
60
+ self.navigationBar.hidden = YES;
61
+ }
62
+
57
63
  - (void)viewDidLoad {
58
64
  [super viewDidLoad];
59
65
  self.definesPresentationContext = NO;
@@ -65,7 +71,21 @@
65
71
  [self superInteractivePopGestureRecognizer].enabled = NO;
66
72
 
67
73
  self.delegate = self;
68
- [self setNavigationBarHidden:YES animated:NO];
74
+ [self hideSystemNavigationBar];
75
+ }
76
+
77
+ - (void)viewWillAppear:(BOOL)animated {
78
+ [super viewWillAppear:animated];
79
+ [self hideSystemNavigationBar];
80
+ }
81
+
82
+ - (void)viewDidAppear:(BOOL)animated {
83
+ [super viewDidAppear:animated];
84
+ [self hideSystemNavigationBar];
85
+ }
86
+
87
+ - (void)setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated {
88
+ [self hideSystemNavigationBar];
69
89
  }
70
90
 
71
91
  - (void)setDelegate:(id <UINavigationControllerDelegate>)delegate {
@@ -103,7 +123,14 @@
103
123
  }
104
124
  }
105
125
 
126
+ - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
127
+ // 在转场动画开始前强制隐藏导航栏,防止第一次 push 时闪现系统返回按钮
128
+ [self hideSystemNavigationBar];
129
+ }
130
+
106
131
  - (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
132
+ [self hideSystemNavigationBar];
133
+
107
134
  UIViewController *poppingVC = self.poppingViewController;
108
135
  if (poppingVC && [poppingVC isKindOfClass:[HBDViewController class]]) {
109
136
  [viewController didReceiveResultCode:poppingVC.resultCode resultData:poppingVC.resultData requestCode:0];
@@ -205,8 +205,8 @@
205
205
 
206
206
  UITabBarItemAppearance *itemAppearance = appearance.standardAppearance.stackedLayoutAppearance;
207
207
  if (unselectedIcon) {
208
- tabBarItem.image = [[HBDUtils UIImage:unselectedIcon] withIconColor:itemAppearance.normal.iconColor badgeColor:dot ? tabBarItem.badgeColor : UIColor.clearColor];
209
- tabBarItem.selectedImage = [[HBDUtils UIImage:icon] withIconColor:itemAppearance.selected.iconColor badgeColor:dot ? tabBarItem.badgeColor : UIColor.clearColor];
208
+ tabBarItem.image = [[HBDUtils UIImage:unselectedIcon] withIconColor:nil badgeColor:dot ? tabBarItem.badgeColor : UIColor.clearColor];
209
+ tabBarItem.selectedImage = [[HBDUtils UIImage:icon] withIconColor:nil badgeColor:dot ? tabBarItem.badgeColor : UIColor.clearColor];
210
210
  } else {
211
211
  tabBarItem.image = [[HBDUtils UIImage:icon] withIconColor:itemAppearance.normal.iconColor badgeColor:dot ? tabBarItem.badgeColor : UIColor.clearColor];
212
212
  tabBarItem.selectedImage = [[HBDUtils UIImage:icon] withIconColor:itemAppearance.selected.iconColor badgeColor:dot ? tabBarItem.badgeColor : UIColor.clearColor];
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": "4.0.0",
4
+ "version": "4.0.2",
5
5
  "main": "./dist/index",
6
6
  "module": "./dist/index",
7
7
  "types": "./dist/index.d.ts",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes