From 839e533955c3ca95179df709468eff413996d558 Mon Sep 17 00:00:00 2001 From: Eric Vicenti Date: Wed, 8 Apr 2015 21:16:03 -0700 Subject: [PATCH] [ReactNative] Re-configure horizontal swipe animations --- .../Navigator/NavigatorSceneConfigs.js | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js b/Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js index 3072074b2..ac16542ad 100644 --- a/Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js +++ b/Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js @@ -34,7 +34,7 @@ var buildStyleInterpolator = require('buildStyleInterpolator'); var SCREEN_WIDTH = Dimensions.get('window').width; var SCREEN_HEIGHT = Dimensions.get('window').height; -var ToTheLeft = { +var FadeToTheLeft = { // Rotate *requires* you to break out each individual component of // rotation (x, y, z, w) transformTranslate: { @@ -101,6 +101,23 @@ var ToTheLeft = { }, }; +var ToTheLeft = { + transformTranslate: { + from: {x: 0, y: 0, z: 0}, + to: {x: -Dimensions.get('window').width, y: 0, z: 0}, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PixelRatio.get(), + }, + opacity: { + value: 1.0, + type: 'constant', + }, +}; + + var FromTheRight = { opacity: { value: 1.0, @@ -271,7 +288,7 @@ var BaseConfig = { // Animation interpolators for horizontal transitioning: animationInterpolators: { into: buildStyleInterpolator(FromTheRight), - out: buildStyleInterpolator(ToTheLeft), + out: buildStyleInterpolator(FadeToTheLeft), }, }; @@ -312,8 +329,12 @@ var NavigatorSceneConfigs = { overswipe: BaseOverswipeConfig, edgeHitWidth: null, }, - } - } + }, + animationInterpolators: { + into: buildStyleInterpolator(FromTheRight), + out: buildStyleInterpolator(ToTheLeft), + }, + }, }; module.exports = NavigatorSceneConfigs;