Преглед изворни кода

apply extendedLayoutIncludesOpaqueBars true on all viewControllers (#5906)

Yogev Ben David пре 5 година
родитељ
комит
527fd49f2f
No account linked to committer's email address

+ 4
- 0
lib/ios/UIViewController+LayoutProtocol.m Прегледај датотеку

@@ -51,6 +51,10 @@
51 51
 	[self.options overrideOptions:options];
52 52
 }
53 53
 
54
+- (BOOL)extendedLayoutIncludesOpaqueBars {
55
+    return YES;
56
+}
57
+
54 58
 - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
55 59
 	UIInterfaceOrientationMask interfaceOrientationMask = self.presenter ? [self.presenter getOrientation:[self resolveOptions]] : [[UIApplication sharedApplication] supportedInterfaceOrientationsForWindow:[[UIApplication sharedApplication] keyWindow]];
56 60
 	return interfaceOrientationMask;

+ 0
- 2
lib/ios/UIViewController+RNNOptions.m Прегледај датотеку

@@ -58,7 +58,6 @@ const NSInteger BLUR_STATUS_TAG = 78264801;
58 58
 
59 59
 - (void)setDrawBehindTopBar:(BOOL)drawBehind {
60 60
 	if (drawBehind) {
61
-		[self setExtendedLayoutIncludesOpaqueBars:YES];
62 61
 		self.edgesForExtendedLayout |= UIRectEdgeTop;
63 62
 	} else {
64 63
 		self.edgesForExtendedLayout &= ~UIRectEdgeTop;
@@ -67,7 +66,6 @@ const NSInteger BLUR_STATUS_TAG = 78264801;
67 66
 
68 67
 - (void)setDrawBehindTabBar:(BOOL)drawBehindTabBar {
69 68
 	if (drawBehindTabBar) {
70
-		[self setExtendedLayoutIncludesOpaqueBars:YES];
71 69
 		self.edgesForExtendedLayout |= UIRectEdgeBottom;
72 70
 	} else {
73 71
 		self.edgesForExtendedLayout &= ~UIRectEdgeBottom;

+ 10
- 0
playground/ios/NavigationTests/UIViewController+LayoutProtocolTest.m Прегледај датотеку

@@ -108,4 +108,14 @@
108 108
 	XCTAssertEqual(uut.resolveOptions.topBar.title.text.get, @"merged");
109 109
 }
110 110
 
111
+- (void)testLayout_shouldExtendedLayoutIncludesOpaqueBars {
112
+	UIViewController* component = [[UIViewController alloc] initWithLayoutInfo:nil creator:nil options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:nil];
113
+	UINavigationController* stack = [[UINavigationController alloc] initWithLayoutInfo:nil creator:nil options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:nil];
114
+	UITabBarController* tabBar = [[UITabBarController alloc] initWithLayoutInfo:nil creator:nil options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:nil];
115
+	
116
+	XCTAssertTrue(component.extendedLayoutIncludesOpaqueBars);
117
+	XCTAssertTrue(stack.extendedLayoutIncludesOpaqueBars);
118
+	XCTAssertTrue(tabBar.extendedLayoutIncludesOpaqueBars);
119
+}
120
+
111 121
 @end

+ 0
- 12
playground/ios/NavigationTests/UIViewController+RNNOptionsTest.m Прегледај датотеку

@@ -34,18 +34,6 @@
34 34
     XCTAssertEqual([self.uut tabBarItem].badgeValue, nil);
35 35
 }
36 36
 
37
-- (void)testSetDrawBehindTopBarTrue_shouldSetExtendedLayoutTrue {
38
-    [[self.uut expect] setExtendedLayoutIncludesOpaqueBars:YES];
39
-    [self.uut setDrawBehindTopBar:YES];
40
-    [self.uut verify];
41
-}
42
-
43
-- (void)testSetDrawBehindTabBarTrue_shouldSetExtendedLayoutTrue {
44
-    [[self.uut expect] setExtendedLayoutIncludesOpaqueBars:YES];
45
-    [self.uut setDrawBehindTabBar:YES];
46
-    [self.uut verify];
47
-}
48
-
49 37
 - (void)testSetDrawBehindTopBarFalse_shouldNotCallExtendedLayout {
50 38
     [[self.uut reject] setExtendedLayoutIncludesOpaqueBars:NO];
51 39
     [self.uut setDrawBehindTopBar:NO];