From 57070e1cc413d3aec2a6af802d2774537fe4fd25 Mon Sep 17 00:00:00 2001 From: Joel Arvidsson Date: Thu, 5 Nov 2015 17:44:38 -0500 Subject: [PATCH] Removed bouncing effect on progress to solve a bug with bar width sometimes starting out at 100%. --- Bar.js | 3 ++- makeAnimatable.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Bar.js b/Bar.js index 716cfae..b9b3843 100644 --- a/Bar.js +++ b/Bar.js @@ -68,6 +68,7 @@ var ProgressBar = React.createClass({ if(props.animated) { Animated.spring(this.state.progress, { toValue: progress, + bounciness: 0, }).start(); } else { this.state.progress.setValue(progress); @@ -117,7 +118,7 @@ var ProgressBar = React.createClass({ height, width: this.state.progress.interpolate({ inputRange: [0, 1], - outputRange: [2, width], + outputRange: [0, width], }), transform: [{ translateX: this.state.animationValue.interpolate({ diff --git a/makeAnimatable.js b/makeAnimatable.js index 121efce..ac70628 100644 --- a/makeAnimatable.js +++ b/makeAnimatable.js @@ -53,6 +53,7 @@ var makeAnimatable = function(Component, indeterminateProgress) { if(props.animated) { Animated.spring(this.state.animationValue, { toValue: progress, + bounciness: 0, }).start(); } else { this.setState({ progress });