Browse Source

Large title options (#3331)

* add addicional options to tabbar

* fix tests
Yogev B 6 years ago
parent
commit
725068d5d4
No account linked to committer's email address

+ 12
- 2
docs/docs/styling.md View File

10
     return {
10
     return {
11
       topBar: {
11
       topBar: {
12
         title: {
12
         title: {
13
-          largeTitle: false,
14
           text: 'My Screen'
13
           text: 'My Screen'
15
         },
14
         },
16
         drawBehind: true,
15
         drawBehind: true,
81
     component: {
80
     component: {
82
       name: 'example.CustomTopBar'
81
       name: 'example.CustomTopBar'
83
     },
82
     },
83
+    largeTitle: {
84
+      visible: true,
85
+      fontSize: 30,
86
+      color: 'red',
87
+      fontFamily: 'Helvetica'
88
+    },
84
     title: {
89
     title: {
85
       text: 'Title',
90
       text: 'Title',
86
       fontSize: 14,
91
       fontSize: 14,
167
     transparent: false,
172
     transparent: false,
168
     noBorder: false,
173
     noBorder: false,
169
     blur: false,
174
     blur: false,
170
-    largeTitle: false,
171
     backButtonImage: require('icon.png'),
175
     backButtonImage: require('icon.png'),
172
     backButtonHidden: false,
176
     backButtonHidden: false,
173
     backButtonTitle: 'Back',
177
     backButtonTitle: 'Back',
174
     hideBackButtonTitle: false,
178
     hideBackButtonTitle: false,
179
+    largeTitle: {
180
+      visible: true,
181
+      fontSize: 30,
182
+      color: 'red',
183
+      fontFamily: 'Helvetica'
184
+    },
175
   },
185
   },
176
   bottomTabs: {
186
   bottomTabs: {
177
     translucent: true,
187
     translucent: true,

+ 10
- 0
lib/ios/RNNLargeTitleOptions.h View File

1
+#import "RNNOptions.h"
2
+#import "RNNComponentOptions.h"
3
+
4
+@interface RNNLargeTitleOptions : RNNOptions
5
+
6
+@property (nonatomic, strong) NSNumber* fontSize;
7
+@property (nonatomic, strong) NSNumber* visible;
8
+@property (nonatomic, strong) NSNumber* color;
9
+@property (nonatomic, strong) NSString* fontFamily;
10
+@end

+ 49
- 0
lib/ios/RNNLargeTitleOptions.m View File

1
+#import "RNNLargeTitleOptions.h"
2
+#import "RNNTitleViewHelper.h"
3
+
4
+
5
+@implementation RNNLargeTitleOptions
6
+
7
+- (void)applyOn:(UIViewController *)viewController {
8
+
9
+	if (@available(iOS 11.0, *)) {
10
+		
11
+		viewController.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
12
+	
13
+		if ([self.visible boolValue]){
14
+			viewController.navigationController.navigationBar.prefersLargeTitles = YES;
15
+			viewController.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAlways;
16
+		} else {
17
+			viewController.navigationController.navigationBar.prefersLargeTitles = NO;
18
+		}
19
+		
20
+		NSDictionary* fontAttributes = [self fontAttributes];
21
+		viewController.navigationController.navigationBar.largeTitleTextAttributes = fontAttributes;
22
+	}
23
+}
24
+
25
+- (NSDictionary *)fontAttributes {
26
+	NSMutableDictionary* navigationBarTitleTextAttributes = [NSMutableDictionary new];
27
+	if (self.fontFamily || self.fontSize || self.color) {
28
+		if (self.color) {
29
+			navigationBarTitleTextAttributes[NSForegroundColorAttributeName] = [RCTConvert UIColor:self.color];
30
+		}
31
+		if (self.fontFamily){
32
+			if (self.fontSize) {
33
+				navigationBarTitleTextAttributes[NSFontAttributeName] = [UIFont fontWithName:self.fontFamily size:[self.fontSize floatValue]];
34
+			} else {
35
+				navigationBarTitleTextAttributes[NSFontAttributeName] = [UIFont fontWithName:self.fontFamily size:20];
36
+			}
37
+		} else if (self.fontSize) {
38
+			navigationBarTitleTextAttributes[NSFontAttributeName] = [UIFont systemFontOfSize:[self.fontSize floatValue]];
39
+		}
40
+	}
41
+	
42
+	return navigationBarTitleTextAttributes;
43
+}
44
+
45
+- (NSNumber *)fontSize {
46
+	return _fontSize ? _fontSize : nil;
47
+}
48
+
49
+@end

+ 1
- 4
lib/ios/RNNTitleOptions.m View File

12
 	NSDictionary* fontAttributes = [self fontAttributes];
12
 	NSDictionary* fontAttributes = [self fontAttributes];
13
 	
13
 	
14
 	viewController.navigationController.navigationBar.titleTextAttributes = fontAttributes;
14
 	viewController.navigationController.navigationBar.titleTextAttributes = fontAttributes;
15
-	if (@available(iOS 11.0, *)){
16
-		viewController.navigationController.navigationBar.largeTitleTextAttributes = fontAttributes;
17
-	}
18
-	
15
+
19
 	if (self.subtitle.text) {
16
 	if (self.subtitle.text) {
20
 		RNNTitleViewHelper* titleViewHelper = [[RNNTitleViewHelper alloc] init:viewController title:self.text subtitle:self.subtitle.text titleImageData:nil isSetSubtitle:NO];
17
 		RNNTitleViewHelper* titleViewHelper = [[RNNTitleViewHelper alloc] init:viewController title:self.text subtitle:self.subtitle.text titleImageData:nil isSetSubtitle:NO];
21
 		[titleViewHelper setup:self];
18
 		[titleViewHelper setup:self];

+ 2
- 1
lib/ios/RNNTopBarOptions.h View File

1
 #import "RNNOptions.h"
1
 #import "RNNOptions.h"
2
+#import "RNNLargeTitleOptions.h"
2
 #import "RNNTitleOptions.h"
3
 #import "RNNTitleOptions.h"
3
 #import "RNNSubtitleOptions.h"
4
 #import "RNNSubtitleOptions.h"
4
 #import "RNNBackgroundOptions.h"
5
 #import "RNNBackgroundOptions.h"
17
 @property (nonatomic, strong) NSNumber* noBorder;
18
 @property (nonatomic, strong) NSNumber* noBorder;
18
 @property (nonatomic, strong) NSNumber* blur;
19
 @property (nonatomic, strong) NSNumber* blur;
19
 @property (nonatomic, strong) NSNumber* animate;
20
 @property (nonatomic, strong) NSNumber* animate;
20
-@property (nonatomic, strong) NSNumber* largeTitle;
21
 @property (nonatomic, strong) NSString* testID;
21
 @property (nonatomic, strong) NSString* testID;
22
+@property (nonatomic, strong) RNNLargeTitleOptions* largeTitle;
22
 @property (nonatomic, strong) RNNTitleOptions* title;
23
 @property (nonatomic, strong) RNNTitleOptions* title;
23
 @property (nonatomic, strong) RNNSubtitleOptions* subtitle;
24
 @property (nonatomic, strong) RNNSubtitleOptions* subtitle;
24
 @property (nonatomic, strong) RNNBackgroundOptions* background;
25
 @property (nonatomic, strong) RNNBackgroundOptions* background;

+ 1
- 11
lib/ios/RNNTopBarOptions.m View File

28
 
28
 
29
 - (void)applyOn:(UIViewController*)viewController {
29
 - (void)applyOn:(UIViewController*)viewController {
30
 	[self.title applyOn:viewController];
30
 	[self.title applyOn:viewController];
31
+	[self.largeTitle applyOn:viewController];
31
 	[self.background applyOn:viewController];
32
 	[self.background applyOn:viewController];
32
 	
33
 	
33
 	if (@available(iOS 11.0, *)) {
34
 	if (@available(iOS 11.0, *)) {
34
-		if (self.largeTitle){
35
-			if ([self.largeTitle boolValue]) {
36
-				viewController.navigationController.navigationBar.prefersLargeTitles = YES;
37
-				viewController.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAlways;
38
-			} else {
39
-				viewController.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
40
-			}
41
-		} else {
42
-			viewController.navigationController.navigationBar.prefersLargeTitles = NO;
43
-			viewController.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
44
-		}
45
 		if ([self.searchBar boolValue] && !viewController.navigationItem.searchController) {
35
 		if ([self.searchBar boolValue] && !viewController.navigationItem.searchController) {
46
 			UISearchController *search = [[UISearchController alloc]initWithSearchResultsController:nil];
36
 			UISearchController *search = [[UISearchController alloc]initWithSearchResultsController:nil];
47
 			search.dimsBackgroundDuringPresentation = NO;
37
 			search.dimsBackgroundDuringPresentation = NO;

+ 8
- 2
lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj View File

61
 		2DCD9196200014A900EDC75D /* RNNBridgeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DCD9194200014A900EDC75D /* RNNBridgeManager.m */; };
61
 		2DCD9196200014A900EDC75D /* RNNBridgeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DCD9194200014A900EDC75D /* RNNBridgeManager.m */; };
62
 		390AD477200F499D00A8250D /* RNNSwizzles.h in Headers */ = {isa = PBXBuildFile; fileRef = 390AD475200F499D00A8250D /* RNNSwizzles.h */; };
62
 		390AD477200F499D00A8250D /* RNNSwizzles.h in Headers */ = {isa = PBXBuildFile; fileRef = 390AD475200F499D00A8250D /* RNNSwizzles.h */; };
63
 		390AD478200F499D00A8250D /* RNNSwizzles.m in Sources */ = {isa = PBXBuildFile; fileRef = 390AD476200F499D00A8250D /* RNNSwizzles.m */; };
63
 		390AD478200F499D00A8250D /* RNNSwizzles.m in Sources */ = {isa = PBXBuildFile; fileRef = 390AD476200F499D00A8250D /* RNNSwizzles.m */; };
64
+		4534E72520CB6724009F8185 /* RNNLargeTitleOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4534E72320CB6724009F8185 /* RNNLargeTitleOptions.h */; };
65
+		4534E72620CB6724009F8185 /* RNNLargeTitleOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4534E72420CB6724009F8185 /* RNNLargeTitleOptions.m */; };
64
 		5016E8EF20209690009D4F7C /* RNNCustomTitleView.h in Headers */ = {isa = PBXBuildFile; fileRef = 5016E8ED2020968F009D4F7C /* RNNCustomTitleView.h */; };
66
 		5016E8EF20209690009D4F7C /* RNNCustomTitleView.h in Headers */ = {isa = PBXBuildFile; fileRef = 5016E8ED2020968F009D4F7C /* RNNCustomTitleView.h */; };
65
 		5016E8F020209690009D4F7C /* RNNCustomTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5016E8EE2020968F009D4F7C /* RNNCustomTitleView.m */; };
67
 		5016E8F020209690009D4F7C /* RNNCustomTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5016E8EE2020968F009D4F7C /* RNNCustomTitleView.m */; };
66
 		50175CD1207A2AA1004FE91B /* RNNComponentOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 50175CCF207A2AA1004FE91B /* RNNComponentOptions.h */; };
68
 		50175CD1207A2AA1004FE91B /* RNNComponentOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 50175CCF207A2AA1004FE91B /* RNNComponentOptions.h */; };
76
 		50451D0E2042F70900695F00 /* RNNTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = 50451D0C2042F70900695F00 /* RNNTransition.m */; };
78
 		50451D0E2042F70900695F00 /* RNNTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = 50451D0C2042F70900695F00 /* RNNTransition.m */; };
77
 		5048862D20BE976D000908DE /* RNNLayoutOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 5048862B20BE976D000908DE /* RNNLayoutOptions.h */; };
79
 		5048862D20BE976D000908DE /* RNNLayoutOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 5048862B20BE976D000908DE /* RNNLayoutOptions.h */; };
78
 		5048862E20BE976D000908DE /* RNNLayoutOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 5048862C20BE976D000908DE /* RNNLayoutOptions.m */; };
80
 		5048862E20BE976D000908DE /* RNNLayoutOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 5048862C20BE976D000908DE /* RNNLayoutOptions.m */; };
79
-		504AFE641FFE53070076E904 /* RNNOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 504AFE621FFE53070076E904 /* RNNOptions.h */; };
80
 		504AFE651FFE53070076E904 /* RNNOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 504AFE631FFE53070076E904 /* RNNOptions.m */; };
81
 		504AFE651FFE53070076E904 /* RNNOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 504AFE631FFE53070076E904 /* RNNOptions.m */; };
81
 		504AFE741FFFF0540076E904 /* RNNTopTabsOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 504AFE721FFFF0540076E904 /* RNNTopTabsOptions.h */; };
82
 		504AFE741FFFF0540076E904 /* RNNTopTabsOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 504AFE721FFFF0540076E904 /* RNNTopTabsOptions.h */; };
82
 		504AFE751FFFF0540076E904 /* RNNTopTabsOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 504AFE731FFFF0540076E904 /* RNNTopTabsOptions.m */; };
83
 		504AFE751FFFF0540076E904 /* RNNTopTabsOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 504AFE731FFFF0540076E904 /* RNNTopTabsOptions.m */; };
267
 		2DCD9194200014A900EDC75D /* RNNBridgeManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNBridgeManager.m; sourceTree = "<group>"; };
268
 		2DCD9194200014A900EDC75D /* RNNBridgeManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNBridgeManager.m; sourceTree = "<group>"; };
268
 		390AD475200F499D00A8250D /* RNNSwizzles.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNSwizzles.h; sourceTree = "<group>"; };
269
 		390AD475200F499D00A8250D /* RNNSwizzles.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNSwizzles.h; sourceTree = "<group>"; };
269
 		390AD476200F499D00A8250D /* RNNSwizzles.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNSwizzles.m; sourceTree = "<group>"; };
270
 		390AD476200F499D00A8250D /* RNNSwizzles.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNSwizzles.m; sourceTree = "<group>"; };
271
+		4534E72320CB6724009F8185 /* RNNLargeTitleOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNLargeTitleOptions.h; sourceTree = "<group>"; };
272
+		4534E72420CB6724009F8185 /* RNNLargeTitleOptions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNLargeTitleOptions.m; sourceTree = "<group>"; };
270
 		5016E8ED2020968F009D4F7C /* RNNCustomTitleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNCustomTitleView.h; sourceTree = "<group>"; };
273
 		5016E8ED2020968F009D4F7C /* RNNCustomTitleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNCustomTitleView.h; sourceTree = "<group>"; };
271
 		5016E8EE2020968F009D4F7C /* RNNCustomTitleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNCustomTitleView.m; sourceTree = "<group>"; };
274
 		5016E8EE2020968F009D4F7C /* RNNCustomTitleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNCustomTitleView.m; sourceTree = "<group>"; };
272
 		50175CCF207A2AA1004FE91B /* RNNComponentOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNComponentOptions.h; sourceTree = "<group>"; };
275
 		50175CCF207A2AA1004FE91B /* RNNComponentOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNComponentOptions.h; sourceTree = "<group>"; };
519
 		504AFE611FFE52EF0076E904 /* Options */ = {
522
 		504AFE611FFE52EF0076E904 /* Options */ = {
520
 			isa = PBXGroup;
523
 			isa = PBXGroup;
521
 			children = (
524
 			children = (
525
+				4534E72320CB6724009F8185 /* RNNLargeTitleOptions.h */,
526
+				4534E72420CB6724009F8185 /* RNNLargeTitleOptions.m */,
522
 				E33AC20220B5C3880090DB8A /* RNNStatusBarOptions.h */,
527
 				E33AC20220B5C3880090DB8A /* RNNStatusBarOptions.h */,
523
 				E33AC20320B5C3890090DB8A /* RNNStatusBarOptions.m */,
528
 				E33AC20320B5C3890090DB8A /* RNNStatusBarOptions.m */,
524
 				504AFE621FFE53070076E904 /* RNNOptions.h */,
529
 				504AFE621FFE53070076E904 /* RNNOptions.h */,
822
 				507F44201FFA8A8800D9425B /* RNNRootViewProtocol.h in Headers */,
827
 				507F44201FFA8A8800D9425B /* RNNRootViewProtocol.h in Headers */,
823
 				50570BEA2063E09B006A1B5C /* RNNTitleViewHelper.h in Headers */,
828
 				50570BEA2063E09B006A1B5C /* RNNTitleViewHelper.h in Headers */,
824
 				263905CA1E4C6F440023D7D3 /* SidebarLuvocracyAnimation.h in Headers */,
829
 				263905CA1E4C6F440023D7D3 /* SidebarLuvocracyAnimation.h in Headers */,
830
+				4534E72520CB6724009F8185 /* RNNLargeTitleOptions.h in Headers */,
825
 				50762D08205E96C200E3D18A /* RNNModalAnimation.h in Headers */,
831
 				50762D08205E96C200E3D18A /* RNNModalAnimation.h in Headers */,
826
 				390AD477200F499D00A8250D /* RNNSwizzles.h in Headers */,
832
 				390AD477200F499D00A8250D /* RNNSwizzles.h in Headers */,
827
 				263905B11E4C6F440023D7D3 /* MMDrawerController.h in Headers */,
833
 				263905B11E4C6F440023D7D3 /* MMDrawerController.h in Headers */,
828
-				504AFE641FFE53070076E904 /* RNNOptions.h in Headers */,
829
 				263905B91E4C6F440023D7D3 /* RCCDrawerController.h in Headers */,
834
 				263905B91E4C6F440023D7D3 /* RCCDrawerController.h in Headers */,
830
 				263905B31E4C6F440023D7D3 /* MMDrawerVisualState.h in Headers */,
835
 				263905B31E4C6F440023D7D3 /* MMDrawerVisualState.h in Headers */,
831
 				502CB43A20CBCA180019B2FE /* RNNBridgeManagerDelegate.h in Headers */,
836
 				502CB43A20CBCA180019B2FE /* RNNBridgeManagerDelegate.h in Headers */,
996
 				263905BA1E4C6F440023D7D3 /* RCCDrawerController.m in Sources */,
1001
 				263905BA1E4C6F440023D7D3 /* RCCDrawerController.m in Sources */,
997
 				50F5DFC21F407A8C001A00BC /* RNNTabBarController.m in Sources */,
1002
 				50F5DFC21F407A8C001A00BC /* RNNTabBarController.m in Sources */,
998
 				263905BC1E4C6F440023D7D3 /* RCCDrawerHelper.m in Sources */,
1003
 				263905BC1E4C6F440023D7D3 /* RCCDrawerHelper.m in Sources */,
1004
+				4534E72620CB6724009F8185 /* RNNLargeTitleOptions.m in Sources */,
999
 				507E7D58201DDD3000444E6C /* RNNAnimationOptions.m in Sources */,
1005
 				507E7D58201DDD3000444E6C /* RNNAnimationOptions.m in Sources */,
1000
 				2145452A1F4DC85F006E8DA1 /* RCTHelpers.m in Sources */,
1006
 				2145452A1F4DC85F006E8DA1 /* RCTHelpers.m in Sources */,
1001
 				2DCD9196200014A900EDC75D /* RNNBridgeManager.m in Sources */,
1007
 				2DCD9196200014A900EDC75D /* RNNBridgeManager.m in Sources */,

+ 72
- 20
lib/ios/ReactNativeNavigationTests/RNNRootViewControllerTest.m View File

225
 	
225
 	
226
 }
226
 }
227
 
227
 
228
+
229
+-(void)testTopBarLargeTitle_default {
230
+	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
231
+	[self.uut viewWillAppear:false];
232
+	
233
+	XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode,  UINavigationItemLargeTitleDisplayModeNever);
234
+}
235
+-(void)testTopBarLargeTitle_true {
236
+	self.options.topBar.largeTitle.visible = @(1);
237
+	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
238
+	[self.uut viewWillAppear:false];
239
+	
240
+	XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode, UINavigationItemLargeTitleDisplayModeAlways);
241
+}
242
+-(void)testTopBarLargeTitle_false {
243
+	self.options.topBar.largeTitle.visible  = @(0);
244
+	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
245
+	[self.uut viewWillAppear:false];
246
+	
247
+	XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode, UINavigationItemLargeTitleDisplayModeNever);
248
+}
249
+
250
+
251
+-(void)testTopBarLargeTitleFontSize_withoutTextFontFamily_withoutTextColor {
252
+	NSNumber* topBarTextFontSizeInput = @(15);
253
+	self.options.topBar.largeTitle.fontSize = topBarTextFontSizeInput;
254
+	__unused RNNNavigationController* nav = [[RNNNavigationController alloc] initWithRootViewController:self.uut];
255
+	[self.uut viewWillAppear:false];
256
+	UIFont* expectedFont = [UIFont systemFontOfSize:15];
257
+	XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSFont"] isEqual:expectedFont]);
258
+}
259
+
260
+-(void)testTopBarLargeTitleFontSize_withoutTextFontFamily_withTextColor {
261
+	NSNumber* topBarTextFontSizeInput = @(15);
262
+	NSNumber* inputColor = @(0xFFFF0000);
263
+	self.options.topBar.largeTitle.fontSize = topBarTextFontSizeInput;
264
+	self.options.topBar.largeTitle.color = inputColor;
265
+	__unused RNNNavigationController* nav = [[RNNNavigationController alloc] initWithRootViewController:self.uut];
266
+	[self.uut viewWillAppear:false];
267
+	UIFont* expectedFont = [UIFont systemFontOfSize:15];
268
+	UIColor* expectedColor = [UIColor colorWithRed:1 green:0 blue:0 alpha:1];
269
+	XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSFont"] isEqual:expectedFont]);
270
+	XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSColor"] isEqual:expectedColor]);
271
+}
272
+
273
+-(void)testTopBarLargeTitleFontSize_withTextFontFamily_withTextColor {
274
+	NSNumber* topBarTextFontSizeInput = @(15);
275
+	NSNumber* inputColor = @(0xFFFF0000);
276
+	NSString* inputFont = @"HelveticaNeue";
277
+	self.options.topBar.largeTitle.fontSize = topBarTextFontSizeInput;
278
+	self.options.topBar.largeTitle.color = inputColor;
279
+	self.options.topBar.largeTitle.fontFamily = inputFont;
280
+	__unused RNNNavigationController* nav = [[RNNNavigationController alloc] initWithRootViewController:self.uut];
281
+	[self.uut viewWillAppear:false];
282
+	UIColor* expectedColor = [UIColor colorWithRed:1 green:0 blue:0 alpha:1];
283
+	UIFont* expectedFont = [UIFont fontWithName:inputFont size:15];
284
+	XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSFont"] isEqual:expectedFont]);
285
+	XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSColor"] isEqual:expectedColor]);
286
+}
287
+
288
+-(void)testTopBarLargeTitleFontSize_withTextFontFamily_withoutTextColor {
289
+	NSNumber* topBarTextFontSizeInput = @(15);
290
+	NSString* inputFont = @"HelveticaNeue";
291
+	self.options.topBar.largeTitle.fontSize = topBarTextFontSizeInput;
292
+	self.options.topBar.largeTitle.fontFamily = inputFont;
293
+	__unused RNNNavigationController* nav = [[RNNNavigationController alloc] initWithRootViewController:self.uut];
294
+	[self.uut viewWillAppear:false];
295
+	UIFont* expectedFont = [UIFont fontWithName:inputFont size:15];
296
+	XCTAssertTrue([self.uut.navigationController.navigationBar.largeTitleTextAttributes[@"NSFont"] isEqual:expectedFont]);
297
+}
298
+
299
+
228
 -(void)testTopBarTextFontSize_withoutTextFontFamily_withoutTextColor {
300
 -(void)testTopBarTextFontSize_withoutTextFontFamily_withoutTextColor {
229
 	NSNumber* topBarTextFontSizeInput = @(15);
301
 	NSNumber* topBarTextFontSizeInput = @(15);
230
 	self.options.topBar.title.fontSize = topBarTextFontSizeInput;
302
 	self.options.topBar.title.fontSize = topBarTextFontSizeInput;
492
 	XCTAssertNil([self.uut.navigationController.navigationBar viewWithTag:BLUR_TOPBAR_TAG]);
564
 	XCTAssertNil([self.uut.navigationController.navigationBar viewWithTag:BLUR_TOPBAR_TAG]);
493
 }
565
 }
