Skip to content

Commit

Permalink
Merge pull request #18 from stoneman1/master
Browse files Browse the repository at this point in the history
Add possibility to change header title animated view style
  • Loading branch information
kyaroru authored Apr 5, 2019
2 parents 4fc2c72 + 9922a1d commit 38ada5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ render() {
| `statusBarColor` | `string` | No | This is the status bar color (for android) navBarColor will be used if no statusBarColor is passed in | Default to `null` |
| `title` | `any` | No | This is the title to be display in the header, can be string or component | Default to `null` |
| `titleStyle` | `style` | No | This is the title style to override default font size/color | Default to `color: ‘white’ `text and `fontSize: 16` |
| `headerTitleStyle` | `style` | No | This is the header title animated view style to override default `<Animated.View>` style | Default to `null` |
| `scrollEventThrottle` | `number` | No | This is the scroll event throttle | Default is `16` |
| `contentContainerStyle` | `style` | No | This is the contentContainerStyle style to override default `<ScrollView>` contentContainerStyle style | Default to null |
| `containerStyle` | `style` | No | This is the style to override default outermost `<View>` style | Default to null |
Expand Down
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class RNParallax extends Component {
}

renderHeaderTitle() {
const { title, titleStyle } = this.props;
const { title, titleStyle, headerTitleStyle } = this.props;
const titleTranslateY = this.getTitleTranslateY();
const titleOpacity = this.getTitleOpacity();

Expand All @@ -283,6 +283,7 @@ class RNParallax extends Component {
height: this.getHeaderHeight(),
opacity: titleOpacity,
},
headerTitleStyle
]}
>
{typeof title === 'string'
Expand Down Expand Up @@ -363,6 +364,7 @@ RNParallax.propTypes = {
navbarColor: PropTypes.string,
title: PropTypes.any,
titleStyle: PropTypes.any,
headerTitleStyle: PropTypes.any,
headerMaxHeight: PropTypes.number,
headerMinHeight: PropTypes.number,
scrollEventThrottle: PropTypes.number,
Expand All @@ -385,6 +387,7 @@ RNParallax.defaultProps = {
backgroundImage: null,
title: null,
titleStyle: styles.headerText,
headerTitleStyle: null,
headerMaxHeight: DEFAULT_HEADER_MAX_HEIGHT,
headerMinHeight: DEFAULT_HEADER_MIN_HEIGHT,
scrollEventThrottle: SCROLL_EVENT_THROTTLE,
Expand Down

0 comments on commit 38ada5f

Please sign in to comment.