Skip to content

Commit

Permalink
Add sending events about header height on setting config and chaning …
Browse files Browse the repository at this point in the history
…status bar visibility
  • Loading branch information
tboba committed Oct 11, 2023
1 parent 2468905 commit 83c8abc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ios/RNSScreen.mm
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ - (void)setStatusBarHidden:(BOOL)statusBarHidden
_statusBarHidden = statusBarHidden;
[RNSScreenWindowTraits assertViewControllerBasedStatusBarAppearenceSet];
[RNSScreenWindowTraits updateStatusBarAppearance];
// As the status bar could change its visibility, we need to calculate header height
// for the correct value in `onHeaderHeightChange` event.
[self.controller calculateAndNotifyHeaderHeightChangeIsModal:NO];
}

- (void)setScreenOrientation:(UIInterfaceOrientationMask)screenOrientation
Expand Down
4 changes: 4 additions & 0 deletions ios/RNSScreenStackHeaderConfig.mm
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,10 @@ + (void)updateViewController:(UIViewController *)vc
} else {
[self setAnimatedConfig:vc withConfig:config];
}

if ([vc isKindOfClass:[RNSScreen class]]) {
[((RNSScreen *)vc) calculateAndNotifyHeaderHeightChangeIsModal:NO];
}
}

- (void)insertReactSubview:(RNSScreenStackHeaderSubview *)subview atIndex:(NSInteger)atIndex
Expand Down

0 comments on commit 83c8abc

Please sign in to comment.