mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-29 22:41:56 +08:00
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
This commit is contained in:
committed by
Facebook Github Bot 6
parent
12a87b6674
commit
ab52de6300
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user