From f334c7645ae7d60558496ffefd43a40c85dcaab9 Mon Sep 17 00:00:00 2001 From: Brent Vatne Date: Tue, 2 Oct 2018 14:56:55 -0700 Subject: [PATCH] Bump shadow radius, fix velocity thresholds on release, speed up goBack spring --- src/views/StackView/StackViewCard.js | 2 +- src/views/StackView/StackViewLayout.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/views/StackView/StackViewCard.js b/src/views/StackView/StackViewCard.js index f950483..0c89468 100644 --- a/src/views/StackView/StackViewCard.js +++ b/src/views/StackView/StackViewCard.js @@ -62,7 +62,7 @@ const styles = StyleSheet.create({ backgroundColor: '#E9E9EF', shadowColor: '#000', shadowOffset: { width: -4, height: 0 }, - shadowRadius: 5, + shadowRadius: 6, }, transparent: { ...StyleSheet.absoluteFillObject, diff --git a/src/views/StackView/StackViewLayout.js b/src/views/StackView/StackViewLayout.js index 11b52ce..d39d6b9 100644 --- a/src/views/StackView/StackViewLayout.js +++ b/src/views/StackView/StackViewLayout.js @@ -223,7 +223,7 @@ class StackViewLayout extends React.Component { if (Platform.OS === 'ios' && supportsImprovedSpringAnimation()) { Animated.spring(position, { toValue, - stiffness: 5000, + stiffness: 8000, damping: 600, mass: 3, useNativeDriver: USE_NATIVE_DRIVER, @@ -500,12 +500,12 @@ class StackViewLayout extends React.Component { this.setState({ gesturePosition: null }, () => { // If the speed of the gesture release is significant, use that as the indication // of intent - if (gestureVelocity < -0.5) { + if (gestureVelocity < -50) { this.props.onGestureCanceled && this.props.onGestureCanceled(); this._reset(immediateIndex, resetDuration); return; } - if (gestureVelocity > 0.5) { + if (gestureVelocity > 50) { this.props.onGestureFinish && this.props.onGestureFinish(); this._goBack(immediateIndex, goBackDuration); return; @@ -546,12 +546,12 @@ class StackViewLayout extends React.Component { this.setState({ gesturePosition: null }, () => { // If the speed of the gesture release is significant, use that as the indication // of intent - if (gestureVelocity < -0.5) { + if (gestureVelocity < -50) { this.props.onGestureCanceled && this.props.onGestureCanceled(); this._reset(immediateIndex, resetDuration); return; } - if (gestureVelocity > 0.5) { + if (gestureVelocity > 50) { this.props.onGestureFinish && this.props.onGestureFinish(); this._goBack(immediateIndex, goBackDuration); return;