Skip to content

Commit

Permalink
Update react-native-safe-area-context to 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tsapeta committed May 25, 2020
1 parent c0b27a9 commit 0bd19cf
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion apps/bare-expo/package.json
Expand Up @@ -92,7 +92,7 @@
"react-native-appearance": "~0.3.3",
"react-native-gesture-handler": "~1.6.0",
"react-native-reanimated": "~1.9.0",
"react-native-safe-area-context": "2.0.0",
"react-native-safe-area-context": "2.0.1",
"react-native-screens": "~2.8.0",
"react-native-unimodules": "~0.9.1",
"react-native-web": "^0.11.4",
Expand Down
2 changes: 1 addition & 1 deletion apps/native-component-list/package.json
Expand Up @@ -90,7 +90,7 @@
"react-native-paper": "github:brentvatne/react-native-paper#@brent/fix-bottom-navigation-rn-57",
"react-native-platform-touchable": "^1.1.1",
"react-native-reanimated": "~1.9.0",
"react-native-safe-area-context": "2.0.0",
"react-native-safe-area-context": "2.0.1",
"react-native-safe-area-view": "^0.14.8",
"react-native-screens": "~2.8.0",
"react-native-shared-element": "0.7.0",
Expand Down
2 changes: 1 addition & 1 deletion home/package.json
Expand Up @@ -51,7 +51,7 @@
"react-native-gesture-handler": "~1.6.0",
"react-native-infinite-scroll-view": "^0.4.5",
"react-native-maps": "0.26.1",
"react-native-safe-area-context": "^2.0.0",
"react-native-safe-area-context": "2.0.1",
"react-navigation": "4.1.0-alpha.1",
"react-navigation-material-bottom-tabs": "1.1.1",
"react-navigation-stack": "^2.0.15",
Expand Down
22 changes: 10 additions & 12 deletions ios/Exponent/Versioned/Core/Api/SafeAreaContext/RNCSafeAreaView.m
Expand Up @@ -45,14 +45,10 @@ - (NSString *)description

- (void)safeAreaInsetsDidChange
{
[super safeAreaInsetsDidChange];
[self invalidateSafeAreaInsets];
}

- (void)invalidateSafeAreaInsets
{
[self setSafeAreaInsets:[self realOrEmulateSafeAreaInsets:self.emulateUnlessSupported]];
}

- (void)layoutSubviews
{
[super layoutSubviews];
Expand All @@ -62,15 +58,10 @@ - (void)layoutSubviews
}
}

- (void)updateLocalData
- (void)invalidateSafeAreaInsets
{
RNCSafeAreaViewLocalData *localData = [[RNCSafeAreaViewLocalData alloc] initWithInsets:_currentSafeAreaInsets
edges:_edges];
[_bridge.uiManager setLocalData:localData forView:self];
}
UIEdgeInsets safeAreaInsets = [self realOrEmulateSafeAreaInsets:self.emulateUnlessSupported];

- (void)setSafeAreaInsets:(UIEdgeInsets)safeAreaInsets
{
if (UIEdgeInsetsEqualToEdgeInsetsWithThreshold(safeAreaInsets, _currentSafeAreaInsets, 1.0 / RCTScreenScale())) {
return;
}
Expand All @@ -79,6 +70,13 @@ - (void)setSafeAreaInsets:(UIEdgeInsets)safeAreaInsets
[self updateLocalData];
}

- (void)updateLocalData
{
RNCSafeAreaViewLocalData *localData = [[RNCSafeAreaViewLocalData alloc] initWithInsets:_currentSafeAreaInsets
edges:_edges];
[_bridge.uiManager setLocalData:localData forView:self];
}

- (void)setEmulateUnlessSupported:(BOOL)emulateUnlessSupported
{
if (_emulateUnlessSupported == emulateUnlessSupported) {
Expand Down
@@ -1,4 +1,5 @@
#import "RNCSafeAreaViewEdges.h"

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
Expand Down
2 changes: 1 addition & 1 deletion packages/expo/bundledNativeModules.json
Expand Up @@ -78,7 +78,7 @@
"expo-in-app-purchases": "~8.1.0",
"expo-branch": "~2.1.1",
"react-native-appearance": "~0.3.3",
"react-native-safe-area-context": "2.0.0",
"react-native-safe-area-context": "2.0.1",
"react-native-shared-element": "0.7.0",
"expo-application": "~2.1.1",
"expo-battery": "~2.1.1",
Expand Down
7 changes: 6 additions & 1 deletion yarn.lock
Expand Up @@ -13943,7 +13943,12 @@ react-native-reanimated@~1.9.0:
dependencies:
fbjs "^1.0.0"

react-native-safe-area-context@2.0.0, react-native-safe-area-context@^2.0.0:
react-native-safe-area-context@2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/react-native-safe-area-context/-/react-native-safe-area-context-2.0.1.tgz#c358d8eb6a320b218705b3e77985c3df7b26f04c"
integrity sha512-PjYGbaQVWWYk3fGVgcoZ7RkYNM6K9R2WNoZRSb+ckMZWIan30yENvpKq5HSf9LBkm7AZ046/ehawRTLKiytHCw==

react-native-safe-area-context@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/react-native-safe-area-context/-/react-native-safe-area-context-2.0.0.tgz#7ef48e5a83a1e2f7fe9d5321493822b6765fd1ab"
integrity sha512-5VtCI3Nluzm7QfTcB/3j4YeWqt25QO1u5KTA1jEg1ckJzV19qCZFyHIpCCkS5+VEX+2JEHfdczhCdwE5sPgyEw==
Expand Down

0 comments on commit 0bd19cf

Please sign in to comment.