Default to not animating the header background but keep around the translation background interpolator
This commit is contained in:
parent
0235caa042
commit
2f42270bc5
|
@ -324,8 +324,14 @@ function forCenterFromLeft(props) {
|
|||
};
|
||||
}
|
||||
|
||||
// Default to no transition
|
||||
function forBackground() {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Translate the background with the card
|
||||
const BACKGROUND_OFFSET = Dimensions.get('window').width;
|
||||
function forBackground(props) {
|
||||
function forBackgroundWithTranslation(props) {
|
||||
const { position, scene } = props;
|
||||
const interpolate = getSceneIndicesForInterpolationInputRange(props);
|
||||
if (!interpolate) return { opacity: 0 };
|
||||
|
@ -354,4 +360,5 @@ export default {
|
|||
forCenter,
|
||||
forRight,
|
||||
forBackground,
|
||||
forBackgroundWithTranslation,
|
||||
};
|
||||
|
|
|
@ -151,6 +151,7 @@ class StackViewLayout extends React.Component {
|
|||
headerLeftInterpolator,
|
||||
headerTitleInterpolator,
|
||||
headerRightInterpolator,
|
||||
headerBackgroundInterpolator,
|
||||
} = this._getTransitionConfig();
|
||||
|
||||
const { transitionProps, ...passProps } = this.props;
|
||||
|
@ -168,6 +169,7 @@ class StackViewLayout extends React.Component {
|
|||
leftInterpolator: headerLeftInterpolator,
|
||||
titleInterpolator: headerTitleInterpolator,
|
||||
rightInterpolator: headerRightInterpolator,
|
||||
backgroundInterpolator: headerBackgroundInterpolator,
|
||||
})}
|
||||
</NavigationProvider>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue