From faed4731bcb9fbaeece1e5ae1a54bd156f738be9 Mon Sep 17 00:00:00 2001 From: Stephen O'Brien Date: Sun, 17 Dec 2017 23:20:08 +0000 Subject: [PATCH] Safe area view: support animated style values (#3124) * Use Animated.View instead of View in SafeAreaView This allows passing animated style properties in certain contexts, as previously supported. * Update some test snapshots --- .../__snapshots__/DrawerNavigator-test.js.snap | 2 ++ .../__snapshots__/StackNavigator-test.js.snap | 2 ++ .../__tests__/__snapshots__/TabNavigator-test.js.snap | 1 + src/views/SafeAreaView.js | 10 +++++----- src/views/__tests__/__snapshots__/TabView-test.js.snap | 1 + 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/navigators/__tests__/__snapshots__/DrawerNavigator-test.js.snap b/src/navigators/__tests__/__snapshots__/DrawerNavigator-test.js.snap index 36f96f2e..1f5a0e1e 100644 --- a/src/navigators/__tests__/__snapshots__/DrawerNavigator-test.js.snap +++ b/src/navigators/__tests__/__snapshots__/DrawerNavigator-test.js.snap @@ -137,6 +137,7 @@ exports[`DrawerNavigator renders successfully 1`] = ` } > {this.props.children}; + return {this.props.children}; } const safeAreaStyle = this._getSafeAreaStyle(); return ( - (this.view = c)} onLayout={this._onLayout} style={safeAreaStyle} > {this.props.children} - + ); } @@ -130,7 +130,7 @@ class SafeView extends Component { const WIDTH = isLandscape ? X_HEIGHT : X_WIDTH; const HEIGHT = isLandscape ? X_WIDTH : X_HEIGHT; - this.view.measureInWindow((winX, winY, winWidth, winHeight) => { + this.view._component.measureInWindow((winX, winY, winWidth, winHeight) => { let realY = winY; let realX = winX; diff --git a/src/views/__tests__/__snapshots__/TabView-test.js.snap b/src/views/__tests__/__snapshots__/TabView-test.js.snap index f8dad4af..41bf8a5f 100644 --- a/src/views/__tests__/__snapshots__/TabView-test.js.snap +++ b/src/views/__tests__/__snapshots__/TabView-test.js.snap @@ -25,6 +25,7 @@ exports[`TabBarBottom renders successfully 1`] = ` style={undefined} >