Skip to content

Commit 5ef3319

Browse files
author
Joshua Jahans
committed
use overflow views
1 parent 78419d3 commit 5ef3319

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-image-header-scroll-view-ep",
3-
"version": "0.0.6",
3+
"version": "0.0.7",
44
"description": "ScrollView with an image in header which become a navbar",
55
"main": "src/index.js",
66
"scripts": {
@@ -47,7 +47,8 @@
4747
"react-native": ">=0.20.0"
4848
},
4949
"dependencies": {
50-
"prop-types": "^15.6.0"
50+
"prop-types": "^15.6.0",
51+
"react-native-view-overflow": "^0.0.3"
5152
},
5253
"eslintConfig": {
5354
"extends": "bambi/native"

src/ImageHeaderScrollView.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
import React, { Component } from 'react';
33
import PropTypes from 'prop-types';
44
import { Animated, ScrollView, StyleSheet, View, Image, Dimensions } from 'react-native';
5+
import ViewOverflow from 'react-native-view-overflow';
56
import type { ViewProps } from 'ViewPropTypes';
67
import type { FlatList, SectionList, ListView } from 'react-native';
78

9+
const AnimatedViewOverflow = Animated.createAnimatedComponent(ViewOverflow);
10+
811
type ScrollViewProps = {
912
onScroll?: ?Function,
1013
style?: $PropertyType<ViewProps, 'style'>,
@@ -150,11 +153,11 @@ class ImageHeaderScrollView extends Component<Props, State> {
150153
];
151154

152155
return (
153-
<Animated.View style={[styles.header, headerTransformStyle, this.props.headerContainerStyle]}>
156+
<AnimatedViewOverflow style={[styles.header, headerTransformStyle, this.props.headerContainerStyle]}>
154157
{this.renderHeaderProps()}
155158
{!this.props.disableOverlay && <Animated.View style={overlayStyle} />}
156159
<View style={styles.fixedForeground}>{this.props.renderFixedForeground()}</View>
157-
</Animated.View>
160+
</AnimatedViewOverflow>
158161
);
159162
}
160163

@@ -175,9 +178,9 @@ class ImageHeaderScrollView extends Component<Props, State> {
175178
}
176179

177180
return (
178-
<Animated.View style={[styles.header, headerTransformStyle]}>
181+
<AnimatedViewOverflow style={[styles.header, headerTransformStyle]}>
179182
{this.props.renderForeground()}
180-
</Animated.View>
183+
</AnimatedViewOverflow>
181184
);
182185
}
183186

@@ -189,9 +192,9 @@ class ImageHeaderScrollView extends Component<Props, State> {
189192
}
190193

191194
return (
192-
<Animated.View style={[styles.header, styles.touchableFixedForeground, { height }]}>
195+
<AnimatedViewOverflow style={[styles.header, styles.touchableFixedForeground, { height }]}>
193196
{this.props.renderTouchableFixedForeground()}
194-
</Animated.View>
197+
</AnimatedViewOverflow>
195198
);
196199
}
197200

yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3344,6 +3344,10 @@ react-devtools-core@3.0.0:
33443344
shell-quote "^1.6.1"
33453345
ws "^2.0.3"
33463346

3347+
react-native-view-overflow@^0.0.3:
3348+
version "0.0.3"
3349+
resolved "https://registry.yarnpkg.com/react-native-view-overflow/-/react-native-view-overflow-0.0.3.tgz#d7b08e8c1e5047a2cf07f3ece82025899f930674"
3350+
33473351
react-native@0.52.2:
33483352
version "0.52.2"
33493353
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.52.2.tgz#1ae9a4c4441bd6e54a8ffc8aae4ac2b5c7cccd68"

0 commit comments

Comments
 (0)