|
2 | 2 | import React, { Component } from 'react'; |
3 | 3 | import PropTypes from 'prop-types'; |
4 | 4 | import { Animated, ScrollView, StyleSheet, View, Image, Dimensions } from 'react-native'; |
5 | | -import OverflowView from 'react-native-view-overflow'; |
6 | 5 | import type { ViewProps } from 'ViewPropTypes'; |
7 | 6 | import type { FlatList, SectionList, ListView } from 'react-native'; |
8 | 7 |
|
9 | | -const AnimatedOverflow = Animated.createAnimatedComponent(OverflowView); |
10 | | - |
11 | 8 | type ScrollViewProps = { |
12 | 9 | onScroll?: ?Function, |
13 | 10 | style?: $PropertyType<ViewProps, 'style'>, |
@@ -153,16 +150,18 @@ class ImageHeaderScrollView extends Component<Props, State> { |
153 | 150 | { opacity: overlayOpacity, backgroundColor: this.props.overlayColor }, |
154 | 151 | ]; |
155 | 152 |
|
| 153 | + const disableOverlay = |
| 154 | + this.props.minOverlayOpacity === this.props.maxOverlayOpacity && |
| 155 | + this.props.maxOverlayOpacity === 0; |
| 156 | + |
156 | 157 | return ( |
157 | | - <AnimatedOverflow |
158 | | - style={[styles.header, headerTransformStyle, this.props.headerContainerStyle]} |
159 | | - > |
| 158 | + <Animated.View style={[styles.header, headerTransformStyle, this.props.headerContainerStyle]}> |
160 | 159 | {this.renderHeaderProps()} |
161 | | - {!this.props.disableOverlay && <Animated.View style={overlayStyle} />} |
| 160 | + {!disableOverlay && <Animated.View style={overlayStyle} />} |
162 | 161 | <View style={[styles.fixedForeground, this.props.fixedForegroundContainerStyles]}> |
163 | 162 | {this.props.renderFixedForeground()} |
164 | 163 | </View> |
165 | | - </AnimatedOverflow> |
| 164 | + </Animated.View> |
166 | 165 | ); |
167 | 166 | } |
168 | 167 |
|
@@ -280,10 +279,6 @@ class ImageHeaderScrollView extends Component<Props, State> { |
280 | 279 | <ScrollViewComponent |
281 | 280 | scrollEventThrottle={useNativeDriver ? 1 : 16} |
282 | 281 | ref={ref => { |
283 | | - if (getScrollViewRef) { |
284 | | - getScrollViewRef(ref); |
285 | | - } |
286 | | - |
287 | 282 | this.scrollViewRef = ref; |
288 | 283 | }} |
289 | 284 | overScrollMode="never" |
|
0 commit comments