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;
|
const BACKGROUND_OFFSET = Dimensions.get('window').width;
|
||||||
function forBackground(props) {
|
function forBackgroundWithTranslation(props) {
|
||||||
const { position, scene } = props;
|
const { position, scene } = props;
|
||||||
const interpolate = getSceneIndicesForInterpolationInputRange(props);
|
const interpolate = getSceneIndicesForInterpolationInputRange(props);
|
||||||
if (!interpolate) return { opacity: 0 };
|
if (!interpolate) return { opacity: 0 };
|
||||||
|
@ -354,4 +360,5 @@ export default {
|
||||||
forCenter,
|
forCenter,
|
||||||
forRight,
|
forRight,
|
||||||
forBackground,
|
forBackground,
|
||||||
|
forBackgroundWithTranslation,
|
||||||
};
|
};
|
||||||
|
|
|
@ -151,6 +151,7 @@ class StackViewLayout extends React.Component {
|
||||||
headerLeftInterpolator,
|
headerLeftInterpolator,
|
||||||
headerTitleInterpolator,
|
headerTitleInterpolator,
|
||||||
headerRightInterpolator,
|
headerRightInterpolator,
|
||||||
|
headerBackgroundInterpolator,
|
||||||
} = this._getTransitionConfig();
|
} = this._getTransitionConfig();
|
||||||
|
|
||||||
const { transitionProps, ...passProps } = this.props;
|
const { transitionProps, ...passProps } = this.props;
|
||||||
|
@ -168,6 +169,7 @@ class StackViewLayout extends React.Component {
|
||||||
leftInterpolator: headerLeftInterpolator,
|
leftInterpolator: headerLeftInterpolator,
|
||||||
titleInterpolator: headerTitleInterpolator,
|
titleInterpolator: headerTitleInterpolator,
|
||||||
rightInterpolator: headerRightInterpolator,
|
rightInterpolator: headerRightInterpolator,
|
||||||
|
backgroundInterpolator: headerBackgroundInterpolator,
|
||||||
})}
|
})}
|
||||||
</NavigationProvider>
|
</NavigationProvider>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue