Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ export class ProgressCircle extends Component {
super(props, context);

this.progressValue = 0;
if (props.animated) {
this.progressValue = props.progress._value;
}
}

componentWillMount() {
Expand Down
7 changes: 6 additions & 1 deletion withAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function withAnimation(WrappedComponent, indeterminateProgress) {
constructor(props) {
super(props);

this.progressValue = Math.min(Math.max(props.progress, 0), 1);
this.progressValue = 0;
this.rotationValue = 0;
this.state = {
progress: new Animated.Value(this.progressValue),
Expand All @@ -33,6 +33,7 @@ export default function withAnimation(WrappedComponent, indeterminateProgress) {
}

componentDidMount() {
this.updateProgress(this.props);
this.state.progress.addListener(event => {
this.progressValue = event.value;
});
Expand Down Expand Up @@ -68,6 +69,10 @@ export default function withAnimation(WrappedComponent, indeterminateProgress) {
});
}
}
this.updateProgress(props)
}

updateProgress(props) {
const progress = props.indeterminate
? indeterminateProgress || 0
: Math.min(Math.max(props.progress, 0), 1);
Expand Down