Browse Source

statusBar.hidden changed to statusBar.visible in iOS

yogevbd 6 years ago
parent
commit
7d9ba7292b

+ 1
- 1
docs/docs/layout-types.md View File

184
     stack: {
184
     stack: {
185
       options: {
185
       options: {
186
         topBar: {
186
         topBar: {
187
-          hidden: true
187
+          visible: false
188
         }
188
         }
189
       },
189
       },
190
       children: [
190
       children: [

+ 2
- 2
lib/ios/RNNRootViewController.m View File

194
 }
194
 }
195
 
195
 
196
 - (BOOL)prefersStatusBarHidden {
196
 - (BOOL)prefersStatusBarHidden {
197
-	if ([self.options.statusBar.hidden boolValue]) {
198
-		return YES;
197
+	if (self.options.statusBar.visible) {
198
+		return ![self.options.statusBar.visible boolValue];
199
 	} else if ([self.options.statusBar.hideWithTopBar boolValue]) {
199
 	} else if ([self.options.statusBar.hideWithTopBar boolValue]) {
200
 		return self.navigationController.isNavigationBarHidden;
200
 		return self.navigationController.isNavigationBarHidden;
201
 	}
201
 	}

+ 1
- 1
lib/ios/RNNStatusBarOptions.h View File

7
 @property (nonatomic, strong) NSNumber* blur;
7
 @property (nonatomic, strong) NSNumber* blur;
8
 @property (nonatomic, strong) NSNumber* hideWithTopBar;
8
 @property (nonatomic, strong) NSNumber* hideWithTopBar;
9
 @property (nonatomic, strong) NSString* style;
9
 @property (nonatomic, strong) NSString* style;
10
-@property (nonatomic, strong) NSNumber* hidden;
10
+@property (nonatomic, strong) NSNumber* visible;
11
 @property (nonatomic, strong) NSNumber* animate;
11
 @property (nonatomic, strong) NSNumber* animate;
12
 
12
 
13
 @end
13
 @end

+ 1
- 1
lib/ios/RNNStatusBarOptions.m View File

20
 		}
20
 		}
21
 	}
21
 	}
22
 	
22
 	
23
-	if (self.style || self.hidden) {
23
+	if (self.style || self.visible) {
24
 		[UIView animateWithDuration:[self statusBarAnimationDuration] animations:^{
24
 		[UIView animateWithDuration:[self statusBarAnimationDuration] animations:^{
25
 			[viewController setNeedsStatusBarAppearanceUpdate];
25
 			[viewController setNeedsStatusBarAppearanceUpdate];
26
 		}];
26
 		}];

+ 10
- 11
lib/ios/ReactNativeNavigationTests/RNNRootViewControllerTest.m View File

69
 	XCTAssertFalse([self.uut prefersStatusBarHidden]);
69
 	XCTAssertFalse([self.uut prefersStatusBarHidden]);
70
 }
70
 }
71
 
71
 
72
-- (void)testStatusBarHidden_true {
73
-	self.options.statusBar.hidden = @(1);
72
+- (void)testStatusBarVisible_false {
73
+	self.options.statusBar.visible = @(0);
74
 	__unused RNNNavigationController* nav = [[RNNNavigationController alloc] initWithRootViewController:self.uut];
74
 	__unused RNNNavigationController* nav = [[RNNNavigationController alloc] initWithRootViewController:self.uut];
75
 	[self.uut viewWillAppear:false];
75
 	[self.uut viewWillAppear:false];
76
 
76
 
77
 	XCTAssertTrue([self.uut prefersStatusBarHidden]);
77
 	XCTAssertTrue([self.uut prefersStatusBarHidden]);
78
 }
78
 }
79
 
79
 
80
+- (void)testStatusBarVisible_true {
81
+	self.options.statusBar.visible = @(1);
82
+	__unused RNNNavigationController* nav = [[RNNNavigationController alloc] initWithRootViewController:self.uut];
83
+	[self.uut viewWillAppear:false];
84
+	
85
+	XCTAssertFalse([self.uut prefersStatusBarHidden]);
86
+}
87
+
80
 - (void)testStatusBarHideWithTopBar_false {
88
 - (void)testStatusBarHideWithTopBar_false {
81
 	self.options.statusBar.hideWithTopBar = @(0);
89
 	self.options.statusBar.hideWithTopBar = @(0);
82
 	self.options.topBar.visible = @(0);
90
 	self.options.topBar.visible = @(0);
95
 	XCTAssertTrue([self.uut prefersStatusBarHidden]);
103
 	XCTAssertTrue([self.uut prefersStatusBarHidden]);
96
 }
104
 }
97
 
105
 
98
-
99
-- (void)testStatusBarHidden_false {
100
-	self.options.statusBar.hidden = @(0);
101
-	__unused RNNNavigationController* nav = [[RNNNavigationController alloc] initWithRootViewController:self.uut];
102
-	[self.uut viewWillAppear:false];
103
-
104
-	XCTAssertFalse([self.uut prefersStatusBarHidden]);
105
-}
106
-
107
 -(void)testTitle_string{
106
 -(void)testTitle_string{
108
 	NSString* title =@"some title";
107
 	NSString* title =@"some title";
109
 	self.options.topBar.title.text = title;
108
 	self.options.topBar.title.text = title;