react-native-text-ticker
Advanced tools
Comparing version 1.3.0 to 1.4.0
21
index.js
@@ -47,3 +47,4 @@ import React, { PureComponent } from 'react' | ||
shouldAnimateTreshold: PropTypes.number, | ||
disabled: PropTypes.bool | ||
disabled: PropTypes.bool, | ||
isRTL: PropTypes.bool | ||
} | ||
@@ -66,3 +67,4 @@ | ||
shouldAnimateTreshold: 0, | ||
disabled: false | ||
disabled: false, | ||
isRTL: undefined | ||
} | ||
@@ -166,6 +168,7 @@ | ||
scrollSpeed, | ||
onMarqueeComplete | ||
onMarqueeComplete, | ||
isRTL | ||
} = this.props | ||
this.setTimeout(() => { | ||
const scrollToValue = I18nManager.isRTL ? this.textWidth + repeatSpacer : -this.textWidth - repeatSpacer | ||
const scrollToValue = isRTL ?? I18nManager.isRTL ? this.textWidth + repeatSpacer : -this.textWidth - repeatSpacer | ||
if(!isNaN(scrollToValue)) { | ||
@@ -195,7 +198,7 @@ Animated.timing(this.animatedValue, { | ||
animateBounce = () => { | ||
const {duration, marqueeDelay, loop, isInteraction, useNativeDriver, easing, children, bounceSpeed} = this.props | ||
const {duration, marqueeDelay, loop, isInteraction, useNativeDriver, easing, bounceSpeed, isRTL} = this.props | ||
this.setTimeout(() => { | ||
Animated.sequence([ | ||
Animated.timing(this.animatedValue, { | ||
toValue: I18nManager.isRTL ? this.distance + 10 : -this.distance - 10, | ||
toValue: isRTL ?? I18nManager.isRTL ? this.distance + 10 : -this.distance - 10, | ||
duration: duration || (this.distance) * bounceSpeed, | ||
@@ -207,3 +210,3 @@ easing: easing, | ||
Animated.timing(this.animatedValue, { | ||
toValue: I18nManager.isRTL ? -10 : 10, | ||
toValue: isRTL ?? I18nManager.isRTL ? -10 : 10, | ||
duration: duration || (this.distance) * bounceSpeed, | ||
@@ -335,3 +338,3 @@ easing: easing, | ||
render() { | ||
const { style, children, repeatSpacer, scroll, shouldAnimateTreshold, disabled, ... props } = this.props | ||
const { style, children, repeatSpacer, scroll, shouldAnimateTreshold, disabled, isRTL, ... props } = this.props | ||
const { animating, contentFits, isScrolling } = this.state | ||
@@ -356,3 +359,3 @@ const additionalContainerStyle = { | ||
showsHorizontalScrollIndicator={false} | ||
style={[StyleSheet.absoluteFillObject, I18nManager.isRTL ? { flexDirection: 'row-reverse' } : null ]} | ||
style={[StyleSheet.absoluteFillObject, (isRTL ?? I18nManager.isRTL) && { flexDirection: 'row-reverse' } ]} | ||
display={animating ? 'flex' : 'none'} | ||
@@ -359,0 +362,0 @@ onContentSizeChange={() => this.calculateMetrics()} |
{ | ||
"name": "react-native-text-ticker", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "React Native Text Ticker/Marquee Component", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -23,2 +23,3 @@ declare module 'react-native-text-ticker' { | ||
shouldAnimateTreshold?: number; | ||
isRTL: boolean; | ||
} | ||
@@ -25,0 +26,0 @@ |
@@ -89,2 +89,3 @@ # react-native-text-ticker | ||
| disabled | boolean | true | false | Disables text animation | ||
| isRTL | boolean | true | false | If text is right to left (By default, it uses `I18nManager.isRTL` to check) | ||
@@ -91,0 +92,0 @@ ## Methods |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19608
403
102