diff --git a/src/index.js b/src/index.js index d0fffda..6d979a1 100644 --- a/src/index.js +++ b/src/index.js @@ -41,12 +41,11 @@ const IPropTypes = { renderScrollComponent: func, renderStickyHeader: func, stickyHeaderHeight: number, - contentContainerStyle: View.propTypes.style, - outputScaleValue: number, + stickyHeaderOffset: number, + stickyHeaderStyle: View.propTypes.style, parallaxHeaderContainerStyle: View.propTypes.style, parallaxHeaderStyle: View.propTypes.style, - backgroundImageStyle: View.propTypes.style, - stickyHeaderStyle: View.propTypes.style + backgroundImageStyle: View.propTypes.style } class ParallaxScrollView extends Component { @@ -92,6 +91,7 @@ class ParallaxScrollView extends Component { renderForeground, renderParallaxHeader, renderScrollComponent, + stickyHeaderOffset, renderStickyHeader, stickyHeaderHeight, style, @@ -127,6 +127,7 @@ class ParallaxScrollView extends Component { stickyHeaderHeight, backgroundColor, renderFixedHeader, + stickyHeaderOffset, renderStickyHeader }) const scrollElement = renderScrollComponent(scrollViewProps) @@ -377,6 +378,7 @@ class ParallaxScrollView extends Component { stickyHeaderHeight, backgroundColor, renderFixedHeader, + stickyHeaderOffset, renderStickyHeader }) { const { viewWidth } = this.state @@ -411,8 +413,8 @@ class ParallaxScrollView extends Component { transform: [ { translateY: interpolate(scrollY, { - inputRange: [0, p], - outputRange: [stickyHeaderHeight, 0], + inputRange: [0, p + (stickyHeaderOffset != null ? stickyHeaderOffset : 0)], + outputRange: [(stickyHeaderOffset != null ? parallaxHeaderHeight : stickyHeaderHeight), 0], extrapolate: 'clamp' }) } @@ -446,6 +448,7 @@ ParallaxScrollView.defaultProps = { renderParallaxHeader: renderEmpty, // Deprecated (will be removed in 0.18.0) renderForeground: null, stickyHeaderHeight: 0, + stickyHeaderOffset: null, contentContainerStyle: null, outputScaleValue: 5, parallaxHeaderContainerStyle: null,