Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a new Navigator SceneConfig swipeFromLeft
Summary:
Add a new `SwipeFromLeft` Navigator SceneConfig.

The animation is the opposite of `HorizontalSwipeJump`, however there's no `Jump` while animating as `HorizontalSwipeJump`.  Should `HorizontalSwipeJump` be renamed to `SwipeFromRight`?

![swipe-left-anim-2](https://cloud.githubusercontent.com/assets/8182981/18466947/8ca4dd24-79bb-11e6-8cae-8ffa34c0c7da.gif)
Closes #9877

Differential Revision: D4160059

Pulled By: hramos

fbshipit-source-id: 7426ec72adea80af2d5612aae1dd9d2e6dc090f3
  • Loading branch information
nverdhan authored and Facebook Github Bot committed Nov 10, 2016
1 parent 0895070 commit 1888a0a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions Libraries/CustomComponents/Navigator/Navigator.js
Expand Up @@ -314,6 +314,7 @@ var Navigator = React.createClass({
* - Navigator.SceneConfigs.FloatFromBottom
* - Navigator.SceneConfigs.FloatFromBottomAndroid
* - Navigator.SceneConfigs.FadeAndroid
* - Navigator.SceneConfigs.SwipeFromLeft
* - Navigator.SceneConfigs.HorizontalSwipeJump
* - Navigator.SceneConfigs.HorizontalSwipeJumpFromRight
* - Navigator.SceneConfigs.HorizontalSwipeJumpFromLeft
Expand Down
21 changes: 21 additions & 0 deletions Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js
Expand Up @@ -655,6 +655,27 @@ var NavigatorSceneConfigs = {
out: buildStyleInterpolator(FadeOut),
},
},
SwipeFromLeft: {
...BaseConfig,
gestures: {
jumpBack: {
...directionMapping.BaseEndToStartGesture,
overswipe: BaseOverswipeConfig,
edgeHitWidth: null,
isDetachable: true,
},
jumpForward: {
...directionMapping.BaseStartToEndGesture,
overswipe: BaseOverswipeConfig,
edgeHitWidth: null,
isDetachable: true,
},
},
animationInterpolators: {
into: buildStyleInterpolator(directionMapping.FromTheStart),
out: buildStyleInterpolator(directionMapping.ToTheEnd),
},
},
HorizontalSwipeJump: {
...BaseConfig,
gestures: {
Expand Down

1 comment on commit 1888a0a

@pein892
Copy link

@pein892 pein892 commented on 1888a0a Dec 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Please sign in to comment.