react-native-marquee icon indicating copy to clipboard operation
react-native-marquee copied to clipboard

Easing InOut

Open SethHamilton opened this issue 7 years ago • 2 comments

It would appear that the easing options that go in reverse (inOut or back) result in an exception.

SethHamilton avatar Jul 19 '18 13:07 SethHamilton

Easing option was removed in v0.4.0 and set to linear: https://github.com/kyo504/react-native-marquee/blob/49db5bfef3cf0880e9f29f34b8fdb99ba937f4b2/index.tsx#L61

Could easing option please be added again? Linear looks a bit cheap...

rafaelmaeuer avatar May 02 '22 15:05 rafaelmaeuer

Easing InOut still missing in v0.5.0, @kyo504 any plans to bring it back or add a parameter to choose easing?

I am using the following package-patch for now:

diff --git a/node_modules/react-native-marquee/src/index.tsx b/node_modules/react-native-marquee/src/index.tsx
index 8c86195..e8379a3 100644
--- a/node_modules/react-native-marquee/src/index.tsx
+++ b/node_modules/react-native-marquee/src/index.tsx
@@ -68,7 +68,7 @@ const createAnimation = (
   },
 ): Animated.CompositeAnimation => {
   const baseAnimation = Animated.timing(animatedValue, {
-    easing: Easing.linear,
+    easing: Easing.inOut(Easing.ease),
     useNativeDriver: true,
     ...config,
   });
@@ -85,7 +85,7 @@ const createAnimation = (
               useNativeDriver: true,
             }),
             Animated.timing(animatedValue, {
-              easing: Easing.linear,
+              easing: Easing.inOut(Easing.ease),
               useNativeDriver: true,
               ...config,
               duration: consecutive.duration,

rafaelmaeuer avatar Mar 15 '23 16:03 rafaelmaeuer