Animations interruptible with gesture and comment for more info
This commit is contained in:
parent
d789cd35f4
commit
52f9bcecd3
|
@ -446,10 +446,20 @@ class StackViewLayout extends React.Component {
|
||||||
this._handleReleaseHorizontal(nativeEvent);
|
this._handleReleaseHorizontal(nativeEvent);
|
||||||
}
|
}
|
||||||
} else if (nativeEvent.state === State.ACTIVE) {
|
} else if (nativeEvent.state === State.ACTIVE) {
|
||||||
// HACK if current is in animation don't start gesture
|
// Switch to using gesture position
|
||||||
if (!this.props.transitionProps.position._animation) {
|
|
||||||
this.positionSwitch.setValue(0);
|
this.positionSwitch.setValue(0);
|
||||||
}
|
|
||||||
|
// By enabling the gesture switch and ignoring the position here we
|
||||||
|
// end up with a quick jump to the initial value and then back to the
|
||||||
|
// gesture. While this isn't ideal, it's preferred over preventing new
|
||||||
|
// gestures during the animation (all gestures should be interruptible)
|
||||||
|
// and we will properly fix it (interruptible and from the correct position)
|
||||||
|
// when we integrate reanimated. If you prefer to prevent gestures during
|
||||||
|
// transitions, then fork this library, comment the positionSwitch value set above,
|
||||||
|
// and uncomment the following two lines.
|
||||||
|
// if (!this.props.transitionProps.position._animation) {
|
||||||
|
// this.positionSwitch.setValue(0);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue