react-native-text-ticker
Advanced tools
Comparing version 0.6.0 to 0.7.0
21
index.js
import React, { PureComponent } from 'react' | ||
import { | ||
Animated, | ||
Animated, | ||
Easing, | ||
StyleSheet, | ||
@@ -18,6 +19,3 @@ Text, | ||
static propTypes = { | ||
style: PropTypes.oneOfType([ | ||
PropTypes.object, | ||
PropTypes.array | ||
]), | ||
style: Text.propTypes.style, | ||
duration: PropTypes.number, | ||
@@ -31,3 +29,4 @@ loop: PropTypes.bool, | ||
children: PropTypes.string, | ||
repeatSpacer: PropTypes.number | ||
repeatSpacer: PropTypes.number, | ||
easing: PropTypes.func | ||
} | ||
@@ -43,3 +42,4 @@ | ||
useNativeDriver: true, | ||
repeatSpacer: 50 | ||
repeatSpacer: 50, | ||
easing: Easing.ease | ||
} | ||
@@ -75,3 +75,3 @@ | ||
animateScroll = () => { | ||
const {duration, marqueeDelay, loop, useNativeDriver, repeatSpacer, children} = this.props | ||
const {duration, marqueeDelay, loop, useNativeDriver, repeatSpacer, easing, children} = this.props | ||
this.setTimeout(() => { | ||
@@ -81,2 +81,3 @@ Animated.timing(this.animatedValue, { | ||
duration: duration || children.length * 150, | ||
easing: easing, | ||
useNativeDriver: useNativeDriver | ||
@@ -95,3 +96,3 @@ }).start(({ finished }) => { | ||
animateBounce = () => { | ||
const {duration, marqueeDelay, loop, useNativeDriver, children} = this.props | ||
const {duration, marqueeDelay, loop, useNativeDriver, easing, children} = this.props | ||
this.setTimeout(() => { | ||
@@ -102,2 +103,3 @@ Animated.sequence([ | ||
duration: duration || children.length * 50, | ||
easing: easing, | ||
useNativeDriver: useNativeDriver | ||
@@ -108,2 +110,3 @@ }), | ||
duration: duration || children.length * 50, | ||
easing: easing, | ||
useNativeDriver: useNativeDriver | ||
@@ -110,0 +113,0 @@ }) |
{ | ||
"name": "react-native-text-ticker", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "React Native Text Ticker/Marquee Component", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -74,2 +74,3 @@ # react-native-text-ticker | ||
| repeatSpacer | number | true | 50 | The space between the end of your text string ticker and the beginning of it starting again. | ||
| easing | function | true | Easing.ease | How the text scrolling animates. Additional options available from the [Easing module](https://facebook.github.io/react-native/docs/easing.html) | ||
@@ -76,0 +77,0 @@ ## Methods |
12242
233
87