diff --git a/doc/PARALLAX_IMAGE.md b/doc/PARALLAX_IMAGE.md index 1ea9456f6..4be6d3498 100644 --- a/doc/PARALLAX_IMAGE.md +++ b/doc/PARALLAX_IMAGE.md @@ -14,6 +14,7 @@ Prop | Description | Type | Default `parallaxFactor` | Speed of the parallax effect. Be aware that the bigger the value, the more image will appear "zoomed in". | Number | `0.3` `showSpinner` | Whether to display a spinner while image is loading or not | Boolean | `true` `spinnerColor` | Color of the spinner | String | 'rgba(0, 0, 0, 0.4)' +`AnimatedImageComponent` | Custom animated image component | Function Object | `Animated.Image` All [`` props](https://facebook.github.io/react-native/docs/image.html#props) are also inherited, **particularly `source` which is required**. diff --git a/src/parallaximage/ParallaxImage.js b/src/parallaximage/ParallaxImage.js index 89948c421..8bc774a10 100644 --- a/src/parallaximage/ParallaxImage.js +++ b/src/parallaximage/ParallaxImage.js @@ -24,7 +24,11 @@ export default class ParallaxImage extends Component { fadeDuration: PropTypes.number, parallaxFactor: PropTypes.number, showSpinner: PropTypes.bool, - spinnerColor: PropTypes.string + spinnerColor: PropTypes.string, + AnimatedImageComponent: PropTypes.oneOfType([ + PropTypes.func, + PropTypes.object + ]) }; static defaultProps = { @@ -32,7 +36,8 @@ export default class ParallaxImage extends Component { fadeDuration: 500, parallaxFactor: 0.3, showSpinner: true, - spinnerColor: 'rgba(0, 0, 0, 0.4)' + spinnerColor: 'rgba(0, 0, 0, 0.4)', + AnimatedImageComponent: Animated.Image } constructor (props) { @@ -146,6 +151,7 @@ export default class ParallaxImage extends Component { sliderHeight, parallaxFactor, style, + AnimatedImageComponent, ...other } = this.props; @@ -174,7 +180,7 @@ export default class ParallaxImage extends Component { }; return ( -