From 9ddc0788f3c9b372fc439784916bcc050196c95a Mon Sep 17 00:00:00 2001 From: Philip Heinser Date: Thu, 1 Dec 2016 02:19:46 +0100 Subject: [PATCH 1/5] allow hide with route.params.hideNavigationBar --- src/ExNavigationStack.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ExNavigationStack.js b/src/ExNavigationStack.js index 275ad70..b965bb5 100644 --- a/src/ExNavigationStack.js +++ b/src/ExNavigationStack.js @@ -720,6 +720,11 @@ class ExNavigationStack extends PureComponent { customHeight += route.getBarHeight(); hasCustomHeight = true; } + + if (_.isNumber(route.params.hideNavigationBar)) { + customHeight = 0; + hasCustomHeight = true; + } if (hasCustomHeight) { style = ([...style, {marginTop: customHeight}] : Array); From 61f45ca74a89e4709fed6bcf2b917b514e1757a6 Mon Sep 17 00:00:00 2001 From: Philip Heinser Date: Fri, 2 Dec 2016 16:32:51 +0100 Subject: [PATCH 2/5] Update ExNavigationStack.js --- src/ExNavigationStack.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ExNavigationStack.js b/src/ExNavigationStack.js index b965bb5..300c6eb 100644 --- a/src/ExNavigationStack.js +++ b/src/ExNavigationStack.js @@ -721,7 +721,7 @@ class ExNavigationStack extends PureComponent { hasCustomHeight = true; } - if (_.isNumber(route.params.hideNavigationBar)) { + if (route.params.hideNavigationBar) { customHeight = 0; hasCustomHeight = true; } From 536a2c939d14660679e128a8cdd02fb670b6e143 Mon Sep 17 00:00:00 2001 From: Philip Heinser Date: Wed, 13 Sep 2017 18:57:11 +0200 Subject: [PATCH 3/5] Update ExNavigationStack.js --- src/ExNavigationStack.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ExNavigationStack.js b/src/ExNavigationStack.js index 7d576a1..cef4a0d 100644 --- a/src/ExNavigationStack.js +++ b/src/ExNavigationStack.js @@ -3,7 +3,7 @@ */ import React from 'react'; -import { Animated, Platform, StyleSheet, View } from 'react-native'; +import { Animated, Platform, StyleSheet, View, Dimensions } from 'react-native'; import PropTypes from 'prop-types'; import NavigationExperimental from './navigation-experimental'; @@ -46,7 +46,10 @@ const DEFAULT_ROUTE_CONFIG: ExNavigationConfig = { : NavigationStyles.Fade, }; -const DEFAULT_STATUSBAR_HEIGHT = Platform.OS === 'ios' ? 20 : 25; +const dimentions = Dimensions.get('window') +const iphoneX = (dimentions.width === 375 || dimentions.width === 812) && (dimentions.height === 375 || dimentions.height === 812); +const STATUSBAR_IOS_HEIGHT = (iphoneX) ? 50 : 20; +const DEFAULT_STATUSBAR_HEIGHT = Platform.OS === 'ios' ? STATUSBAR_IOS_HEIGHT : 25; const STATUSBAR_HEIGHT = Platform.OS === 'ios' ? DEFAULT_STATUSBAR_HEIGHT : global.__exponent ? DEFAULT_STATUSBAR_HEIGHT : 0; From 890dae58f4ba40f008e6bd01c79e458cc36e6e23 Mon Sep 17 00:00:00 2001 From: Philip Heinser Date: Wed, 13 Sep 2017 18:59:49 +0200 Subject: [PATCH 4/5] Update ExNavigationBar.js --- src/ExNavigationBar.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ExNavigationBar.js b/src/ExNavigationBar.js index 7ef256a..7b99e1a 100644 --- a/src/ExNavigationBar.js +++ b/src/ExNavigationBar.js @@ -8,6 +8,7 @@ import { TouchableOpacity, View, ViewPropTypes, + Dimensions, } from 'react-native'; import PropTypes from 'prop-types'; import PureComponent from './utils/PureComponent'; @@ -27,9 +28,13 @@ if (expoModule) { // Exponent draws under the status bar on Android, but vanilla React Native does not. // So we need to factor the status bar height in with Exponent but can ignore it with // vanilla React Native -const STATUSBAR_HEIGHT = Platform.OS === 'ios' - ? 20 - : global.__exponent ? 24 : 0; +const dimentions = Dimensions.get('window'); +const iphoneX = + (dimentions.width === 375 || dimentions.width === 812) && + (dimentions.height === 375 || dimentions.height === 812); +const STATUSBAR_IOS_HEIGHT = iphoneX ? 50 : 20; +const STATUSBAR_HEIGHT = + Platform.OS === 'ios' ? STATUSBAR_IOS_HEIGHT : global.__exponent ? 24 : 0; const APPBAR_HEIGHT = Platform.OS === 'ios' ? 44 : 55; const BACKGROUND_COLOR = Platform.OS === 'ios' ? '#EFEFF2' : '#FFF'; From b46bfe7ff43f709a290d131f989e07753a44e597 Mon Sep 17 00:00:00 2001 From: Philip Heinser Date: Wed, 13 Sep 2017 19:10:41 +0200 Subject: [PATCH 5/5] Update ExNavigationTabBar.js --- src/tab/ExNavigationTabBar.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/tab/ExNavigationTabBar.js b/src/tab/ExNavigationTabBar.js index 8176f41..831c1f5 100644 --- a/src/tab/ExNavigationTabBar.js +++ b/src/tab/ExNavigationTabBar.js @@ -6,6 +6,8 @@ import { TouchableNativeFeedback, Text, View, + Dimensions, + Platform, } from 'react-native'; import { unsupportedNativeView } from '../ExUnsupportedNativeView'; @@ -22,7 +24,12 @@ if (expoModule) { import TabBadge from '../ExNavigationBadge'; -const DEFAULT_TAB_BAR_HEIGHT = 56; +const dimentions = Dimensions.get('window'); +const iphoneX = + (dimentions.width === 375 || dimentions.width === 812) && + (dimentions.height === 375 || dimentions.height === 812); + +const DEFAULT_TAB_BAR_HEIGHT = Platform.OS === 'ios' && iphoneX ? 80 : 49; export default class ExNavigationTabBar extends React.Component { static defaultHeight = DEFAULT_TAB_BAR_HEIGHT; @@ -154,6 +161,8 @@ const styles = StyleSheet.create({ itemContainer: { flex: 1, flexDirection: 'row', + alignItems: 'flex-start', + paddingTop: 1, }, tabItem: { flex: 1,