mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-13 09:39:18 +08:00
Tweak spring configuration, in particular to make them settle more quickly
This commit is contained in:
@@ -174,9 +174,12 @@ class StackViewLayout extends React.Component {
|
||||
if (Platform.OS === 'ios' && supportsImprovedSpringAnimation()) {
|
||||
Animated.spring(this.props.transitionProps.position, {
|
||||
toValue: resetToIndex,
|
||||
stiffness: 5000,
|
||||
damping: 600,
|
||||
stiffness: 6000,
|
||||
damping: 100,
|
||||
mass: 3,
|
||||
overshootClamping: true,
|
||||
restDisplacementThreshold: 0.01,
|
||||
restSpeedThreshold: 0.01,
|
||||
useNativeDriver: USE_NATIVE_DRIVER,
|
||||
}).start();
|
||||
} else {
|
||||
@@ -215,8 +218,11 @@ class StackViewLayout extends React.Component {
|
||||
Animated.spring(position, {
|
||||
toValue,
|
||||
stiffness: 7000,
|
||||
damping: 600,
|
||||
damping: 300,
|
||||
mass: 3,
|
||||
overshootClamping: true,
|
||||
restDisplacementThreshold: 0.01,
|
||||
restSpeedThreshold: 0.01,
|
||||
useNativeDriver: USE_NATIVE_DRIVER,
|
||||
}).start(onCompleteAnimation);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user