Skip to content

Commit

Permalink
More sensitive swipe gesture recognition
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fred2028 authored and Facebook Github Bot 6 committed Jun 16, 2016
1 parent 12a87b6 commit ab52de6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Libraries/Experimental/SwipeableRow/SwipeableRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ab52de6

Please sign in to comment.