From 15e585d8e04d44b8e09da638e82d2bd591773a58 Mon Sep 17 00:00:00 2001 From: Logan Bernard Date: Tue, 12 May 2015 12:46:56 -0400 Subject: [PATCH] FloatFromLeft animation --- .../Navigator/NavigatorSceneConfigs.js | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js b/Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js index 3b4666b9388ce5..ed295346d048b5 100644 --- a/Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js +++ b/Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js @@ -101,6 +101,18 @@ var FadeToTheLeft = { }, }; +var FadeToTheRight = { + ...FadeToTheLeft, + transformTranslate: { + from: {x: 0, y: 0, z: 0}, + to: {x: Math.round(SCREEN_WIDTH * 0.3), y: 0, z: 0}, + }, + translateX: { + from: 0, + to: Math.round(SCREEN_WIDTH * 0.3), + } +}; + var FadeIn = { opacity: { from: 0, @@ -187,6 +199,27 @@ var FromTheRight = { }, }; +var FromTheLeft = { + ...FromTheRight, + transformTranslate: { + from: {x: -SCREEN_WIDTH, y: 0, z: 0}, + to: {x: 0, y: 0, z: 0}, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PixelRatio.get(), + }, + translateX: { + from: -SCREEN_WIDTH, + to: 0, + min: 0, + max: 1, + type: 'linear', + extrapolate: true, + round: PixelRatio.get(), + }, +}; var ToTheBack = { // Rotate *requires* you to break out each individual component of @@ -374,6 +407,13 @@ var NavigatorSceneConfigs = { ...BaseConfig, // We will want to customize this soon }, + FloatFromLeft: { + ...BaseConfig, + animationInterpolators: { + into: buildStyleInterpolator(FromTheLeft), + out: buildStyleInterpolator(FadeToTheRight), + }, + }, FloatFromBottom: { ...BaseConfig, gestures: {