Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ v2 is written in Test Driven Development. We have a test for every feature inclu
| translucent | ✅ | [Contribute](/docs/docs/CONTRIBUTING.md) | Wix|
| transparent | ✅ | [Contribute](/docs/docs/CONTRIBUTING.md) |
| noBorder | ✅ | [Contribute](/docs/docs/CONTRIBUTING.md) | @gtchance|
| drawUnder | WIP @gran33 | [Contribute](/docs/docs/CONTRIBUTING.md) ||
| drawUnder | | [Contribute](/docs/docs/CONTRIBUTING.md) ||
| blur | ✅ | [Contribute](/docs/docs/CONTRIBUTING.md) | @gtchance|
| custom | WIP @gran33 | [Contribute](/docs/docs/CONTRIBUTING.md)|
| subtitleColor | [Contribute](/docs/docs/CONTRIBUTING.md) | [Contribute](/docs/docs/CONTRIBUTING.md) |
Expand All @@ -95,7 +95,7 @@ v2 is written in Test Driven Development. We have a test for every feature inclu

| tabBar | iOS | Android | contributors|
|--------------------|-----|----|-----|
| drawUnder | WIP @gran33 | [Contribute](/docs/docs/CONTRIBUTING.md) | |
| drawUnder | | [Contribute](/docs/docs/CONTRIBUTING.md) | |
| hidden | ✅ | ✅ | @gtchance |
| tabBadge | ✅ | [Contribute](/docs/docs/CONTRIBUTING.md)| Wix|
| currentTab by Index | ✅ | ✅ | Wix |
Expand Down Expand Up @@ -179,8 +179,8 @@ Note: v1 properties with names beginning with 'navBar' are replaced in v2 with
| topBarTranslucent | ✅ | ✅ | [Contribute](/docs/docs/CONTRIBUTING.md) | Wix|
| topBarTransparent | ✅ | WIP @bogobogo | [Contribute](/docs/docs/CONTRIBUTING.md) |
| topBarNoBorder | ✅ | ✅ | [Contribute](/docs/docs/CONTRIBUTING.md) | @gtchance|
| drawUnderTabBar | ✅ | WIP @gran33 | [Contribute](/docs/docs/CONTRIBUTING.md) | |
| drawUnderTopBar | ✅ | WIP @gran33 | [Contribute](/docs/docs/CONTRIBUTING.md) ||
| drawUnderTabBar | ✅ | | [Contribute](/docs/docs/CONTRIBUTING.md) | |
| drawUnderTopBar | ✅ | | [Contribute](/docs/docs/CONTRIBUTING.md) ||
| statusBarBlur | ✅ | ✅ | [Contribute](/docs/docs/CONTRIBUTING.md) | @gtchance|
| topBarBlur | ✅ | ✅ | [Contribute](/docs/docs/CONTRIBUTING.md) | @gtchance|
| tabBarHidden | ✅ | ✅ | [Contribute](/docs/docs/CONTRIBUTING.md) | @gtchance|
Expand Down
16 changes: 16 additions & 0 deletions lib/ios/RNNNavigationOptions.m
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ -(void)applyOn:(UIViewController*)viewController {
if (self.topBar.translucent) {
viewController.navigationController.navigationBar.translucent = [self.topBar.translucent boolValue];
}

if (self.topBar.drawUnder) {
if ([self.topBar.drawUnder boolValue]) {
viewController.edgesForExtendedLayout |= UIRectEdgeTop;
} else {
viewController.edgesForExtendedLayout &= ~UIRectEdgeTop;
}
}

if (self.topBar.noBorder) {
if ([self.topBar.noBorder boolValue]) {
Expand Down Expand Up @@ -203,6 +211,14 @@ -(void)applyOn:(UIViewController*)viewController {
if (self.bottomTabs.testID) {
viewController.tabBarController.tabBar.accessibilityIdentifier = self.bottomTabs.testID;
}

if (self.bottomTabs.drawUnder) {
if ([self.bottomTabs.drawUnder boolValue]) {
viewController.edgesForExtendedLayout |= UIRectEdgeBottom;
} else {
viewController.edgesForExtendedLayout &= ~UIRectEdgeBottom;
}
}
}

if (self.statusBarBlur) {
Expand Down
1 change: 1 addition & 0 deletions lib/ios/RNNTabBarOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ extern const NSInteger BLUR_TOPBAR_TAG;
@property (nonatomic, strong) NSString* tabBadge;
@property (nonatomic, strong) NSNumber* currentTabIndex;
@property (nonatomic, strong) NSString* testID;
@property (nonatomic, strong) NSNumber* drawUnder;

-(instancetype)init;
-(instancetype)initWithDict:(NSDictionary *)topBarOptions;
Expand Down
1 change: 1 addition & 0 deletions lib/ios/RNNTopBarOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ extern const NSInteger BLUR_TOPBAR_TAG;
@property (nonatomic, strong) NSNumber* buttonColor;
@property (nonatomic, strong) NSNumber* translucent;
@property (nonatomic, strong) NSNumber* transparent;
@property (nonatomic, strong) NSNumber* drawUnder;
@property (nonatomic, strong) NSNumber* textFontSize;
@property (nonatomic, strong) NSNumber* noBorder;
@property (nonatomic, strong) NSNumber* blur;
Expand Down
34 changes: 33 additions & 1 deletion lib/ios/ReactNativeNavigationTests/RNNRootViewControllerTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ -(void)testTopBarLargeTitle_true {
XCTAssertEqual(self.uut.navigationItem.largeTitleDisplayMode, UINavigationItemLargeTitleDisplayModeAlways);
}
-(void)testTopBarLargeTitle_false {
self.options.tabBar.hidden = @(0);
self.options.topBar.largeTitle = @(0);
__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
[self.uut viewWillAppear:false];

Expand All @@ -513,4 +513,36 @@ -(void)testTopBarBlur_true {
XCTAssertNotNil([self.uut.navigationController.navigationBar viewWithTag:BLUR_TOPBAR_TAG]);
}

-(void)testTopBarDrawUnder_true {
self.options.topBar.drawUnder = @(1);
__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
[self.uut viewWillAppear:false];

XCTAssertTrue(self.uut.edgesForExtendedLayout & UIRectEdgeTop);
}

-(void)testTopBarDrawUnder_false {
self.options.topBar.drawUnder = @(0);
__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
[self.uut viewWillAppear:false];

XCTAssertFalse(self.uut.edgesForExtendedLayout & UIRectEdgeTop);
}

-(void)testBottomTabsDrawUnder_true {
self.options.bottomTabs.drawUnder = @(1);
__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
[self.uut viewWillAppear:false];

XCTAssertTrue(self.uut.edgesForExtendedLayout & UIRectEdgeBottom);
}

-(void)testBottomTabsDrawUnder_false {
self.options.bottomTabs.drawUnder = @(0);
__unused UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:self.uut];
[self.uut viewWillAppear:false];

XCTAssertFalse(self.uut.edgesForExtendedLayout & UIRectEdgeBottom);
}

@end