|
@@ -13,9 +13,15 @@
|
13
|
13
|
self.topBarBackgroundColor = [navigationOptions objectForKey:@"topBarBackgroundColor"];
|
14
|
14
|
self.statusBarHidden = [navigationOptions objectForKey:@"statusBarHidden"];
|
15
|
15
|
self.title = [navigationOptions objectForKey:@"title"];
|
|
16
|
+ self.topBarTextColor = [navigationOptions objectForKey:@"topBarTextColor"];
|
16
|
17
|
self.screenBackgroundColor = [navigationOptions objectForKey:@"screenBackgroundColor"];
|
17
|
|
- self.setTabBadge = [navigationOptions objectForKey:@"setTabBadge"];
|
18
|
18
|
self.topBarTextFontFamily = [navigationOptions objectForKey:@"topBarTextFontFamily"];
|
|
19
|
+ self.topBarHidden = [navigationOptions objectForKey:@"topBarHidden"];
|
|
20
|
+ self.topBarHideOnScroll = [navigationOptions objectForKey:@"topBarHideOnScroll"];
|
|
21
|
+ self.topBarButtonColor = [navigationOptions objectForKey:@"topBarButtonColor"];
|
|
22
|
+ self.topBarTranslucent = [navigationOptions objectForKey:@"topBarTranslucent"];
|
|
23
|
+ self.setTabBadge = [navigationOptions objectForKey:@"setTabBadge"];
|
|
24
|
+
|
19
|
25
|
return self;
|
20
|
26
|
}
|
21
|
27
|
|
|
@@ -32,9 +38,11 @@
|
32
|
38
|
} else {
|
33
|
39
|
viewController.navigationController.navigationBar.barTintColor = nil;
|
34
|
40
|
}
|
|
41
|
+
|
35
|
42
|
if (self.title) {
|
36
|
43
|
viewController.navigationItem.title = self.title;
|
37
|
44
|
}
|
|
45
|
+
|
38
|
46
|
if (self.topBarTextColor) {
|
39
|
47
|
UIColor* textColor = [RCTConvert UIColor:self.topBarTextColor];
|
40
|
48
|
NSMutableDictionary* navigationBarTitleTextAttributes = [NSMutableDictionary dictionaryWithDictionary:@{NSForegroundColorAttributeName: textColor}];
|
|
@@ -45,20 +53,52 @@
|
45
|
53
|
} else if (self.topBarTextFontFamily){
|
46
|
54
|
viewController.navigationController.navigationBar.titleTextAttributes = @{NSFontAttributeName: [UIFont fontWithName:self.topBarTextFontFamily size:20]};
|
47
|
55
|
}
|
|
56
|
+
|
48
|
57
|
if (self.screenBackgroundColor) {
|
49
|
58
|
UIColor* screenColor = [RCTConvert UIColor:self.screenBackgroundColor];
|
50
|
59
|
viewController.view.backgroundColor = screenColor;
|
51
|
|
- }
|
|
60
|
+ }
|
|
61
|
+
|
|
62
|
+ if (self.topBarHidden){
|
|
63
|
+ if ([self.topBarHidden boolValue]) {
|
|
64
|
+ [viewController.navigationController setNavigationBarHidden:YES animated:YES];
|
|
65
|
+ } else {
|
|
66
|
+ [viewController.navigationController setNavigationBarHidden:NO animated:YES];
|
|
67
|
+ }
|
|
68
|
+ }
|
|
69
|
+
|
|
70
|
+ if (self.topBarHideOnScroll) {
|
|
71
|
+ BOOL topBarHideOnScrollBool = [self.topBarHideOnScroll boolValue];
|
|
72
|
+ if (topBarHideOnScrollBool) {
|
|
73
|
+ viewController.navigationController.hidesBarsOnSwipe = YES;
|
|
74
|
+ } else {
|
|
75
|
+ viewController.navigationController.hidesBarsOnSwipe = NO;
|
|
76
|
+ }
|
|
77
|
+ }
|
|
78
|
+
|
|
79
|
+ if (self.topBarButtonColor) {
|
|
80
|
+ UIColor* buttonColor = [RCTConvert UIColor:self.topBarButtonColor];
|
|
81
|
+ viewController.navigationController.navigationBar.tintColor = buttonColor;
|
|
82
|
+ } else {
|
|
83
|
+ viewController.navigationController.navigationBar.tintColor = nil;
|
|
84
|
+
|
52
|
85
|
if (self.setTabBadge) {
|
53
|
86
|
NSString *badge = [RCTConvert NSString:self.setTabBadge];
|
54
|
87
|
if (viewController.navigationController) {
|
55
|
88
|
viewController.navigationController.tabBarItem.badgeValue = badge;
|
56
|
89
|
} else {
|
57
|
90
|
viewController.tabBarItem.badgeValue = badge;
|
|
91
|
+ }
|
|
92
|
+
|
|
93
|
+ }
|
|
94
|
+
|
|
95
|
+ if (self.topBarTranslucent) {
|
|
96
|
+ if ([self.topBarTranslucent boolValue]) {
|
|
97
|
+ viewController.navigationController.navigationBar.translucent = YES;
|
|
98
|
+ } else {
|
|
99
|
+ viewController.navigationController.navigationBar.translucent = NO;
|
58
|
100
|
}
|
59
|
101
|
}
|
|
102
|
+ }
|
60
|
103
|
}
|
61
|
|
-
|
62
|
|
-
|
63
|
|
-
|
64
|
104
|
@end
|