Bump shadow radius, fix velocity thresholds on release, speed up goBack spring

This commit is contained in:
Brent Vatne 2018-10-02 14:56:55 -07:00
parent 089173f50c
commit f334c7645a
2 changed files with 6 additions and 6 deletions

View File

@ -62,7 +62,7 @@ const styles = StyleSheet.create({
backgroundColor: '#E9E9EF', backgroundColor: '#E9E9EF',
shadowColor: '#000', shadowColor: '#000',
shadowOffset: { width: -4, height: 0 }, shadowOffset: { width: -4, height: 0 },
shadowRadius: 5, shadowRadius: 6,
}, },
transparent: { transparent: {
...StyleSheet.absoluteFillObject, ...StyleSheet.absoluteFillObject,

View File

@ -223,7 +223,7 @@ class StackViewLayout extends React.Component {
if (Platform.OS === 'ios' && supportsImprovedSpringAnimation()) { if (Platform.OS === 'ios' && supportsImprovedSpringAnimation()) {
Animated.spring(position, { Animated.spring(position, {
toValue, toValue,
stiffness: 5000, stiffness: 8000,
damping: 600, damping: 600,
mass: 3, mass: 3,
useNativeDriver: USE_NATIVE_DRIVER, useNativeDriver: USE_NATIVE_DRIVER,
@ -500,12 +500,12 @@ class StackViewLayout extends React.Component {
this.setState({ gesturePosition: null }, () => { this.setState({ gesturePosition: null }, () => {
// If the speed of the gesture release is significant, use that as the indication // If the speed of the gesture release is significant, use that as the indication
// of intent // of intent
if (gestureVelocity < -0.5) { if (gestureVelocity < -50) {
this.props.onGestureCanceled && this.props.onGestureCanceled(); this.props.onGestureCanceled && this.props.onGestureCanceled();
this._reset(immediateIndex, resetDuration); this._reset(immediateIndex, resetDuration);
return; return;
} }
if (gestureVelocity > 0.5) { if (gestureVelocity > 50) {
this.props.onGestureFinish && this.props.onGestureFinish(); this.props.onGestureFinish && this.props.onGestureFinish();
this._goBack(immediateIndex, goBackDuration); this._goBack(immediateIndex, goBackDuration);
return; return;
@ -546,12 +546,12 @@ class StackViewLayout extends React.Component {
this.setState({ gesturePosition: null }, () => { this.setState({ gesturePosition: null }, () => {
// If the speed of the gesture release is significant, use that as the indication // If the speed of the gesture release is significant, use that as the indication
// of intent // of intent
if (gestureVelocity < -0.5) { if (gestureVelocity < -50) {
this.props.onGestureCanceled && this.props.onGestureCanceled(); this.props.onGestureCanceled && this.props.onGestureCanceled();
this._reset(immediateIndex, resetDuration); this._reset(immediateIndex, resetDuration);
return; return;
} }
if (gestureVelocity > 0.5) { if (gestureVelocity > 50) {
this.props.onGestureFinish && this.props.onGestureFinish(); this.props.onGestureFinish && this.props.onGestureFinish();
this._goBack(immediateIndex, goBackDuration); this._goBack(immediateIndex, goBackDuration);
return; return;