Skip to content
Open
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
22 changes: 7 additions & 15 deletions Bar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Animated, Easing, View, I18nManager } from 'react-native';
import { Animated, Easing, View } from 'react-native';

const INDETERMINATE_WIDTH_FACTOR = 0.3;
const BAR_WIDTH_ZERO_POSITION =
Expand Down Expand Up @@ -142,26 +142,18 @@ export default class ProgressBar extends Component {
const progressStyle = {
backgroundColor: color,
height,
borderRadius: 1000,
width: this.state.progress.interpolate({
inputRange: [0, 1],
outputRange: [0.0001, innerWidth]
}),
transform: [
{
translateX: this.state.animationValue.interpolate({
inputRange: [0, 1],
outputRange: [innerWidth * -INDETERMINATE_WIDTH_FACTOR, innerWidth],
}),
},
{
translateX: this.state.progress.interpolate({
inputRange: [0, 1],
outputRange: [innerWidth / (I18nManager.isRTL ? 2 : -2), 0],
}),
},
{
// Interpolation a temp workaround for https://github.com/facebook/react-native/issues/6278
scaleX: this.state.progress.interpolate({
inputRange: [0, 1],
outputRange: [0.0001, 1],
}),
},
],
};

Expand All @@ -176,4 +168,4 @@ export default class ProgressBar extends Component {
</View>
);
}
}
}