Skip to content

Commit

Permalink
Support RTL for Progress.Bar (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
matinzd authored and oblador committed Dec 18, 2019
1 parent 88695f5 commit 6a38370
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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 } from 'react-native';
import { Animated, Easing, View, I18nManager } from 'react-native';

const INDETERMINATE_WIDTH_FACTOR = 0.3;
const BAR_WIDTH_ZERO_POSITION =
Expand Down Expand Up @@ -152,7 +152,7 @@ export default class ProgressBar extends Component {
{
translateX: this.state.progress.interpolate({
inputRange: [0, 1],
outputRange: [innerWidth / -2, 0],
outputRange: [innerWidth / (I18nManager.isRTL ? 2 : -2), 0],
}),
},
{
Expand All @@ -176,4 +176,4 @@ export default class ProgressBar extends Component {
</View>
);
}
}
}

0 comments on commit 6a38370

Please sign in to comment.