From ca71143ff4b8232ebdd06de1ddacffaaa8ae314f Mon Sep 17 00:00:00 2001 From: Fred Liu Date: Mon, 23 May 2016 10:21:07 -0700 Subject: [PATCH] Faster animation Summary: Reduce auto-swipe animation duration to 200 ms to increase swipe speed. Reviewed By: zjj010104 Differential Revision: D3333942 fbshipit-source-id: a9e0b15926ef854adcd9e1d2c1e67fd080139d84 --- Libraries/Experimental/SwipeableRow/SwipeableRow.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Libraries/Experimental/SwipeableRow/SwipeableRow.js b/Libraries/Experimental/SwipeableRow/SwipeableRow.js index e22c6878e..f0def1ac3 100644 --- a/Libraries/Experimental/SwipeableRow/SwipeableRow.js +++ b/Libraries/Experimental/SwipeableRow/SwipeableRow.js @@ -37,6 +37,8 @@ const emptyFunction = require('emptyFunction'); const CLOSED_LEFT_POSITION = 0; // Minimum swipe distance before we recognize it as such const HORIZONTAL_SWIPE_DISTANCE_THRESHOLD = 15; +// Time, in milliseconds, of how long the animated swipe should be +const SWIPE_DURATION = 200; /** * Creates a swipable row that allows taps on the main item and a custom View @@ -184,6 +186,7 @@ const SwipeableRow = React.createClass({ Animated.timing( this.state.currentLeft, { + duration: SWIPE_DURATION, toValue: toValue, }, ).start(() => {