Created
March 23, 2016 10:51
-
-
Save richardgill/25fd908503e77d966892 to your computer and use it in GitHub Desktop.
custom navigation animations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//in main app | |
configureScene(route, navigator) { | |
if (route.sceneConfig) { | |
return route.sceneConfig; | |
} | |
return CustomNavigatorSceneConfigs.HorizontalJump; | |
}, | |
//customNavigatorSceneConfigs.js | |
import React from 'react-native' | |
import _ from 'lodash' | |
var { | |
Navigator, | |
} = React; | |
var customNavigatorSceneConfigs = { | |
//Horizontal swipe jump but without gesture stuff. | |
HorizontalJump: _.merge(_.clone(Navigator.SceneConfigs.HorizontalSwipeJump), {gestures: null}), | |
VerticalUpJump: _.merge(_.clone(Navigator.SceneConfigs.VerticalUpSwipeJump), {gestures: null}) | |
} | |
export default customNavigatorSceneConfigs; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment