Permalink
Browse files

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...
1 parent 0895070 commit 1888a0af16ea42736faa3d3e99f63cbbb84e2278 @nverdhan nverdhan committed with Facebook Github Bot Nov 10, 2016
@@ -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
@@ -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: {

1 comment on commit 1888a0a

@Pein892
Pein892 commented on 1888a0a Dec 5, 2016

nice!

Please sign in to comment.