hybrid-navigation 5.4.0 → 5.5.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/HybridNavigation.podspec +1 -0
- package/android/proguard-rules.pro +5 -0
- package/android/src/main/java/com/navigation/androidx/AppUtils.java +8 -1
- package/android/src/main/java/com/navigation/androidx/AwesomeActivity.java +115 -36
- package/android/src/main/java/com/navigation/androidx/AwesomeFragment.java +153 -100
- package/android/src/main/java/com/navigation/androidx/DefaultTabBarProvider.java +1 -1
- package/android/src/main/java/com/navigation/androidx/DrawableUtils.java +5 -1
- package/android/src/main/java/com/navigation/androidx/DrawerFragment.java +95 -39
- package/android/src/main/java/com/navigation/androidx/FragmentHelper.java +195 -29
- package/android/src/main/java/com/navigation/androidx/HybridDrawerLayout.java +225 -27
- package/android/src/main/java/com/navigation/androidx/LifecycleDelegate.java +33 -9
- package/android/src/main/java/com/navigation/androidx/PresentationDelegate.java +5 -107
- package/android/src/main/java/com/navigation/androidx/StackDelegate.java +37 -10
- package/android/src/main/java/com/navigation/androidx/StackFragment.java +82 -19
- package/android/src/main/java/com/navigation/androidx/Style.java +8 -4
- package/android/src/main/java/com/navigation/androidx/SystemUI.java +17 -5
- package/android/src/main/java/com/navigation/androidx/TabBar.java +69 -29
- package/android/src/main/java/com/navigation/androidx/TabBarFragment.java +48 -11
- package/android/src/main/java/com/navigation/androidx/TabBarItem.java +1 -2
- package/android/src/main/java/com/navigation/androidx/TabView.java +20 -10
- package/android/src/main/java/com/reactnative/hybridnavigation/Constants.java +1 -0
- package/android/src/main/java/com/reactnative/hybridnavigation/Garden.java +19 -15
- package/android/src/main/java/com/reactnative/hybridnavigation/GlobalStyle.java +10 -48
- package/android/src/main/java/com/reactnative/hybridnavigation/HBDRootView.java +22 -23
- package/android/src/main/java/com/reactnative/hybridnavigation/HybridFragment.java +54 -22
- package/android/src/main/java/com/reactnative/hybridnavigation/NativeEvent.java +4 -2
- package/android/src/main/java/com/reactnative/hybridnavigation/NativeNavigation.java +35 -64
- package/android/src/main/java/com/reactnative/hybridnavigation/NavigationCommandQueue.java +185 -121
- package/android/src/main/java/com/reactnative/hybridnavigation/Navigator.java +21 -5
- package/android/src/main/java/com/reactnative/hybridnavigation/NavigatorRegistry.java +27 -30
- package/android/src/main/java/com/reactnative/hybridnavigation/OrientationCoordinator.java +41 -4
- package/android/src/main/java/com/reactnative/hybridnavigation/Parameters.java +55 -154
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactAppCompatActivity.java +30 -1
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactAppCompatActivityDelegate.java +12 -37
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactFragment.java +31 -190
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactManager.java +115 -71
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactStackFragment.java +27 -16
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactSurfaceCleanup.java +50 -8
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactTabBarFragment.java +34 -4
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactTabBarProvider.java +39 -10
- package/android/src/main/java/com/reactnative/hybridnavigation/RemovalPlan.java +76 -0
- package/android/src/main/java/com/reactnative/hybridnavigation/SceneLifecycleStateMachine.java +72 -6
- package/android/src/main/java/com/reactnative/hybridnavigation/Utils.java +19 -3
- package/android/src/main/java/com/reactnative/hybridnavigation/navigator/DrawerNavigator.java +11 -5
- package/android/src/main/java/com/reactnative/hybridnavigation/navigator/ScreenNavigator.java +217 -99
- package/android/src/main/java/com/reactnative/hybridnavigation/navigator/StackNavigator.java +122 -59
- package/android/src/main/java/com/reactnative/hybridnavigation/navigator/TabNavigator.java +87 -24
- package/dist/DeepLink.d.ts +3 -1
- package/dist/DeepLink.js +39 -19
- package/dist/NativeNavigation.d.ts +8 -5
- package/dist/Navigation.d.ts +9 -24
- package/dist/Navigation.js +32 -97
- package/dist/NavigationComponentWrap.d.ts +1 -2
- package/dist/NavigationComponentWrap.js +0 -15
- package/dist/Navigator.d.ts +7 -5
- package/dist/Navigator.js +38 -33
- package/dist/Options.d.ts +1 -7
- package/dist/Options.js +1 -2
- package/dist/Route.d.ts +24 -12
- package/dist/handler/DispatchCommandHandler.d.ts +4 -5
- package/dist/handler/DispatchCommandHandler.js +37 -16
- package/dist/handler/LayoutCommandHandler.js +18 -3
- package/dist/handler/LeaveGuardHandler.d.ts +12 -8
- package/dist/handler/LeaveGuardHandler.js +174 -281
- package/dist/handler/LifecycleEventHandler.d.ts +7 -4
- package/dist/handler/LifecycleEventHandler.js +119 -32
- package/dist/handler/ResultEventHandler.d.ts +2 -2
- package/dist/handler/ResultEventHandler.js +72 -36
- package/dist/handler/SceneExitHandler.d.ts +6 -0
- package/dist/handler/SceneExitHandler.js +48 -8
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.js +39 -23
- package/dist/index.d.ts +9 -8
- package/dist/index.js +5 -8
- package/dist/routeGraph.d.ts +5 -0
- package/dist/routeGraph.js +47 -0
- package/dist/router/drawer.d.ts +2 -2
- package/dist/router/drawer.js +19 -9
- package/dist/router/helpers.d.ts +17 -0
- package/dist/router/helpers.js +90 -0
- package/dist/router/index.d.ts +2 -2
- package/dist/router/index.js +169 -97
- package/dist/router/screen.d.ts +2 -2
- package/dist/router/screen.js +16 -7
- package/dist/router/stack.d.ts +2 -2
- package/dist/router/stack.js +24 -49
- package/dist/router/tabs.js +5 -1
- package/dist/store.d.ts +2 -0
- package/dist/store.js +4 -0
- package/ios/HBDGlobalStyle.h +0 -1
- package/ios/HBDGlobalStyle.mm +27 -39
- package/ios/HBDUtils.h +0 -2
- package/ios/HBDUtils.mm +81 -41
- package/ios/Navigator/HBDDrawerNavigator.mm +31 -26
- package/ios/Navigator/HBDNavigatorRegistry.mm +23 -26
- package/ios/Navigator/HBDScreenNavigator.mm +240 -137
- package/ios/Navigator/HBDStackNavigator.mm +147 -97
- package/ios/Navigator/HBDTabNavigator.mm +99 -46
- package/ios/React/HBDNativeEvent.mm +38 -5
- package/ios/React/HBDNativeNavigation.mm +49 -51
- package/ios/React/HBDNavigationCommandQueue.h +55 -0
- package/ios/React/HBDNavigationCommandQueue.mm +341 -0
- package/ios/React/HBDNavigator.h +20 -0
- package/ios/React/HBDOrientationCoordinator.mm +26 -3
- package/ios/React/HBDReactBridgeManager.h +18 -6
- package/ios/React/HBDReactBridgeManager.mm +536 -315
- package/ios/React/HBDSceneLifecycleStateMachine.h +2 -0
- package/ios/React/HBDSceneLifecycleStateMachine.mm +18 -0
- package/ios/View/HBDRootView.h +1 -0
- package/ios/View/HBDRootView.mm +112 -4
- package/ios/View/UIImage+WithBadge.mm +9 -7
- package/ios/ViewController/HBDDrawerController.h +10 -0
- package/ios/ViewController/HBDDrawerController.mm +103 -71
- package/ios/ViewController/HBDNavigationController.mm +166 -58
- package/ios/ViewController/HBDReactViewController.h +0 -4
- package/ios/ViewController/HBDReactViewController.mm +13 -110
- package/ios/ViewController/HBDTabBarController.mm +67 -33
- package/ios/ViewController/HBDViewController.h +6 -0
- package/ios/ViewController/HBDViewController.mm +94 -37
- package/ios/ViewController/UINavigationController+HBD.h +2 -2
- package/ios/ViewController/UINavigationController+HBD.mm +13 -13
- package/ios/ViewController/UIViewController+HBD.h +23 -1
- package/ios/ViewController/UIViewController+HBD.mm +298 -40
- package/package.json +1 -1
- package/src/DeepLink.ts +39 -19
- package/src/NativeNavigation.ts +17 -5
- package/src/Navigation.ts +49 -170
- package/src/NavigationComponentWrap.tsx +1 -16
- package/src/Navigator.ts +50 -52
- package/src/Options.ts +4 -10
- package/src/Route.ts +37 -19
- package/src/handler/DispatchCommandHandler.ts +42 -20
- package/src/handler/LayoutCommandHandler.ts +15 -3
- package/src/handler/LeaveGuardHandler.ts +224 -329
- package/src/handler/LifecycleEventHandler.ts +131 -37
- package/src/handler/ResultEventHandler.ts +71 -37
- package/src/handler/SceneExitHandler.ts +60 -9
- package/src/hooks.ts +54 -26
- package/src/index.ts +77 -8
- package/src/routeGraph.ts +50 -0
- package/src/router/drawer.ts +21 -10
- package/src/router/helpers.ts +113 -0
- package/src/router/index.ts +187 -112
- package/src/router/screen.ts +35 -8
- package/src/router/stack.ts +40 -53
- package/src/router/tabs.ts +5 -1
- package/src/store.ts +5 -0
- package/dist/sceneCoverage.d.ts +0 -2
- package/dist/sceneCoverage.js +0 -25
- package/src/sceneCoverage.ts +0 -30
|
@@ -11,21 +11,15 @@
|
|
|
11
11
|
@interface HBDNavigationController () <UINavigationControllerDelegate, UIGestureRecognizerDelegate>
|
|
12
12
|
|
|
13
13
|
@property(nonatomic, weak) UIViewController *poppingViewController;
|
|
14
|
+
@property(nonatomic, weak) UIViewController *poppingHandledEntry;
|
|
14
15
|
@property(nonatomic, assign) NSInteger poppingRequestCode;
|
|
15
|
-
@property(nonatomic,
|
|
16
|
+
@property(nonatomic, copy, nullable) NSString *poppingCallerSceneId;
|
|
17
|
+
@property(nonatomic, copy) NSArray<UIViewController *> *trackedViewControllers;
|
|
16
18
|
|
|
17
|
-
- (UIGestureRecognizer *)superInteractivePopGestureRecognizer;
|
|
18
|
-
- (void)handleNavigationTransition:(UIScreenEdgePanGestureRecognizer *)pan;
|
|
19
19
|
- (void)hideSystemNavigationBar;
|
|
20
20
|
|
|
21
21
|
@end
|
|
22
22
|
|
|
23
|
-
@protocol HBDNavigationTransitionProtocol <NSObject>
|
|
24
|
-
|
|
25
|
-
- (void)handleNavigationTransition:(UIScreenEdgePanGestureRecognizer *)pan;
|
|
26
|
-
|
|
27
|
-
@end
|
|
28
|
-
|
|
29
23
|
@implementation HBDNavigationController
|
|
30
24
|
|
|
31
25
|
- (void)dealloc {
|
|
@@ -35,18 +29,11 @@
|
|
|
35
29
|
- (instancetype)initWithRootViewController:(UIViewController *)rootViewController {
|
|
36
30
|
if (self = [super initWithNavigationBarClass:nil toolbarClass:nil]) {
|
|
37
31
|
self.viewControllers = @[rootViewController];
|
|
32
|
+
_trackedViewControllers = @[rootViewController];
|
|
38
33
|
}
|
|
39
34
|
return self;
|
|
40
35
|
}
|
|
41
36
|
|
|
42
|
-
- (UIGestureRecognizer *)interactivePopGestureRecognizer {
|
|
43
|
-
return self.navigationPopGestureRecognizer;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
- (UIGestureRecognizer *)superInteractivePopGestureRecognizer {
|
|
47
|
-
return [super interactivePopGestureRecognizer];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
37
|
- (UIViewController *)childViewControllerForStatusBarHidden {
|
|
51
38
|
return self.topViewController;
|
|
52
39
|
}
|
|
@@ -68,11 +55,8 @@
|
|
|
68
55
|
[super viewDidLoad];
|
|
69
56
|
self.definesPresentationContext = NO;
|
|
70
57
|
|
|
71
|
-
self.
|
|
72
|
-
self.
|
|
73
|
-
self.navigationPopGestureRecognizer.delegate = self;
|
|
74
|
-
[self.view addGestureRecognizer:self.navigationPopGestureRecognizer];
|
|
75
|
-
[self superInteractivePopGestureRecognizer].enabled = NO;
|
|
58
|
+
self.interactivePopGestureRecognizer.delegate = self;
|
|
59
|
+
self.interactivePopGestureRecognizer.enabled = self.viewControllers.count > 1;
|
|
76
60
|
|
|
77
61
|
self.delegate = self;
|
|
78
62
|
[self hideSystemNavigationBar];
|
|
@@ -93,35 +77,42 @@
|
|
|
93
77
|
}
|
|
94
78
|
|
|
95
79
|
- (void)setDelegate:(id <UINavigationControllerDelegate>)delegate {
|
|
96
|
-
if (delegate == self || !self.
|
|
80
|
+
if (delegate == self || !self.delegate) {
|
|
97
81
|
[super setDelegate:delegate];
|
|
98
82
|
}
|
|
99
83
|
}
|
|
100
84
|
|
|
101
85
|
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
|
|
86
|
+
if (gestureRecognizer != self.interactivePopGestureRecognizer) {
|
|
87
|
+
return YES;
|
|
88
|
+
}
|
|
102
89
|
if (self.transitionCoordinator) {
|
|
103
90
|
return NO;
|
|
104
91
|
}
|
|
105
92
|
|
|
106
93
|
if (self.viewControllers.count > 1) {
|
|
107
94
|
UIViewController *topVC = self.topViewController;
|
|
108
|
-
|
|
109
|
-
|
|
95
|
+
UIViewController *activeVC = [[HBDReactBridgeManager get] primaryViewControllerInHierarchy:topVC] ?: topVC;
|
|
96
|
+
if ([activeVC isKindOfClass:[HBDViewController class]] &&
|
|
97
|
+
[[HBDOrientationCoordinator shared] resolvedOrientationForViewController:(HBDViewController *)activeVC] == HBDScreenOrientationLandscape) {
|
|
110
98
|
return NO;
|
|
111
99
|
}
|
|
112
|
-
if (topVC.
|
|
113
|
-
|
|
100
|
+
if (!topVC.hbd_backInteractive || !activeVC.hbd_backInteractive) {
|
|
101
|
+
return NO;
|
|
102
|
+
}
|
|
103
|
+
if (activeVC.hbd_interceptBackPop) {
|
|
104
|
+
if ([HBDReactBridgeManager get].isReactModuleRegisterCompleted && activeVC.hbd_sceneId.length > 0) {
|
|
114
105
|
HBDNativeEvent *event = [HBDNativeEvent getInstance];
|
|
115
106
|
if (event) {
|
|
116
107
|
[event emitOnBeforeRemoveRequest:@{
|
|
117
|
-
@"sceneId":
|
|
108
|
+
@"sceneId": activeVC.hbd_sceneId,
|
|
118
109
|
@"action": @"back",
|
|
119
110
|
}];
|
|
120
111
|
}
|
|
121
112
|
}
|
|
122
113
|
return NO;
|
|
123
114
|
}
|
|
124
|
-
return
|
|
115
|
+
return YES;
|
|
125
116
|
}
|
|
126
117
|
return NO;
|
|
127
118
|
}
|
|
@@ -133,10 +124,88 @@
|
|
|
133
124
|
return NO;
|
|
134
125
|
}
|
|
135
126
|
|
|
136
|
-
- (void)
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
127
|
+
- (void)clearPendingPopTracking {
|
|
128
|
+
self.poppingViewController = nil;
|
|
129
|
+
self.poppingHandledEntry = nil;
|
|
130
|
+
self.poppingRequestCode = 0;
|
|
131
|
+
self.poppingCallerSceneId = nil;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
- (void)attachCancelCleanupIfNeededForPoppingController:(UIViewController *)poppingVC {
|
|
135
|
+
id<UIViewControllerTransitionCoordinator> coordinator = self.transitionCoordinator;
|
|
136
|
+
if (!coordinator || !poppingVC) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
__weak HBDNavigationController *weakSelf = self;
|
|
140
|
+
__weak UIViewController *weakPopping = poppingVC;
|
|
141
|
+
[coordinator animateAlongsideTransition:nil completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
|
|
142
|
+
HBDNavigationController *strongSelf = weakSelf;
|
|
143
|
+
if (strongSelf && context.isCancelled && strongSelf.poppingViewController == weakPopping) {
|
|
144
|
+
[strongSelf clearPendingPopTracking];
|
|
145
|
+
}
|
|
146
|
+
}];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
- (BOOL)shouldReconcileImmediatelyWithAnimated:(BOOL)animated {
|
|
150
|
+
return !animated || !self.viewIfLoaded.window;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
- (void)reconcileViewControllersForVisibleController:(nullable UIViewController *)viewController {
|
|
154
|
+
UIViewController *poppingVC = self.poppingViewController;
|
|
155
|
+
UIViewController *handledEntry = self.poppingHandledEntry;
|
|
156
|
+
NSInteger requestCode = self.poppingRequestCode;
|
|
157
|
+
NSString *callerSceneId = self.poppingCallerSceneId;
|
|
158
|
+
[self clearPendingPopTracking];
|
|
159
|
+
|
|
160
|
+
NSArray<UIViewController *> *previous = self.trackedViewControllers;
|
|
161
|
+
NSArray<UIViewController *> *current = [self.viewControllers copy];
|
|
162
|
+
self.trackedViewControllers = current;
|
|
163
|
+
if (self.isViewLoaded) {
|
|
164
|
+
self.interactivePopGestureRecognizer.enabled = current.count > 1;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (poppingVC && poppingVC != viewController && ![current containsObject:poppingVC]) {
|
|
168
|
+
UIViewController *resultCarrier = [UIViewController hbd_resolveResultCarrier:poppingVC];
|
|
169
|
+
UIViewController *callerVC = callerSceneId.length > 0
|
|
170
|
+
? [[HBDReactBridgeManager get] viewControllerBySceneId:callerSceneId]
|
|
171
|
+
: nil;
|
|
172
|
+
UIViewController *recipient = callerVC ?: viewController;
|
|
173
|
+
[recipient hbd_didReceiveResultCode:resultCarrier.hbd_resultCode
|
|
174
|
+
resultData:resultCarrier.hbd_resultData
|
|
175
|
+
requestCode:requestCode];
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
for (UIViewController *vc in previous) {
|
|
179
|
+
if (![current containsObject:vc]) {
|
|
180
|
+
if (vc != handledEntry && vc.hbd_requestCode != 0 && vc.hbd_pushCallerSceneId.length > 0) {
|
|
181
|
+
UIViewController *callerVC = [[HBDReactBridgeManager get] viewControllerBySceneId:vc.hbd_pushCallerSceneId];
|
|
182
|
+
if (callerVC) {
|
|
183
|
+
[callerVC hbd_didReceiveResultCode:HBDResultCancel
|
|
184
|
+
resultData:nil
|
|
185
|
+
requestCode:vc.hbd_requestCode];
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
[vc hbd_markDestroyedRecursively];
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
|
|
194
|
+
[self clearPendingPopTracking];
|
|
195
|
+
[super pushViewController:viewController animated:animated];
|
|
196
|
+
if (self.isViewLoaded) {
|
|
197
|
+
self.interactivePopGestureRecognizer.enabled = self.viewControllers.count > 1;
|
|
198
|
+
}
|
|
199
|
+
if ([self shouldReconcileImmediatelyWithAnimated:animated]) {
|
|
200
|
+
self.trackedViewControllers = [self.viewControllers copy];
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
- (void)setViewControllers:(NSArray<UIViewController *> *)viewControllers animated:(BOOL)animated {
|
|
205
|
+
[self clearPendingPopTracking];
|
|
206
|
+
[super setViewControllers:viewControllers animated:animated];
|
|
207
|
+
if ([self shouldReconcileImmediatelyWithAnimated:animated]) {
|
|
208
|
+
[self reconcileViewControllersForVisibleController:self.topViewController];
|
|
140
209
|
}
|
|
141
210
|
}
|
|
142
211
|
|
|
@@ -147,47 +216,86 @@
|
|
|
147
216
|
|
|
148
217
|
- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
|
|
149
218
|
[self hideSystemNavigationBar];
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
NSInteger requestCode = self.poppingRequestCode;
|
|
153
|
-
if (poppingVC && poppingVC != viewController) {
|
|
154
|
-
[viewController hbd_didReceiveResultCode:poppingVC.hbd_resultCode resultData:poppingVC.hbd_resultData requestCode:requestCode];
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
self.poppingViewController = nil;
|
|
158
|
-
self.poppingRequestCode = 0;
|
|
219
|
+
self.interactivePopGestureRecognizer.enabled = self.viewControllers.count > 1;
|
|
220
|
+
[self reconcileViewControllersForVisibleController:viewController];
|
|
159
221
|
}
|
|
160
222
|
|
|
161
223
|
- (UIViewController *)popViewControllerAnimated:(BOOL)animated {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
224
|
+
NSArray<UIViewController *> *stack = self.viewControllers;
|
|
225
|
+
BOOL shouldTrackPop = stack.count > 1;
|
|
226
|
+
UIViewController *trackedPopping = nil;
|
|
227
|
+
if (shouldTrackPop) {
|
|
228
|
+
trackedPopping = self.topViewController;
|
|
229
|
+
self.poppingViewController = trackedPopping;
|
|
230
|
+
self.poppingHandledEntry = trackedPopping;
|
|
231
|
+
self.poppingRequestCode = trackedPopping.hbd_requestCode;
|
|
232
|
+
self.poppingCallerSceneId = trackedPopping.hbd_pushCallerSceneId;
|
|
165
233
|
}
|
|
166
234
|
|
|
167
|
-
|
|
235
|
+
UIViewController *popped = [super popViewControllerAnimated:animated];
|
|
236
|
+
if (shouldTrackPop) {
|
|
237
|
+
if (!popped) {
|
|
238
|
+
[self clearPendingPopTracking];
|
|
239
|
+
} else if ([self shouldReconcileImmediatelyWithAnimated:animated]) {
|
|
240
|
+
[self reconcileViewControllersForVisibleController:self.topViewController];
|
|
241
|
+
} else {
|
|
242
|
+
[self attachCancelCleanupIfNeededForPoppingController:trackedPopping];
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return popped;
|
|
168
246
|
}
|
|
169
247
|
|
|
170
248
|
- (NSArray<UIViewController *> *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
249
|
+
NSArray<UIViewController *> *stack = self.viewControllers;
|
|
250
|
+
NSUInteger targetIndex = [stack indexOfObject:viewController];
|
|
251
|
+
BOOL shouldTrackPop = targetIndex != NSNotFound && targetIndex + 1 < stack.count;
|
|
252
|
+
UIViewController *trackedPopping = nil;
|
|
253
|
+
if (shouldTrackPop) {
|
|
254
|
+
trackedPopping = self.topViewController;
|
|
255
|
+
UIViewController *pushedFromTarget = stack[targetIndex + 1];
|
|
256
|
+
self.poppingViewController = trackedPopping;
|
|
257
|
+
self.poppingHandledEntry = pushedFromTarget;
|
|
258
|
+
self.poppingRequestCode = pushedFromTarget.hbd_requestCode;
|
|
259
|
+
self.poppingCallerSceneId = pushedFromTarget.hbd_pushCallerSceneId;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
NSArray<UIViewController *> *popped = [super popToViewController:viewController animated:animated];
|
|
263
|
+
if (shouldTrackPop) {
|
|
264
|
+
if (popped.count == 0) {
|
|
265
|
+
[self clearPendingPopTracking];
|
|
266
|
+
} else if ([self shouldReconcileImmediatelyWithAnimated:animated]) {
|
|
267
|
+
[self reconcileViewControllersForVisibleController:self.topViewController];
|
|
176
268
|
} else {
|
|
177
|
-
self
|
|
269
|
+
[self attachCancelCleanupIfNeededForPoppingController:trackedPopping];
|
|
178
270
|
}
|
|
179
271
|
}
|
|
180
|
-
|
|
181
|
-
return [super popToViewController:viewController animated:animated];
|
|
272
|
+
return popped;
|
|
182
273
|
}
|
|
183
274
|
|
|
184
275
|
- (NSArray<UIViewController *> *)popToRootViewControllerAnimated:(BOOL)animated {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
276
|
+
NSArray<UIViewController *> *stack = self.viewControllers;
|
|
277
|
+
BOOL shouldTrackPop = stack.count > 1;
|
|
278
|
+
UIViewController *trackedPopping = nil;
|
|
279
|
+
if (shouldTrackPop) {
|
|
280
|
+
trackedPopping = self.topViewController;
|
|
281
|
+
UIViewController *firstPushed = stack[1];
|
|
282
|
+
self.poppingViewController = trackedPopping;
|
|
283
|
+
self.poppingHandledEntry = firstPushed;
|
|
284
|
+
self.poppingRequestCode = firstPushed.hbd_requestCode;
|
|
285
|
+
self.poppingCallerSceneId = firstPushed.hbd_pushCallerSceneId;
|
|
188
286
|
}
|
|
189
287
|
|
|
190
|
-
|
|
288
|
+
NSArray<UIViewController *> *popped = [super popToRootViewControllerAnimated:animated];
|
|
289
|
+
if (shouldTrackPop) {
|
|
290
|
+
if (popped.count == 0) {
|
|
291
|
+
[self clearPendingPopTracking];
|
|
292
|
+
} else if ([self shouldReconcileImmediatelyWithAnimated:animated]) {
|
|
293
|
+
[self reconcileViewControllersForVisibleController:self.topViewController];
|
|
294
|
+
} else {
|
|
295
|
+
[self attachCancelCleanupIfNeededForPoppingController:trackedPopping];
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return popped;
|
|
191
299
|
}
|
|
192
300
|
|
|
193
301
|
@end
|
|
@@ -6,10 +6,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
6
6
|
|
|
7
7
|
- (void)signalFirstRenderComplete;
|
|
8
8
|
|
|
9
|
-
- (BOOL)shouldPrewarmPush;
|
|
10
|
-
|
|
11
|
-
- (BOOL)prepareForAnimatedPushInView:(UIView *)hostView timeout:(NSTimeInterval)timeout completion:(dispatch_block_t)completion;
|
|
12
|
-
|
|
13
9
|
@end
|
|
14
10
|
|
|
15
11
|
NS_ASSUME_NONNULL_END
|
|
@@ -13,9 +13,6 @@
|
|
|
13
13
|
@interface HBDReactViewController ()
|
|
14
14
|
|
|
15
15
|
@property(nonatomic, strong, readwrite) HBDRootView *rootView;
|
|
16
|
-
@property(nonatomic, copy, nullable) dispatch_block_t pushPrewarmCompletion;
|
|
17
|
-
@property(nonatomic, assign) NSUInteger pushPrewarmGeneration;
|
|
18
|
-
@property(nonatomic, assign) BOOL hostingPrewarmedRoot;
|
|
19
16
|
|
|
20
17
|
@end
|
|
21
18
|
|
|
@@ -31,10 +28,6 @@
|
|
|
31
28
|
}
|
|
32
29
|
|
|
33
30
|
- (void)dealloc {
|
|
34
|
-
if (_hostingPrewarmedRoot) {
|
|
35
|
-
[_rootView removeFromSuperview];
|
|
36
|
-
}
|
|
37
|
-
[[HBDReactBridgeManager get] unregisterPrewarmingViewController:self];
|
|
38
31
|
[[NSNotificationCenter defaultCenter] removeObserver:self name:HBDReactBridgeWillReloadNotification object:nil];
|
|
39
32
|
RCTLogInfo(@"[Navigation] 销毁页面 %@", self.moduleName);
|
|
40
33
|
}
|
|
@@ -46,7 +39,7 @@
|
|
|
46
39
|
__weak HBDReactViewController *weakSelf = self;
|
|
47
40
|
self.lifecycleStateMachine.readyForVisibleCheck = ^BOOL(BOOL flushLayout) {
|
|
48
41
|
HBDReactViewController *controller = weakSelf;
|
|
49
|
-
if (!controller || !controller.isViewLoaded || !controller.view.window) {
|
|
42
|
+
if (!controller || !controller.isViewLoaded || !controller.view.window || [controller hbd_isCoveredByOverContextModal]) {
|
|
50
43
|
return NO;
|
|
51
44
|
}
|
|
52
45
|
if (flushLayout) {
|
|
@@ -55,6 +48,7 @@
|
|
|
55
48
|
[controller.rootView layoutIfNeeded];
|
|
56
49
|
}
|
|
57
50
|
return controller.view.window != nil &&
|
|
51
|
+
![controller hbd_isCoveredByOverContextModal] &&
|
|
58
52
|
controller.view.bounds.size.width > 0 &&
|
|
59
53
|
controller.view.bounds.size.height > 0;
|
|
60
54
|
};
|
|
@@ -67,10 +61,17 @@
|
|
|
67
61
|
}
|
|
68
62
|
|
|
69
63
|
- (void)handleReload {
|
|
70
|
-
[
|
|
64
|
+
if ([HBDReactBridgeManager get].hasRootLayout) {
|
|
65
|
+
[self.rootView stopSurface];
|
|
66
|
+
}
|
|
71
67
|
[self.lifecycleStateMachine handleReload];
|
|
72
68
|
}
|
|
73
69
|
|
|
70
|
+
- (void)markSceneDestroyed {
|
|
71
|
+
[self.rootView stopSurface];
|
|
72
|
+
[super markSceneDestroyed];
|
|
73
|
+
}
|
|
74
|
+
|
|
74
75
|
- (void)loadView {
|
|
75
76
|
RCTHost *rctHost = [HBDReactBridgeManager get].rctHost;
|
|
76
77
|
RCTFabricSurface *surface = [rctHost createSurfaceWithModuleName:self.moduleName initialProperties:[self initialPropertiesForSurface]];
|
|
@@ -86,21 +87,6 @@
|
|
|
86
87
|
RCTLogInfo(@"[Navigation] 加载页面 %@", self.moduleName);
|
|
87
88
|
}
|
|
88
89
|
|
|
89
|
-
- (void)viewIsAppearing:(BOOL)animated {
|
|
90
|
-
[super viewIsAppearing:animated];
|
|
91
|
-
[self restorePrewarmedRoot];
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
- (void)restorePrewarmedRoot {
|
|
95
|
-
if (!self.hostingPrewarmedRoot) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
self.hostingPrewarmedRoot = NO;
|
|
99
|
-
[self.view addSubview:self.rootView];
|
|
100
|
-
self.rootView.frame = self.view.bounds;
|
|
101
|
-
self.rootView.hidden = NO;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
90
|
- (void)viewDidLoad {
|
|
105
91
|
[super viewDidLoad];
|
|
106
92
|
[self syncRootViewBackgroundColor];
|
|
@@ -174,7 +160,7 @@
|
|
|
174
160
|
}
|
|
175
161
|
|
|
176
162
|
- (BOOL)canUseCurrentWindowGeometry {
|
|
177
|
-
// Tab 根页与 Drawer
|
|
163
|
+
// Tab 根页与 Drawer 侧栏容器不按全屏窗口几何注入首帧安全区,避免与 TabBar / 非全屏尺寸产生首帧偏差。
|
|
178
164
|
if (self.tabBarController != nil || self.options[@"tabItem"] != nil || [self isInsideDrawerMenu]) {
|
|
179
165
|
return NO;
|
|
180
166
|
}
|
|
@@ -201,7 +187,7 @@
|
|
|
201
187
|
return NO;
|
|
202
188
|
}
|
|
203
189
|
BOOL currentStatusHidden = windowScene.statusBarManager.statusBarHidden;
|
|
204
|
-
BOOL inheritsStatusBar = (self
|
|
190
|
+
BOOL inheritsStatusBar = ([[self hbd_mode] isEqualToString:@"modal"] &&
|
|
205
191
|
self.options[@"statusBarHidden"] == nil);
|
|
206
192
|
if (!inheritsStatusBar && currentStatusHidden != [self prefersStatusBarHidden]) {
|
|
207
193
|
return NO;
|
|
@@ -247,92 +233,9 @@
|
|
|
247
233
|
}
|
|
248
234
|
}
|
|
249
235
|
|
|
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
|
-
|
|
258
|
-
- (BOOL)prepareForAnimatedPushInView:(UIView *)hostView timeout:(NSTimeInterval)timeout completion:(dispatch_block_t)completion {
|
|
259
|
-
if (![self shouldPrewarmPush] || !completion || !hostView.window || CGRectIsEmpty(hostView.bounds) || ![self canUseCurrentWindowGeometry]) {
|
|
260
|
-
return NO;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
self.pushPrewarmGeneration += 1;
|
|
264
|
-
NSUInteger generation = self.pushPrewarmGeneration;
|
|
265
|
-
self.pushPrewarmCompletion = [completion copy];
|
|
266
|
-
|
|
267
|
-
[[HBDReactBridgeManager get] registerPrewarmingViewController:self];
|
|
268
|
-
|
|
269
|
-
// Keep UIKit's window geometry available to Fabric descendants during prewarm.
|
|
270
|
-
// The controller itself enters the hierarchy only when UIKit performs the push.
|
|
271
|
-
[self loadViewIfNeeded];
|
|
272
|
-
self.hostingPrewarmedRoot = YES;
|
|
273
|
-
self.rootView.hidden = YES;
|
|
274
|
-
[hostView insertSubview:self.rootView atIndex:0];
|
|
275
|
-
[self updateReactViewFrame];
|
|
276
|
-
[self.view layoutIfNeeded];
|
|
277
|
-
[self.rootView layoutIfNeeded];
|
|
278
|
-
|
|
279
|
-
if (self.lifecycleStateMachine.isFirstRendered) {
|
|
280
|
-
__weak HBDReactViewController *weakSelf = self;
|
|
281
|
-
dispatch_async(dispatch_get_main_queue(), ^{
|
|
282
|
-
HBDReactViewController *strongSelf = weakSelf;
|
|
283
|
-
if (strongSelf && strongSelf.pushPrewarmGeneration == generation) {
|
|
284
|
-
[strongSelf finishPushPrewarmWait];
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
return YES;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
NSTimeInterval safeTimeout = timeout > 0 ? timeout : 0.18;
|
|
291
|
-
__weak HBDReactViewController *weakSelf = self;
|
|
292
|
-
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(safeTimeout * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
293
|
-
HBDReactViewController *strongSelf = weakSelf;
|
|
294
|
-
if (strongSelf && strongSelf.pushPrewarmGeneration == generation) {
|
|
295
|
-
[strongSelf finishPushPrewarmWait];
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
return YES;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
- (void)finishPushPrewarmWait {
|
|
302
|
-
dispatch_block_t completion = self.pushPrewarmCompletion;
|
|
303
|
-
if (!completion) {
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
self.pushPrewarmCompletion = nil;
|
|
307
|
-
self.pushPrewarmGeneration += 1;
|
|
308
|
-
[[HBDReactBridgeManager get] unregisterPrewarmingViewController:self];
|
|
309
|
-
if (self.isViewLoaded && self.rootView) {
|
|
310
|
-
[self.view layoutIfNeeded];
|
|
311
|
-
[self.rootView layoutIfNeeded];
|
|
312
|
-
}
|
|
313
|
-
completion();
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
- (void)cancelPushPrewarm {
|
|
317
|
-
[self restorePrewarmedRoot];
|
|
318
|
-
self.pushPrewarmCompletion = nil;
|
|
319
|
-
self.pushPrewarmGeneration += 1;
|
|
320
|
-
[[HBDReactBridgeManager get] unregisterPrewarmingViewController:self];
|
|
321
|
-
}
|
|
322
|
-
|
|
323
236
|
- (void)signalFirstRenderComplete {
|
|
324
237
|
[self.lifecycleStateMachine markFirstRenderComplete];
|
|
325
|
-
|
|
326
|
-
NSUInteger generation = self.pushPrewarmGeneration;
|
|
327
|
-
__weak HBDReactViewController *weakSelf = self;
|
|
328
|
-
// 等待当前主队列上的 Fabric 挂载与 HBDRootView surfaceView 挂载完成,再启动 push 动画。
|
|
329
|
-
dispatch_async(dispatch_get_main_queue(), ^{
|
|
330
|
-
HBDReactViewController *strongSelf = weakSelf;
|
|
331
|
-
if (strongSelf && strongSelf.pushPrewarmGeneration == generation) {
|
|
332
|
-
[strongSelf finishPushPrewarmWait];
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
}
|
|
238
|
+
[[HBDReactBridgeManager get] markViewHierarchyReadyIfManagedNativeRootExists];
|
|
336
239
|
}
|
|
337
240
|
|
|
338
241
|
- (void)updateOptions:(NSDictionary *)options {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
#import "HBDFadeAnimation.h"
|
|
4
4
|
#import "HBDGlobalStyle.h"
|
|
5
|
+
#import "HBDReactBridgeManager.h"
|
|
5
6
|
#import "HBDReactViewController.h"
|
|
6
7
|
#import "HBDUtils.h"
|
|
7
8
|
#import "UIViewController+HBD.h"
|
|
@@ -55,10 +56,22 @@
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
- (void)setTabItem:(NSArray<NSDictionary *> *)options {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
if (![options isKindOfClass:[NSArray class]]) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
for (id rawOption in options) {
|
|
63
|
+
if (![rawOption isKindOfClass:[NSDictionary class]]) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
NSDictionary *option = (NSDictionary *)rawOption;
|
|
67
|
+
NSUInteger index = NSNotFound;
|
|
68
|
+
if ([option[@"index"] isKindOfClass:NSNumber.class]) {
|
|
69
|
+
NSInteger signedIndex = [option[@"index"] integerValue];
|
|
70
|
+
index = signedIndex >= 0 ? (NSUInteger)signedIndex : NSNotFound;
|
|
71
|
+
} else if ([option[@"key"] isKindOfClass:NSString.class]) {
|
|
72
|
+
index = [[self tabKeys] indexOfObject:option[@"key"]];
|
|
73
|
+
}
|
|
74
|
+
if (index == NSNotFound || index >= self.viewControllers.count) {
|
|
62
75
|
continue;
|
|
63
76
|
}
|
|
64
77
|
UIViewController *tab = self.viewControllers[index];
|
|
@@ -79,60 +92,81 @@
|
|
|
79
92
|
}
|
|
80
93
|
|
|
81
94
|
- (void)updateTabBar:(NSDictionary *)options {
|
|
95
|
+
if (![options isKindOfClass:[NSDictionary class]]) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
82
98
|
UITabBar *tabBar = self.tabBar;
|
|
83
|
-
|
|
99
|
+
UITabBarAppearance *standardAppearance = [tabBar.standardAppearance copy] ?: [UITabBarAppearance new];
|
|
100
|
+
UITabBarAppearance *scrollEdgeAppearance = [tabBar.scrollEdgeAppearance copy] ?: [standardAppearance copy];
|
|
101
|
+
|
|
102
|
+
NSString *tabBarBackgroundColor = [options[@"tabBarBackgroundColor"] isKindOfClass:[NSString class]] ? options[@"tabBarBackgroundColor"] : nil;
|
|
84
103
|
if (tabBarBackgroundColor) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
104
|
+
UIColor *bgColor = [HBDUtils colorWithHexString:tabBarBackgroundColor];
|
|
105
|
+
if (bgColor) {
|
|
106
|
+
if (@available(iOS 26.0, *)) {
|
|
107
|
+
//
|
|
108
|
+
} else {
|
|
109
|
+
UIImage *bgImage = [HBDUtils imageWithColor:bgColor];
|
|
110
|
+
standardAppearance.backgroundImage = bgImage;
|
|
111
|
+
scrollEdgeAppearance.backgroundImage = bgImage;
|
|
112
|
+
}
|
|
90
113
|
}
|
|
91
114
|
}
|
|
92
115
|
|
|
93
|
-
NSDictionary *tabBarShadowImage = options[@"tabBarShadowImage"];
|
|
94
|
-
if (
|
|
116
|
+
NSDictionary *tabBarShadowImage = [options[@"tabBarShadowImage"] isKindOfClass:[NSDictionary class]] ? options[@"tabBarShadowImage"] : nil;
|
|
117
|
+
if (tabBarShadowImage) {
|
|
95
118
|
UIImage *image = [UIImage new];
|
|
96
|
-
NSDictionary *imageItem = tabBarShadowImage[@"image"];
|
|
97
|
-
NSString *color = tabBarShadowImage[@"color"];
|
|
119
|
+
NSDictionary *imageItem = [tabBarShadowImage[@"image"] isKindOfClass:[NSDictionary class]] ? tabBarShadowImage[@"image"] : nil;
|
|
120
|
+
NSString *color = [tabBarShadowImage[@"color"] isKindOfClass:[NSString class]] ? tabBarShadowImage[@"color"] : nil;
|
|
98
121
|
if (imageItem) {
|
|
99
|
-
image = [HBDUtils UIImage:imageItem];
|
|
122
|
+
image = [HBDUtils UIImage:imageItem] ?: [UIImage new];
|
|
100
123
|
} else if (color) {
|
|
101
|
-
|
|
124
|
+
UIColor *parsed = [HBDUtils colorWithHexString:color];
|
|
125
|
+
if (parsed) {
|
|
126
|
+
image = [HBDUtils imageWithColor:parsed];
|
|
127
|
+
}
|
|
102
128
|
}
|
|
129
|
+
standardAppearance.shadowImage = image;
|
|
130
|
+
scrollEdgeAppearance.shadowImage = image;
|
|
103
131
|
tabBar.shadowImage = image;
|
|
104
132
|
}
|
|
105
133
|
|
|
106
|
-
NSString *tabBarItemSelectedColor = options[@"tabBarItemSelectedColor"];
|
|
107
|
-
NSString *tabBarItemNormalColor = options[@"tabBarItemNormalColor"];
|
|
134
|
+
NSString *tabBarItemSelectedColor = [options[@"tabBarItemSelectedColor"] isKindOfClass:[NSString class]] ? options[@"tabBarItemSelectedColor"] : nil;
|
|
135
|
+
NSString *tabBarItemNormalColor = [options[@"tabBarItemNormalColor"] isKindOfClass:[NSString class]] ? options[@"tabBarItemNormalColor"] : nil;
|
|
108
136
|
|
|
109
|
-
if (tabBarItemSelectedColor) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
137
|
+
if (tabBarItemSelectedColor || tabBarItemNormalColor) {
|
|
138
|
+
UITabBarItemAppearance *existingItem = standardAppearance.stackedLayoutAppearance;
|
|
139
|
+
HBDGlobalStyle *style = [self hbd_globalStyle];
|
|
140
|
+
UIColor *parsedNormal = tabBarItemNormalColor ? [HBDUtils colorWithHexString:tabBarItemNormalColor] : nil;
|
|
141
|
+
UIColor *parsedSelected = tabBarItemSelectedColor ? [HBDUtils colorWithHexString:tabBarItemSelectedColor] : nil;
|
|
142
|
+
UIColor *normalColor = parsedNormal ?: existingItem.normal.iconColor ?: style.tabBarItemNormalColor;
|
|
143
|
+
UIColor *selectedColor = parsedSelected ?: existingItem.selected.iconColor ?: style.tabBarItemSelectedColor;
|
|
113
144
|
UITabBarItemAppearance *tabBarItem = [UITabBarItemAppearance new];
|
|
114
145
|
tabBarItem.normal.titleTextAttributes = @{
|
|
115
|
-
NSForegroundColorAttributeName:
|
|
146
|
+
NSForegroundColorAttributeName: normalColor,
|
|
116
147
|
};
|
|
117
|
-
tabBarItem.normal.iconColor =
|
|
148
|
+
tabBarItem.normal.iconColor = normalColor;
|
|
118
149
|
tabBarItem.selected.titleTextAttributes = @{
|
|
119
|
-
NSForegroundColorAttributeName:
|
|
150
|
+
NSForegroundColorAttributeName: selectedColor,
|
|
120
151
|
};
|
|
121
|
-
tabBarItem.selected.iconColor =
|
|
122
|
-
|
|
123
|
-
|
|
152
|
+
tabBarItem.selected.iconColor = selectedColor;
|
|
153
|
+
standardAppearance.stackedLayoutAppearance = tabBarItem;
|
|
154
|
+
standardAppearance.inlineLayoutAppearance = tabBarItem;
|
|
155
|
+
standardAppearance.compactInlineLayoutAppearance = tabBarItem;
|
|
156
|
+
scrollEdgeAppearance.stackedLayoutAppearance = tabBarItem;
|
|
157
|
+
scrollEdgeAppearance.inlineLayoutAppearance = tabBarItem;
|
|
158
|
+
scrollEdgeAppearance.compactInlineLayoutAppearance = tabBarItem;
|
|
124
159
|
}
|
|
125
160
|
|
|
126
|
-
|
|
161
|
+
tabBar.standardAppearance = standardAppearance;
|
|
162
|
+
tabBar.scrollEdgeAppearance = scrollEdgeAppearance;
|
|
163
|
+
|
|
164
|
+
for (UIViewController *tab in self.viewControllers) {
|
|
127
165
|
HBDViewController *hbdvc = [self tabViewController:tab];
|
|
128
166
|
[hbdvc applyTabBarOptions:hbdvc.options];
|
|
129
167
|
}
|
|
130
168
|
}
|
|
131
169
|
|
|
132
|
-
- (void)hbd_didReceiveResultCode:(NSInteger)resultCode resultData:(NSDictionary *)data requestCode:(NSInteger)requestCode {
|
|
133
|
-
[super hbd_didReceiveResultCode:resultCode resultData:data requestCode:requestCode];
|
|
134
|
-
}
|
|
135
|
-
|
|
136
170
|
- (void)setSelectedIndex:(NSUInteger)selectedIndex {
|
|
137
171
|
if (selectedIndex < self.viewControllers.count) {
|
|
138
172
|
[self setSelectedViewController:self.viewControllers[selectedIndex]];
|
|
@@ -21,8 +21,14 @@
|
|
|
21
21
|
|
|
22
22
|
- (void)sceneLifecycleDidChangeFromState:(HBDSceneLifecycleState)prevState toState:(HBDSceneLifecycleState)newState;
|
|
23
23
|
|
|
24
|
+
- (void)syncPendingVisibleEmissionIfNeeded;
|
|
25
|
+
|
|
26
|
+
- (void)markSceneDestroyed;
|
|
27
|
+
|
|
24
28
|
- (void)updateOptions:(NSDictionary *)options;
|
|
25
29
|
|
|
30
|
+
- (void)syncModalStatusBarCapture;
|
|
31
|
+
|
|
26
32
|
- (void)applyTabBarOptions:(NSDictionary *)options;
|
|
27
33
|
|
|
28
34
|
- (void)updateTabBarItem:(NSDictionary *)options;
|