hybrid-navigation 2.7.5 → 2.7.8
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 +24 -0
- package/android/build.gradle +1 -1
- package/ios/HybridNavigation/Bridge/HBDEventEmitter.h +16 -16
- package/ios/HybridNavigation/Bridge/HBDEventEmitter.m +33 -33
- package/ios/HybridNavigation/Bridge/HBDGardenModule.m +43 -25
- package/ios/HybridNavigation/Bridge/HBDNavigationModule.m +83 -58
- package/ios/HybridNavigation/Bridge/HBDReactBridgeManager.h +3 -3
- package/ios/HybridNavigation/Bridge/HBDReactBridgeManager.m +57 -61
- package/ios/HybridNavigation/GlobalStyle.h +7 -7
- package/ios/HybridNavigation/GlobalStyle.m +86 -86
- package/ios/HybridNavigation/HBDGarden.m +28 -28
- package/ios/HybridNavigation/HBDUtils.h +4 -4
- package/ios/HybridNavigation/HBDUtils.m +43 -49
- package/ios/HybridNavigation/Navigator/HBDDrawerNavigator.m +24 -24
- package/ios/HybridNavigation/Navigator/HBDNavigator.h +2 -2
- package/ios/HybridNavigation/Navigator/HBDNavigatorRegistry.h +4 -4
- package/ios/HybridNavigation/Navigator/HBDNavigatorRegistry.m +19 -20
- package/ios/HybridNavigation/Navigator/HBDScreenNavigator.m +24 -26
- package/ios/HybridNavigation/Navigator/HBDStackNavigator.m +31 -30
- package/ios/HybridNavigation/Navigator/HBDTabNavigator.m +54 -56
- package/ios/HybridNavigation/View/HBDBarButtonItem.h +1 -1
- package/ios/HybridNavigation/View/HBDBarButtonItem.m +5 -5
- package/ios/HybridNavigation/View/HBDNavigationBar.h +4 -4
- package/ios/HybridNavigation/View/HBDNavigationBar.m +19 -20
- package/ios/HybridNavigation/View/HBDReactTabBar.m +3 -3
- package/ios/HybridNavigation/View/HBDRootView.m +3 -3
- package/ios/HybridNavigation/View/HBDTitleView.m +7 -7
- package/ios/HybridNavigation/View/UITabBar+Badge.h +1 -0
- package/ios/HybridNavigation/View/UITabBar+Badge.m +6 -6
- package/ios/HybridNavigation/ViewController/HBDDrawerController.h +8 -5
- package/ios/HybridNavigation/ViewController/HBDDrawerController.m +39 -38
- package/ios/HybridNavigation/ViewController/HBDModalViewController.h +2 -2
- package/ios/HybridNavigation/ViewController/HBDModalViewController.m +45 -44
- package/ios/HybridNavigation/ViewController/HBDNavigationController.h +1 -1
- package/ios/HybridNavigation/ViewController/HBDNavigationController.m +111 -113
- package/ios/HybridNavigation/ViewController/HBDPopAnimation.m +4 -4
- package/ios/HybridNavigation/ViewController/HBDPushAnimation.m +4 -4
- package/ios/HybridNavigation/ViewController/HBDReactViewController.m +24 -26
- package/ios/HybridNavigation/ViewController/HBDTabBarController.h +1 -1
- package/ios/HybridNavigation/ViewController/HBDTabBarController.m +25 -26
- package/ios/HybridNavigation/ViewController/HBDViewController.m +31 -32
- package/ios/HybridNavigation/ViewController/UINavigationController+HBD.m +5 -4
- package/ios/HybridNavigation/ViewController/UIViewController+HBD.h +20 -19
- package/ios/HybridNavigation/ViewController/UIViewController+HBD.m +35 -36
- package/lib/DeepLink.js +5 -5
- package/lib/hooks.d.ts +1 -1
- package/lib/hooks.js +4 -7
- package/package.json +1 -1
|
@@ -11,10 +11,8 @@
|
|
|
11
11
|
#import "HBDTitleView.h"
|
|
12
12
|
#import "HBDRootView.h"
|
|
13
13
|
#import "HBDEventEmitter.h"
|
|
14
|
-
#import "HBDUtils.h"
|
|
15
14
|
|
|
16
15
|
#import <React/RCTConvert.h>
|
|
17
|
-
#import <React/RCTLog.h>
|
|
18
16
|
|
|
19
17
|
@interface HBDReactViewController ()
|
|
20
18
|
|
|
@@ -80,7 +78,7 @@
|
|
|
80
78
|
} else {
|
|
81
79
|
props = [@{} mutableCopy];
|
|
82
80
|
}
|
|
83
|
-
[
|
|
81
|
+
props[@"sceneId"] = self.sceneId;
|
|
84
82
|
return props;
|
|
85
83
|
}
|
|
86
84
|
|
|
@@ -94,15 +92,15 @@
|
|
|
94
92
|
- (void)viewWillAppear:(BOOL)animated {
|
|
95
93
|
[super viewWillAppear:animated];
|
|
96
94
|
self.automaticallyAdjustsScrollViewInsets = NO;
|
|
97
|
-
id<UIViewControllerTransitionCoordinator> coordinator = self.transitionCoordinator;
|
|
95
|
+
id <UIViewControllerTransitionCoordinator> coordinator = self.transitionCoordinator;
|
|
98
96
|
if (coordinator && !coordinator.interactive) {
|
|
99
97
|
if (!self.viewAppeared) {
|
|
100
98
|
self.viewAppeared = YES;
|
|
101
99
|
if (self.firstRenderCompleted) {
|
|
102
100
|
[HBDEventEmitter sendEvent:EVENT_NAVIGATION data:@{
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
KEY_SCENE_ID: self.sceneId,
|
|
102
|
+
KEY_ON: ON_COMPONENT_APPEAR
|
|
103
|
+
}];
|
|
106
104
|
}
|
|
107
105
|
}
|
|
108
106
|
}
|
|
@@ -114,24 +112,24 @@
|
|
|
114
112
|
self.viewAppeared = YES;
|
|
115
113
|
if (self.firstRenderCompleted) {
|
|
116
114
|
[HBDEventEmitter sendEvent:EVENT_NAVIGATION data:@{
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
KEY_SCENE_ID: self.sceneId,
|
|
116
|
+
KEY_ON: ON_COMPONENT_APPEAR
|
|
117
|
+
}];
|
|
120
118
|
}
|
|
121
119
|
}
|
|
122
120
|
}
|
|
123
121
|
|
|
124
122
|
- (void)viewWillDisappear:(BOOL)animated {
|
|
125
123
|
[super viewWillDisappear:animated];
|
|
126
|
-
id<UIViewControllerTransitionCoordinator> coordinator = self.transitionCoordinator;
|
|
124
|
+
id <UIViewControllerTransitionCoordinator> coordinator = self.transitionCoordinator;
|
|
127
125
|
if (coordinator && !coordinator.interactive) {
|
|
128
126
|
if (self.viewAppeared) {
|
|
129
127
|
self.viewAppeared = NO;
|
|
130
128
|
if (self.firstRenderCompleted) {
|
|
131
129
|
[HBDEventEmitter sendEvent:EVENT_NAVIGATION data:@{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
130
|
+
KEY_SCENE_ID: self.sceneId,
|
|
131
|
+
KEY_ON: ON_COMPONENT_DISAPPEAR
|
|
132
|
+
}];
|
|
135
133
|
}
|
|
136
134
|
}
|
|
137
135
|
}
|
|
@@ -143,9 +141,9 @@
|
|
|
143
141
|
self.viewAppeared = NO;
|
|
144
142
|
if (self.firstRenderCompleted) {
|
|
145
143
|
[HBDEventEmitter sendEvent:EVENT_NAVIGATION data:@{
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
144
|
+
KEY_SCENE_ID: self.sceneId,
|
|
145
|
+
KEY_ON: ON_COMPONENT_DISAPPEAR
|
|
146
|
+
}];
|
|
149
147
|
}
|
|
150
148
|
}
|
|
151
149
|
}
|
|
@@ -157,21 +155,21 @@
|
|
|
157
155
|
self.firstRenderCompleted = YES;
|
|
158
156
|
if (self.viewAppeared) {
|
|
159
157
|
[HBDEventEmitter sendEvent:EVENT_NAVIGATION data:@{
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
KEY_SCENE_ID: self.sceneId,
|
|
159
|
+
KEY_ON: ON_COMPONENT_APPEAR
|
|
160
|
+
}];
|
|
163
161
|
}
|
|
164
162
|
}
|
|
165
163
|
|
|
166
164
|
- (void)didReceiveResultCode:(NSInteger)resultCode resultData:(NSDictionary *)data requestCode:(NSInteger)requestCode {
|
|
167
165
|
[super didReceiveResultCode:resultCode resultData:data requestCode:requestCode];
|
|
168
166
|
[HBDEventEmitter sendEvent:EVENT_NAVIGATION data:@{
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
167
|
+
KEY_ON: ON_COMPONENT_RESULT,
|
|
168
|
+
KEY_REQUEST_CODE: @(requestCode),
|
|
169
|
+
KEY_RESULT_CODE: @(resultCode),
|
|
170
|
+
KEY_RESULT_DATA: RCTNullIfNil(data),
|
|
171
|
+
KEY_SCENE_ID: self.sceneId,
|
|
172
|
+
}];
|
|
175
173
|
}
|
|
176
174
|
|
|
177
175
|
|
|
@@ -10,12 +10,10 @@
|
|
|
10
10
|
#import "HBDReactViewController.h"
|
|
11
11
|
#import "HBDReactBridgeManager.h"
|
|
12
12
|
#import "HBDUtils.h"
|
|
13
|
-
#import "UITabBar+Badge.h"
|
|
14
13
|
#import "HBDEventEmitter.h"
|
|
15
14
|
#import "HBDReactTabBar.h"
|
|
16
15
|
#import "HBDRootView.h"
|
|
17
16
|
|
|
18
|
-
#import <React/RCTRootView.h>
|
|
19
17
|
#import <React/RCTRootViewDelegate.h>
|
|
20
18
|
#import <React/RCTLog.h>
|
|
21
19
|
|
|
@@ -68,7 +66,7 @@
|
|
|
68
66
|
props[@"selectedIndex"] = self.tabBarOptions[@"selectedIndex"];
|
|
69
67
|
RCTRootView *rootView = [[HBDRootView alloc] initWithBridge:[HBDReactBridgeManager get].bridge moduleName:moduleName initialProperties:props];
|
|
70
68
|
rootView.backgroundColor = UIColor.clearColor;
|
|
71
|
-
|
|
69
|
+
|
|
72
70
|
BOOL sizeIndeterminate = [self.tabBarOptions[@"sizeIndeterminate"] boolValue];
|
|
73
71
|
if (sizeIndeterminate) {
|
|
74
72
|
rootView.delegate = self;
|
|
@@ -95,7 +93,7 @@
|
|
|
95
93
|
props[@"tabs"] = options[@"tabs"];
|
|
96
94
|
props[@"selectedIndex"] = @(self.selectedIndex);
|
|
97
95
|
props[@"badgeColor"] = options[@"badgeColor"];
|
|
98
|
-
|
|
96
|
+
|
|
99
97
|
NSString *tabBarItemColor = options[@"tabBarItemColor"];
|
|
100
98
|
NSString *tabBarUnselectedItemColor = options[@"tabBarUnselectedItemColor"];
|
|
101
99
|
if (tabBarItemColor) {
|
|
@@ -107,8 +105,9 @@
|
|
|
107
105
|
|
|
108
106
|
- (void)removeTabBarAboriginal {
|
|
109
107
|
NSUInteger count = self.tabBar.subviews.count;
|
|
110
|
-
for (
|
|
111
|
-
|
|
108
|
+
for (NSUInteger i = count; i > 0; i--) {
|
|
109
|
+
NSUInteger index = i - 1;
|
|
110
|
+
UIView *view = self.tabBar.subviews[index];
|
|
112
111
|
NSString *viewName = [[[view classForCoder] description] stringByReplacingOccurrencesOfString:@"_" withString:@""];
|
|
113
112
|
if ([viewName isEqualToString:@"UITabBarButton"]) {
|
|
114
113
|
[view removeFromSuperview];
|
|
@@ -122,17 +121,17 @@
|
|
|
122
121
|
if (self.hasCustomTabBar) {
|
|
123
122
|
[self updateCustomTabItem:option atIndex:index];
|
|
124
123
|
} else {
|
|
125
|
-
UIViewController *tab =
|
|
124
|
+
UIViewController *tab = self.viewControllers[index];
|
|
126
125
|
[tab hbd_updateTabBarItem:option];
|
|
127
126
|
}
|
|
128
127
|
}
|
|
129
|
-
|
|
128
|
+
|
|
130
129
|
if (self.hasCustomTabBar) {
|
|
131
130
|
self.rootView.appProperties = [self props];
|
|
132
131
|
}
|
|
133
132
|
}
|
|
134
133
|
|
|
135
|
-
- (NSMutableDictionary *)tabAtIndex:(
|
|
134
|
+
- (NSMutableDictionary *)tabAtIndex:(NSUInteger)index {
|
|
136
135
|
NSMutableDictionary *options = [self.tabBarOptions mutableCopy];
|
|
137
136
|
NSMutableArray *tabs = [options[@"tabs"] mutableCopy];
|
|
138
137
|
options[@"tabs"] = tabs;
|
|
@@ -144,31 +143,31 @@
|
|
|
144
143
|
|
|
145
144
|
- (void)updateCustomTabItem:(NSDictionary *)option atIndex:(NSUInteger)index {
|
|
146
145
|
NSMutableDictionary *tab = [self tabAtIndex:index];
|
|
147
|
-
|
|
146
|
+
|
|
148
147
|
// title
|
|
149
148
|
NSString *title = option[@"title"];
|
|
150
149
|
if (title != nil) {
|
|
151
150
|
tab[@"title"] = title;
|
|
152
151
|
}
|
|
153
|
-
|
|
152
|
+
|
|
154
153
|
// icon title
|
|
155
154
|
NSDictionary *icon = option[@"icon"];
|
|
156
155
|
if (icon != nil) {
|
|
157
156
|
NSDictionary *selected = icon[@"selected"];
|
|
158
157
|
tab[@"icon"] = [HBDUtils iconUriFromUri:selected[@"uri"]];
|
|
159
|
-
|
|
158
|
+
|
|
160
159
|
NSDictionary *unselected = icon[@"unselected"];
|
|
161
160
|
if (unselected != nil) {
|
|
162
161
|
tab[@"unselectedIcon"] = RCTNullIfNil([HBDUtils iconUriFromUri:unselected[@"uri"]]);
|
|
163
162
|
}
|
|
164
163
|
}
|
|
165
|
-
|
|
164
|
+
|
|
166
165
|
// badge
|
|
167
166
|
NSDictionary *badge = option[@"badge"];
|
|
168
167
|
if (badge != nil) {
|
|
169
168
|
BOOL hidden = badge[@"hidden"] ? [badge[@"hidden"] boolValue] : YES;
|
|
170
169
|
NSString *text = hidden ? nil : (badge[@"text"] ? badge[@"text"] : nil);
|
|
171
|
-
BOOL dot = hidden ?
|
|
170
|
+
BOOL dot = hidden ? NO : (badge[@"dot"] ? [badge[@"dot"] boolValue] : NO);
|
|
172
171
|
tab[@"dot"] = @(dot);
|
|
173
172
|
tab[@"badgeText"] = RCTNullIfNil(text);
|
|
174
173
|
}
|
|
@@ -176,7 +175,7 @@
|
|
|
176
175
|
|
|
177
176
|
- (void)updateTabBar:(NSDictionary *)options {
|
|
178
177
|
UITabBar *tabBar = self.tabBar;
|
|
179
|
-
NSString *tabBarColor = [
|
|
178
|
+
NSString *tabBarColor = options[@"tabBarColor"];
|
|
180
179
|
if (tabBarColor) {
|
|
181
180
|
if (@available(iOS 15.0, *)) {
|
|
182
181
|
[tabBar standardAppearance].backgroundImage = [HBDUtils imageWithColor:[HBDUtils colorWithHexString:tabBarColor]];
|
|
@@ -185,7 +184,7 @@
|
|
|
185
184
|
[tabBar setBackgroundImage:[HBDUtils imageWithColor:[HBDUtils colorWithHexString:tabBarColor]]];
|
|
186
185
|
}
|
|
187
186
|
}
|
|
188
|
-
|
|
187
|
+
|
|
189
188
|
NSDictionary *tabBarShadowImage = options[@"tabBarShadowImage"];
|
|
190
189
|
if (RCTNilIfNull(tabBarShadowImage)) {
|
|
191
190
|
UIImage *image = [UIImage new];
|
|
@@ -198,7 +197,7 @@
|
|
|
198
197
|
}
|
|
199
198
|
tabBar.shadowImage = image;
|
|
200
199
|
}
|
|
201
|
-
|
|
200
|
+
|
|
202
201
|
NSString *tabBarItemColor = options[@"tabBarItemColor"];
|
|
203
202
|
NSString *tabBarUnselectedItemColor = options[@"tabBarUnselectedItemColor"];
|
|
204
203
|
if (tabBarItemColor) {
|
|
@@ -221,12 +220,12 @@
|
|
|
221
220
|
[super didReceiveResultCode:resultCode resultData:data requestCode:requestCode];
|
|
222
221
|
if (self.hasCustomTabBar) {
|
|
223
222
|
[HBDEventEmitter sendEvent:EVENT_NAVIGATION data:@{
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
223
|
+
KEY_ON: ON_COMPONENT_RESULT,
|
|
224
|
+
KEY_REQUEST_CODE: @(requestCode),
|
|
225
|
+
KEY_RESULT_CODE: @(resultCode),
|
|
226
|
+
KEY_RESULT_DATA: RCTNullIfNil(data),
|
|
227
|
+
KEY_SCENE_ID: self.sceneId,
|
|
228
|
+
}];
|
|
230
229
|
}
|
|
231
230
|
}
|
|
232
231
|
|
|
@@ -249,10 +248,10 @@
|
|
|
249
248
|
if ([[HBDReactBridgeManager get] hasRootLayout] && self.intercepted) {
|
|
250
249
|
long from = self.selectedIndex;
|
|
251
250
|
long to = [self.childViewControllers indexOfObject:viewController];
|
|
252
|
-
|
|
251
|
+
|
|
253
252
|
[HBDEventEmitter sendEvent:EVENT_SWITCH_TAB data:@{
|
|
254
|
-
|
|
255
|
-
|
|
253
|
+
KEY_SCENE_ID: self.sceneId,
|
|
254
|
+
KEY_INDEX: [NSString stringWithFormat:@"%ld-%ld", from, to],
|
|
256
255
|
}];
|
|
257
256
|
return NO;
|
|
258
257
|
}
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
#import "HBDViewController.h"
|
|
10
10
|
#import "HBDUtils.h"
|
|
11
|
-
#import "HBDNavigationController.h"
|
|
12
11
|
#import <React/RCTLog.h>
|
|
13
12
|
|
|
14
13
|
@interface HBDViewController ()
|
|
@@ -38,7 +37,7 @@
|
|
|
38
37
|
_options = options;
|
|
39
38
|
_props = props;
|
|
40
39
|
_garden = [[HBDGarden alloc] initWithViewController:self];
|
|
41
|
-
|
|
40
|
+
|
|
42
41
|
[self applyNavigationBarOptions:options];
|
|
43
42
|
[self applyTabBarOptions:options];
|
|
44
43
|
}
|
|
@@ -57,7 +56,7 @@
|
|
|
57
56
|
if (@available(iOS 13.0, *)) {
|
|
58
57
|
return [self hbd_statusBarHidden] && ![HBDUtils isInCall];
|
|
59
58
|
}
|
|
60
|
-
|
|
59
|
+
|
|
61
60
|
if ([HBDUtils isIphoneX]) {
|
|
62
61
|
return [self hbd_statusBarHidden] && ![HBDUtils isInCall];
|
|
63
62
|
} else {
|
|
@@ -130,22 +129,22 @@
|
|
|
130
129
|
self.hbd_barStyle = UIBarStyleBlack;
|
|
131
130
|
}
|
|
132
131
|
}
|
|
133
|
-
|
|
132
|
+
|
|
134
133
|
NSString *topBarTintColor = options[@"topBarTintColor"];
|
|
135
134
|
if (topBarTintColor) {
|
|
136
135
|
self.hbd_tintColor = [HBDUtils colorWithHexString:topBarTintColor];
|
|
137
136
|
}
|
|
138
|
-
|
|
137
|
+
|
|
139
138
|
NSMutableDictionary *titleAttributes = [@{} mutableCopy];
|
|
140
|
-
NSString *titleTextColor = [
|
|
141
|
-
NSNumber *titleTextSize = [
|
|
139
|
+
NSString *titleTextColor = options[@"titleTextColor"];
|
|
140
|
+
NSNumber *titleTextSize = options[@"titleTextSize"];
|
|
142
141
|
if (titleTextColor) {
|
|
143
|
-
[
|
|
142
|
+
titleAttributes[NSForegroundColorAttributeName] = [HBDUtils colorWithHexString:titleTextColor];
|
|
144
143
|
}
|
|
145
144
|
if (titleTextSize) {
|
|
146
|
-
[
|
|
145
|
+
titleAttributes[NSFontAttributeName] = [UIFont systemFontOfSize:[titleTextSize floatValue]];
|
|
147
146
|
}
|
|
148
|
-
|
|
147
|
+
|
|
149
148
|
if (titleAttributes.count > 0) {
|
|
150
149
|
if (self.hbd_titleTextAttributes) {
|
|
151
150
|
NSMutableDictionary *attributes = [self.hbd_titleTextAttributes mutableCopy];
|
|
@@ -155,26 +154,26 @@
|
|
|
155
154
|
self.hbd_titleTextAttributes = titleAttributes;
|
|
156
155
|
}
|
|
157
156
|
}
|
|
158
|
-
|
|
157
|
+
|
|
159
158
|
NSString *topBarColor = options[@"topBarColor"];
|
|
160
159
|
if (topBarColor) {
|
|
161
160
|
self.hbd_barTintColor = [HBDUtils colorWithHexString:topBarColor];
|
|
162
161
|
}
|
|
163
|
-
|
|
162
|
+
|
|
164
163
|
NSNumber *topBarAlpha = options[@"topBarAlpha"];
|
|
165
164
|
if (topBarAlpha) {
|
|
166
165
|
self.hbd_barAlpha = [topBarAlpha floatValue];
|
|
167
166
|
}
|
|
168
|
-
|
|
167
|
+
|
|
169
168
|
NSNumber *topBarHidden = options[@"topBarHidden"];
|
|
170
169
|
if ([topBarHidden boolValue]) {
|
|
171
170
|
self.hbd_barHidden = YES;
|
|
172
171
|
}
|
|
173
|
-
|
|
172
|
+
|
|
174
173
|
if ([HBDGarden globalStyle].isBackTitleHidden) {
|
|
175
174
|
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:NULL];
|
|
176
175
|
}
|
|
177
|
-
|
|
176
|
+
|
|
178
177
|
NSDictionary *backItem = options[@"backItemIOS"];
|
|
179
178
|
if (backItem) {
|
|
180
179
|
NSString *title = backItem[@"title"];
|
|
@@ -186,32 +185,32 @@
|
|
|
186
185
|
}
|
|
187
186
|
self.navigationItem.backBarButtonItem = backButton;
|
|
188
187
|
}
|
|
189
|
-
|
|
188
|
+
|
|
190
189
|
NSNumber *swipeBackEnabled = options[@"swipeBackEnabled"];
|
|
191
190
|
if (swipeBackEnabled) {
|
|
192
191
|
self.hbd_swipeBackEnabled = [swipeBackEnabled boolValue];
|
|
193
192
|
}
|
|
194
|
-
|
|
193
|
+
|
|
195
194
|
NSNumber *extendedLayoutIncludesTopBar = options[@"extendedLayoutIncludesTopBar"];
|
|
196
195
|
if (extendedLayoutIncludesTopBar) {
|
|
197
196
|
self.extendedLayoutIncludesOpaqueBars = [extendedLayoutIncludesTopBar boolValue];
|
|
198
197
|
}
|
|
199
|
-
|
|
198
|
+
|
|
200
199
|
NSNumber *hideShadow = options[@"topBarShadowHidden"];
|
|
201
200
|
if (hideShadow) {
|
|
202
201
|
self.hbd_barShadowHidden = [hideShadow boolValue];
|
|
203
202
|
}
|
|
204
|
-
|
|
203
|
+
|
|
205
204
|
NSNumber *statusBarHidden = options[@"statusBarHidden"];
|
|
206
205
|
if (statusBarHidden) {
|
|
207
206
|
self.hbd_statusBarHidden = [statusBarHidden boolValue];
|
|
208
207
|
}
|
|
209
|
-
|
|
208
|
+
|
|
210
209
|
NSNumber *backInteractive = options[@"backInteractive"];
|
|
211
210
|
if (backInteractive) {
|
|
212
211
|
self.hbd_backInteractive = [backInteractive boolValue];
|
|
213
212
|
}
|
|
214
|
-
|
|
213
|
+
|
|
215
214
|
NSNumber *backButtonHidden = options[@"backButtonHidden"];
|
|
216
215
|
if (backButtonHidden) {
|
|
217
216
|
if ([backButtonHidden boolValue]) {
|
|
@@ -228,7 +227,7 @@
|
|
|
228
227
|
}
|
|
229
228
|
}
|
|
230
229
|
}
|
|
231
|
-
|
|
230
|
+
|
|
232
231
|
NSDictionary *titleItem = options[@"titleItem"];
|
|
233
232
|
if (titleItem) {
|
|
234
233
|
NSString *moduleName = titleItem[@"moduleName"];
|
|
@@ -236,22 +235,22 @@
|
|
|
236
235
|
self.navigationItem.title = titleItem[@"title"];
|
|
237
236
|
}
|
|
238
237
|
}
|
|
239
|
-
|
|
238
|
+
|
|
240
239
|
id rightBarButtonItem = options[@"rightBarButtonItem"];
|
|
241
240
|
if (rightBarButtonItem) {
|
|
242
241
|
[self.garden setRightBarButtonItem:RCTNilIfNull(rightBarButtonItem)];
|
|
243
242
|
}
|
|
244
|
-
|
|
243
|
+
|
|
245
244
|
id leftBarButtonItem = options[@"leftBarButtonItem"];
|
|
246
245
|
if (leftBarButtonItem) {
|
|
247
246
|
[self.garden setLeftBarButtonItem:RCTNilIfNull(leftBarButtonItem)];
|
|
248
247
|
}
|
|
249
|
-
|
|
248
|
+
|
|
250
249
|
NSArray *rightBarButtonItems = options[@"rightBarButtonItems"];
|
|
251
250
|
if (rightBarButtonItems) {
|
|
252
251
|
[self.garden setRightBarButtonItems:rightBarButtonItems];
|
|
253
252
|
}
|
|
254
|
-
|
|
253
|
+
|
|
255
254
|
NSArray *leftBarButtonItems = options[@"leftBarButtonItems"];
|
|
256
255
|
if (leftBarButtonItems) {
|
|
257
256
|
[self.garden setLeftBarButtonItems:leftBarButtonItems];
|
|
@@ -285,24 +284,24 @@
|
|
|
285
284
|
}
|
|
286
285
|
|
|
287
286
|
[self applyNavigationBarOptions:target];
|
|
288
|
-
|
|
287
|
+
|
|
289
288
|
NSString *screenColor = options[@"screenBackgroundColor"];
|
|
290
289
|
if (screenColor && [self isViewLoaded]) {
|
|
291
290
|
self.view.backgroundColor = [HBDUtils colorWithHexString:screenColor];
|
|
292
291
|
}
|
|
293
292
|
|
|
294
|
-
NSNumber *statusBarHidden = [
|
|
293
|
+
NSNumber *statusBarHidden = options[@"statusBarHidden"];
|
|
295
294
|
if (statusBarHidden) {
|
|
296
295
|
[self setNeedsStatusBarAppearanceUpdate];
|
|
297
296
|
}
|
|
298
|
-
|
|
299
|
-
if ([
|
|
297
|
+
|
|
298
|
+
if (options[@"homeIndicatorAutoHiddenIOS"]) {
|
|
300
299
|
if (@available(iOS 11.0, *)) {
|
|
301
300
|
[self setNeedsUpdateOfHomeIndicatorAutoHidden];
|
|
302
301
|
}
|
|
303
302
|
}
|
|
304
303
|
|
|
305
|
-
NSNumber *passThroughTouches = [
|
|
304
|
+
NSNumber *passThroughTouches = options[@"passThroughTouches"];
|
|
306
305
|
if (passThroughTouches) {
|
|
307
306
|
[self.garden setPassThroughTouches:[passThroughTouches boolValue]];
|
|
308
307
|
}
|
|
@@ -315,7 +314,7 @@
|
|
|
315
314
|
- (BOOL)shouldUpdateNavigationBar:(NSDictionary *)options compareTo:(NSDictionary *)previous {
|
|
316
315
|
NSArray *keys = @[@"topBarStyle", @"topBarColor", @"topBarAlpha", @"tintColor", @"topBarShadowHidden"];
|
|
317
316
|
for (NSString *opt in options.allKeys) {
|
|
318
|
-
if ([keys containsObject:opt] && [NSString stringWithFormat:@"%@", previous[opt]] != [NSString stringWithFormat:@"%@",options[opt]]) {
|
|
317
|
+
if ([keys containsObject:opt] && [NSString stringWithFormat:@"%@", previous[opt]] != [NSString stringWithFormat:@"%@", options[opt]]) {
|
|
319
318
|
return YES;
|
|
320
319
|
}
|
|
321
320
|
}
|
|
@@ -16,10 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
- (void)redirectToViewController:(UIViewController *)controller target:(UIViewController *)target animated:(BOOL)animated {
|
|
18
18
|
NSMutableArray *children = [self.childViewControllers mutableCopy];
|
|
19
|
-
|
|
20
|
-
for (
|
|
21
|
-
|
|
22
|
-
[
|
|
19
|
+
NSUInteger count = self.childViewControllers.count;
|
|
20
|
+
for (NSUInteger i = count; i > 0; i--) {
|
|
21
|
+
NSUInteger index = i - 1;
|
|
22
|
+
UIViewController *child = children[index];
|
|
23
|
+
[children removeObjectAtIndex:index];
|
|
23
24
|
if (child == target) {
|
|
24
25
|
break;
|
|
25
26
|
}
|
|
@@ -10,34 +10,35 @@
|
|
|
10
10
|
#import "HBDDrawerController.h"
|
|
11
11
|
|
|
12
12
|
typedef void(^HBDDidShowActionBlock)(void);
|
|
13
|
+
|
|
13
14
|
typedef void(^HBDDidHideActionBlock)(void);
|
|
14
15
|
|
|
15
16
|
@interface UIViewController (HBD)
|
|
16
17
|
|
|
17
|
-
@property
|
|
18
|
-
@property
|
|
19
|
-
@property
|
|
20
|
-
@property
|
|
21
|
-
@property
|
|
22
|
-
@property
|
|
23
|
-
@property
|
|
24
|
-
@property
|
|
25
|
-
@property
|
|
26
|
-
@property
|
|
27
|
-
@property
|
|
28
|
-
|
|
29
|
-
@property
|
|
30
|
-
@property
|
|
31
|
-
@property
|
|
18
|
+
@property(nonatomic, assign) UIBarStyle hbd_barStyle;
|
|
19
|
+
@property(nonatomic, strong) UIColor *hbd_barTintColor;
|
|
20
|
+
@property(nonatomic, strong) UIColor *hbd_tintColor;
|
|
21
|
+
@property(nonatomic, strong) NSDictionary *hbd_titleTextAttributes;
|
|
22
|
+
@property(nonatomic, assign) float hbd_barAlpha;
|
|
23
|
+
@property(nonatomic, assign) BOOL hbd_barHidden;
|
|
24
|
+
@property(nonatomic, assign) BOOL hbd_barShadowHidden;
|
|
25
|
+
@property(nonatomic, assign) BOOL hbd_backInteractive;
|
|
26
|
+
@property(nonatomic, assign) BOOL hbd_swipeBackEnabled;
|
|
27
|
+
@property(nonatomic, assign, readonly) float hbd_barShadowAlpha;
|
|
28
|
+
@property(nonatomic, assign) BOOL hbd_statusBarHidden;
|
|
29
|
+
|
|
30
|
+
@property(nonatomic, assign) BOOL hbd_viewAppeared;
|
|
31
|
+
@property(nonatomic, copy) HBDDidShowActionBlock didShowActionBlock;
|
|
32
|
+
@property(nonatomic, copy) HBDDidHideActionBlock didHideActionBlock;
|
|
32
33
|
|
|
33
34
|
- (void)hbd_setNeedsUpdateNavigationBar;
|
|
34
35
|
|
|
35
|
-
@property
|
|
36
|
+
@property(nonatomic, assign) BOOL hbd_extendedLayoutDidSet;
|
|
36
37
|
|
|
37
38
|
@property(nonatomic, copy, readonly) NSString *sceneId;
|
|
38
|
-
@property
|
|
39
|
-
@property
|
|
40
|
-
@property
|
|
39
|
+
@property(nonatomic, assign) NSInteger resultCode;
|
|
40
|
+
@property(nonatomic, assign) NSInteger requestCode;
|
|
41
|
+
@property(nonatomic, copy) NSDictionary *resultData;
|
|
41
42
|
|
|
42
43
|
- (void)setResultCode:(NSInteger)resultCode resultData:(NSDictionary *)data;
|
|
43
44
|
|