From 1b2e064ead195197f54aba8684b94efe36f6850a Mon Sep 17 00:00:00 2001 From: Michael Palmes Date: Sat, 15 Sep 2018 23:26:03 -0600 Subject: [PATCH 1/2] Added window dimensions for iPhone XS Max and iPhone XR --- src/views/StackView/StackViewLayout.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/views/StackView/StackViewLayout.js b/src/views/StackView/StackViewLayout.js index cbc7af6d3..e4d4ce27f 100644 --- a/src/views/StackView/StackViewLayout.js +++ b/src/views/StackView/StackViewLayout.js @@ -33,7 +33,10 @@ const IS_IPHONE_X = Platform.OS === 'ios' && !Platform.isPad && !Platform.isTVOS && - (WINDOW_HEIGHT === 812 || WINDOW_WIDTH === 812); + (WINDOW_HEIGHT === 812 || + WINDOW_WIDTH === 812 || + WINDOW_HEIGHT === 896 || + WINDOW_WIDTH === 896); const EaseInOut = Easing.inOut(Easing.ease); From 93784154c51bfbcf83cf41e13c3fb60a37a2884b Mon Sep 17 00:00:00 2001 From: Michael Palmes Date: Sun, 16 Sep 2018 10:24:59 -0600 Subject: [PATCH 2/2] Added constants for the two iPhone X/XS/XR dimensions and comments --- src/views/StackView/StackViewLayout.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/views/StackView/StackViewLayout.js b/src/views/StackView/StackViewLayout.js index e4d4ce27f..ca28b80f1 100644 --- a/src/views/StackView/StackViewLayout.js +++ b/src/views/StackView/StackViewLayout.js @@ -28,15 +28,17 @@ import { supportsImprovedSpringAnimation } from '../../utils/ReactNativeFeatures const emptyFunction = () => {}; +const IPHONE_XS_HEIGHT = 812; // iPhone X and XS +const IPHONE_XR_HEIGHT = 896; // iPhone XR and XS Max const { width: WINDOW_WIDTH, height: WINDOW_HEIGHT } = Dimensions.get('window'); const IS_IPHONE_X = Platform.OS === 'ios' && !Platform.isPad && !Platform.isTVOS && - (WINDOW_HEIGHT === 812 || - WINDOW_WIDTH === 812 || - WINDOW_HEIGHT === 896 || - WINDOW_WIDTH === 896); + (WINDOW_HEIGHT === IPHONE_XS_HEIGHT || + WINDOW_WIDTH === IPHONE_XS_HEIGHT || + WINDOW_HEIGHT === IPHONE_XR_HEIGHT || + WINDOW_WIDTH === IPHONE_XR_HEIGHT); const EaseInOut = Easing.inOut(Easing.ease);