494
 
566
 
495
--(void)testTopBarLargeTitle_default {
496
-	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
497
-	[self.uut viewWillAppear:false];
498
-	
499
-	XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode,  UINavigationItemLargeTitleDisplayModeNever);
500
-}
501
--(void)testTopBarLargeTitle_true {
502
-	self.options.topBar.largeTitle = @(1);
503
-	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
504
-	[self.uut viewWillAppear:false];
505
-	
506
-	XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode, UINavigationItemLargeTitleDisplayModeAlways);
507
-}
508
--(void)testTopBarLargeTitle_false {
509
-	self.options.topBar.largeTitle  = @(0);
510
-	__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
511
-	[self.uut viewWillAppear:false];
512
-	
513
-	XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode, UINavigationItemLargeTitleDisplayModeNever);
514
-}
515
 -(void)testTopBarBlur_false {
567
 -(void)testTopBarBlur_false {
516
 	NSNumber* topBarBlurInput = @(0);
568
 	NSNumber* topBarBlurInput = @(0);
517
 	self.options.topBar.blur = topBarBlurInput;
569
 	self.options.topBar.blur = topBarBlurInput;

+ 3
- 1
playground/src/screens/CustomTransitionDestination.js View File

18
           text: 'ye babyyyyyy',
18
           text: 'ye babyyyyyy',
19
           fontFamily: 'HelveticaNeue-Italic'
19
           fontFamily: 'HelveticaNeue-Italic'
20
         },
20
         },
