diff --git a/app/navigation/router.js b/app/navigation/router.js index 56eb5966d..3382b1f6e 100644 --- a/app/navigation/router.js +++ b/app/navigation/router.js @@ -3,6 +3,7 @@ import React from 'react'; import { + Dimensions, Easing, NavigationExperimental, View @@ -18,6 +19,8 @@ import {getTheme} from 'service/selectors/entities/preferences'; import NavigationModal from './navigation_modal'; +const navigationPanResponder = NavigationExperimental.Card.CardStackPanResponder; + class Router extends React.Component { static propTypes = { navigation: React.PropTypes.object, @@ -102,9 +105,14 @@ class Router extends React.Component { }; } - // NavigationExperimental only creates the correct panHandlers if the panHandlers prop === undefined - const panHandlers = navigationProps.allowSceneSwipe ? undefined : null; // eslint-disable-line - + let panHandlers = null; + if (navigationProps.allowSceneSwipe) { + panHandlers = navigationPanResponder.forHorizontal({ + ...cardProps, + gestureResponseDistance: (Dimensions.get('window').width / 2), // sets the distance from the edge for swiping + onNavigateBack: this.props.actions.goBack + }); + } return (