Przeglądaj źródła

Draw under bottomTabs when bottomTabs.visible false

yogevbd 6 lat temu
rodzic
commit
6426d74ed8

+ 1
- 1
lib/ios/RNNViewControllerPresenter.m Wyświetl plik

@@ -22,7 +22,7 @@
22 22
 	[viewController rnn_setDrawBehindTopBar:[options.topBar.drawBehind getWithDefaultValue:NO]];
23 23
 	[viewController rnn_setNavigationItemTitle:[options.topBar.title.text getWithDefaultValue:nil]];
24 24
 	[viewController rnn_setTopBarPrefersLargeTitle:[options.topBar.largeTitle.visible getWithDefaultValue:NO]];
25
-	[viewController rnn_setDrawBehindTabBar:[options.bottomTabs.drawBehind getWithDefaultValue:NO]];
25
+	[viewController rnn_setDrawBehindTabBar:[options.bottomTabs.drawBehind getWithDefaultValue:NO] || ![options.bottomTabs.visible getWithDefaultValue:YES]];
26 26
 	[viewController rnn_setTabBarItemBadge:[options.bottomTab.badge getWithDefaultValue:nil]];
27 27
 	[viewController rnn_setTabBarItemBadgeColor:[options.bottomTab.badgeColor getWithDefaultValue:nil]];
28 28
 	[viewController rnn_setStatusBarBlur:[options.statusBar.blur getWithDefaultValue:NO]];

+ 10
- 1
lib/ios/ReactNativeNavigationTests/RNNViewControllerPresenterTest.m Wyświetl plik

@@ -1,5 +1,7 @@
1 1
 #import <XCTest/XCTest.h>
2
+#import <OCMock/OCMock.h>
2 3
 #import "RNNViewControllerPresenter.h"
4
+#import "UIViewController+RNNOptions.h"
3 5
 
4 6
 @interface RNNViewControllerPresenterTest : XCTestCase
5 7
 
@@ -14,7 +16,7 @@
14 16
 - (void)setUp {
15 17
     [super setUp];
16 18
 	self.uut = [[RNNViewControllerPresenter alloc] init];
17
-	self.bindedViewController = [UIViewController new];
19
+	self.bindedViewController = [OCMockObject partialMockForObject:[UIViewController new]];
18 20
 	[self.uut bindViewController:self.bindedViewController];
19 21
 	self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
20 22
 }
@@ -50,4 +52,11 @@
50 52
 	XCTAssertFalse(self.bindedViewController.navigationItem.hidesBackButton);
51 53
 }
52 54
 
55
+- (void)testApplyOptions_drawBehindTabBarTrueWhenVisibleFalse {
56
+	self.options.bottomTabs.visible = [[Bool alloc] initWithValue:@(0)];
57
+	[[(id)self.bindedViewController expect] rnn_setDrawBehindTabBar:YES];
58
+	[self.uut applyOptions:self.options];
59
+	[(id)self.bindedViewController verify];
60
+}
61
+
53 62
 @end