21
-        largeTitle: false
21
+        largeTitle: {
22
+          visible: false
23
+        }      
22
       }
24
       }
23
     };
25
     };
24
   }
26
   }

+ 3
- 1
playground/src/screens/CustomTransitionOrigin.js View File

15
           fontFamily: 'HelveticaNeue-Italic',
15
           fontFamily: 'HelveticaNeue-Italic',
16
           fontSize: 16
16
           fontSize: 16
17
         },
17
         },
18
-        largeTitle: false,
18
+        largeTitle: {
19
+          visible: false
20
+        },
19
         translucent: true
21
         translucent: true
20
       }
22
       }
21
     };
23
     };

+ 7
- 3
playground/src/screens/OptionsScreen.js View File

28
           color: 'black',
28
           color: 'black',
29
           fontSize: 16,
29
           fontSize: 16,
30
           alignment: 'center',
30
           alignment: 'center',
31
-          fontFamily: 'HelveticaNeue-Italic',
32
-          largeTitle: false
31
+          fontFamily: 'HelveticaNeue-Italic'
32
+        },
33
+        largeTitle: {
34
+          visible: false
33
         },
35
         },
34
         subtitle: {
36
         subtitle: {
35
           text: 'Static Subtitle',
37
           text: 'Static Subtitle',
179
         title: {
181
         title: {
180
           text: 'Dynamic Title',
182
           text: 'Dynamic Title',
181
           color: '#00FFFF',
183
           color: '#00FFFF',
182
-          largeTitle: false,
183
           fontSize: 20,
184
           fontSize: 20,
184
           fontFamily: 'HelveticaNeue-CondensedBold'
185
           fontFamily: 'HelveticaNeue-CondensedBold'
186
+        },
187
+        largeTitle: {
188
+          visible: false
185
         }
189
         }
186
       }
190
       }
