Browse Source

Draw under bottomTabs when bottomTabs.visible false

yogevbd 6 years ago
parent
commit
6426d74ed8

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

22
 	[viewController rnn_setDrawBehindTopBar:[options.topBar.drawBehind getWithDefaultValue:NO]];
22
 	[viewController rnn_setDrawBehindTopBar:[options.topBar.drawBehind getWithDefaultValue:NO]];
23
 	[viewController rnn_setNavigationItemTitle:[options.topBar.title.text getWithDefaultValue:nil]];
23
 	[viewController rnn_setNavigationItemTitle:[options.topBar.title.text getWithDefaultValue:nil]];
24
 	[viewController rnn_setTopBarPrefersLargeTitle:[options.topBar.largeTitle.visible getWithDefaultValue:NO]];
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
 	[viewController rnn_setTabBarItemBadge:[options.bottomTab.badge getWithDefaultValue:nil]];
26
 	[viewController rnn_setTabBarItemBadge:[options.bottomTab.badge getWithDefaultValue:nil]];
27
 	[viewController rnn_setTabBarItemBadgeColor:[options.bottomTab.badgeColor getWithDefaultValue:nil]];
27
 	[viewController rnn_setTabBarItemBadgeColor:[options.bottomTab.badgeColor getWithDefaultValue:nil]];
28
 	[viewController rnn_setStatusBarBlur:[options.statusBar.blur getWithDefaultValue:NO]];
28
 	[viewController rnn_setStatusBarBlur:[options.statusBar.blur getWithDefaultValue:NO]];

+ 10
- 1
lib/ios/ReactNativeNavigationTests/RNNViewControllerPresenterTest.m View File

1
 #import <XCTest/XCTest.h>
1
 #import <XCTest/XCTest.h>
2
+#import <OCMock/OCMock.h>
2
 #import "RNNViewControllerPresenter.h"
3
 #import "RNNViewControllerPresenter.h"
4
+#import "UIViewController+RNNOptions.h"
3
 
5
 
4
 @interface RNNViewControllerPresenterTest : XCTestCase
6
 @interface RNNViewControllerPresenterTest : XCTestCase
5
 
7
 
14
 - (void)setUp {
16
 - (void)setUp {
15
     [super setUp];
17
     [super setUp];
16
 	self.uut = [[RNNViewControllerPresenter alloc] init];
18
 	self.uut = [[RNNViewControllerPresenter alloc] init];
17
-	self.bindedViewController = [UIViewController new];
19
+	self.bindedViewController = [OCMockObject partialMockForObject:[UIViewController new]];
18
 	[self.uut bindViewController:self.bindedViewController];
20
 	[self.uut bindViewController:self.bindedViewController];
19
 	self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
21
 	self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
20
 }
22
 }
50
 	XCTAssertFalse(self.bindedViewController.navigationItem.hidesBackButton);
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
 @end
62
 @end