From ab52de630018cdc64bdbcd4c9e33e0a6af3edbc7 Mon Sep 17 00:00:00 2001 From: Fred Liu Date: Wed, 15 Jun 2016 19:02:35 -0700 Subject: [PATCH] More sensitive swipe gesture recognition Summary: I noticed sometimes the swipeable row prioritizes the list view's vertical scroll too much, or returns to closed position if swiped a little distance but at high velocity. These new thresholds help both cases. Reviewed By: hedgerwang Differential Revision: D3441994 fbshipit-source-id: 84a9fdf63a33b3047a9a0205e87d8c489e9a6631 --- Libraries/Experimental/SwipeableRow/SwipeableRow.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/Experimental/SwipeableRow/SwipeableRow.js b/Libraries/Experimental/SwipeableRow/SwipeableRow.js index c4e0f84d6..39ec4b219 100644 --- a/Libraries/Experimental/SwipeableRow/SwipeableRow.js +++ b/Libraries/Experimental/SwipeableRow/SwipeableRow.js @@ -39,9 +39,9 @@ const emptyFunction = require('fbjs/lib/emptyFunction'); // Position of the left of the swipable item when closed const CLOSED_LEFT_POSITION = 0; // Minimum swipe distance before we recognize it as such -const HORIZONTAL_SWIPE_DISTANCE_THRESHOLD = 15; +const HORIZONTAL_SWIPE_DISTANCE_THRESHOLD = 10; // Minimum swipe speed before we fully animate the user's action (open/close) -const HORIZONTAL_FULL_SWIPE_SPEED_THRESHOLD = 0.5; +const HORIZONTAL_FULL_SWIPE_SPEED_THRESHOLD = 0.3; // Factor to divide by to get slow speed; i.e. 4 means 1/4 of full speed const SLOW_SPEED_SWIPE_FACTOR = 4; // Time, in milliseconds, of how long the animated swipe should be