187
     });
191
     });

+ 3
- 1
playground/src/screens/SearchScreen.js View File

22
         title: {
22
         title: {
23
           text: 'Search'
23
           text: 'Search'
24
         },
24
         },
25
-        largeTitle: true,
25
+        largeTitle: {
26
+          visible: true
27
+        },
26
         searchBar: true,
28
         searchBar: true,
27
         searchBarHiddenWhenScrolling: true,
29
         searchBarHiddenWhenScrolling: true,
28
         translucent: true,
30
         translucent: true,

+ 3
- 1
playground/src/screens/TopTabOptionsScreen.js View File

41
           fontSize: 16,
41
           fontSize: 16,
42
           fontFamily: 'HelveticaNeue-CondensedBold'
42
           fontFamily: 'HelveticaNeue-CondensedBold'
43
         },
43
         },
44
-        largeTitle: false,
44
+        largeTitle: {
45
+          visible: false,
46
+        },
45
         buttonColor: 'red',
47
         buttonColor: 'red',
46
       }
48
       }
47
     });
49
     });

+ 3
- 1
playground/src/screens/WelcomeScreen.js View File

17
       },
17
       },
18
       topBar: {
18
       topBar: {
19
         title: {
19
         title: {
20
-          largeTitle: false,
21
           title: 'My Screen'
20
           title: 'My Screen'
22
         },
21
         },
22
+        largeTitle: {
23
+          visible: false,
24
+        },
23
         drawBehind: true,
25
         drawBehind: true,
24
         visible: false,
26
         visible: false,
25
         animate: false
27
         animate: false