Skip to content

Commit

Permalink
Add props useNativeDriver in CircleSnail (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiendn authored Apr 6, 2020
1 parent 8cfca24 commit b059d9d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CircleSnail.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default class CircleSnail extends Component {
style: PropTypes.any,
thickness: PropTypes.number,
strokeCap: PropTypes.string,
useNativeDriver: PropTypes.bool,
};

static defaultProps = {
Expand All @@ -36,6 +37,7 @@ export default class CircleSnail extends Component {
size: 40,
thickness: 3,
strokeCap: 'round',
useNativeDriver: false,
};

constructor(props) {
Expand Down Expand Up @@ -74,12 +76,14 @@ export default class CircleSnail extends Component {
duration: this.props.duration || 1000,
isInteraction: false,
easing: Easing.inOut(Easing.quad),
useNativeDriver: this.props.useNativeDriver,
}),
Animated.timing(this.state.endAngle, {
toValue: -MAX_ARC_ANGLE * iteration,
duration: this.props.duration || 1000,
isInteraction: false,
easing: Easing.inOut(Easing.quad),
useNativeDriver: this.props.useNativeDriver,
}),
]).start(endState => {
if (endState.finished) {
Expand Down

0 comments on commit b059d9d

Please sign in to comment.