From 3ecabca29fb6dbf80747880102fbf3cb32264b35 Mon Sep 17 00:00:00 2001 From: jamie Date: Sat, 3 Mar 2018 14:14:15 +0000 Subject: [PATCH] Add analytic spring parameters to AnimatedRe's Spring --- lib/js/src/animatedRe.js | 10 ++++++++-- src/animatedRe.re | 9 +++++++++ src/animatedRe.rei | 6 ++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/lib/js/src/animatedRe.js b/lib/js/src/animatedRe.js index 110152a14..6de73f4df 100644 --- a/lib/js/src/animatedRe.js +++ b/lib/js/src/animatedRe.js @@ -111,7 +111,7 @@ function animate(value, toValue, easing, duration, delay, isInteraction, useNati var Timing = /* module */[/* animate */animate]; -function animate$1(value, toValue, restDisplacementThreshold, overshootClamping, restSpeedThreshold, velocity, bounciness, speed, tension, friction, isInteraction, useNativeDriver, onComplete, iterations, _) { +function animate$1(value, toValue, restDisplacementThreshold, overshootClamping, restSpeedThreshold, velocity, bounciness, speed, tension, friction, stiffness, mass, damping, isInteraction, useNativeDriver, onComplete, iterations, _) { return ReactNative.Animated.spring(value, { toValue: toValue[1], restDisplacementThreshold: Js_undefined.fromOption(restDisplacementThreshold), @@ -122,6 +122,9 @@ function animate$1(value, toValue, restDisplacementThreshold, overshootClamping, speed: Js_undefined.fromOption(speed), tension: Js_undefined.fromOption(tension), friction: Js_undefined.fromOption(friction), + stiffness: Js_undefined.fromOption(stiffness), + mass: Js_undefined.fromOption(mass), + damping: Js_undefined.fromOption(damping), isInteraction: Js_undefined.fromOption(isInteraction), useNativeDriver: Js_undefined.fromOption(useNativeDriver), onComplete: Js_undefined.fromOption(onComplete), @@ -210,7 +213,7 @@ function animate$3(value, toValue, easing, duration, delay, isInteraction, useNa var Timing$1 = /* module */[/* animate */animate$3]; -function animate$4(value, toValue, restDisplacementThreshold, overshootClamping, restSpeedThreshold, velocity, bounciness, speed, tension, friction, isInteraction, useNativeDriver, onComplete, iterations, _) { +function animate$4(value, toValue, restDisplacementThreshold, overshootClamping, restSpeedThreshold, velocity, bounciness, speed, tension, friction, stiffness, mass, damping, isInteraction, useNativeDriver, onComplete, iterations, _) { return ReactNative.Animated.spring(value, { toValue: toValue[1], restDisplacementThreshold: Js_undefined.fromOption(restDisplacementThreshold), @@ -221,6 +224,9 @@ function animate$4(value, toValue, restDisplacementThreshold, overshootClamping, speed: Js_undefined.fromOption(speed), tension: Js_undefined.fromOption(tension), friction: Js_undefined.fromOption(friction), + stiffness: Js_undefined.fromOption(stiffness), + mass: Js_undefined.fromOption(mass), + damping: Js_undefined.fromOption(damping), isInteraction: Js_undefined.fromOption(isInteraction), useNativeDriver: Js_undefined.fromOption(useNativeDriver), onComplete: Js_undefined.fromOption(onComplete), diff --git a/src/animatedRe.re b/src/animatedRe.re index b6219debb..a931082d7 100644 --- a/src/animatedRe.re +++ b/src/animatedRe.re @@ -94,6 +94,9 @@ module Animations = { "speed": Js.undefined(float), "tension": Js.undefined(float), "friction": Js.undefined(float), + "stiffness": Js.undefined(float), + "mass": Js.undefined(float), + "damping": Js.undefined(float), "isInteraction": Js.undefined(Js.boolean), "useNativeDriver": Js.undefined(Js.boolean), "onComplete": Js.undefined(Animation.endCallback), @@ -115,6 +118,9 @@ module Animations = { ~speed=?, ~tension=?, ~friction=?, + ~stiffness=?, + ~mass=?, + ~damping=?, ~isInteraction=?, ~useNativeDriver=?, ~onComplete=?, @@ -138,6 +144,9 @@ module Animations = { "speed": fromOption(speed), "tension": fromOption(tension), "friction": fromOption(friction), + "stiffness": fromOption(stiffness), + "mass": fromOption(mass), + "damping": fromOption(damping), "isInteraction": fromOption(isInteraction), "useNativeDriver": fromOption(useNativeDriver), "onComplete": fromOption(onComplete), diff --git a/src/animatedRe.rei b/src/animatedRe.rei index d9b70e10e..5ef1816c1 100644 --- a/src/animatedRe.rei +++ b/src/animatedRe.rei @@ -118,6 +118,9 @@ module Value: { ~speed: float=?, ~tension: float=?, ~friction: float=?, + ~stiffness: float=?, + ~mass: float=?, + ~damping: float=?, ~isInteraction: Js.boolean=?, ~useNativeDriver: Js.boolean=?, ~onComplete: Animation.endCallback=?, @@ -198,6 +201,9 @@ module ValueXY: { ~speed: float=?, ~tension: float=?, ~friction: float=?, + ~stiffness: float=?, + ~mass: float=?, + ~damping: float=?, ~isInteraction: Js.boolean=?, ~useNativeDriver: Js.boolean=?, ~onComplete: Animation.endCallback=?,