Skip to content

Commit 6a38370

Browse files
matinzdoblador
authored andcommitted
Support RTL for Progress.Bar (#171)
1 parent 88695f5 commit 6a38370

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Bar.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
3-
import { Animated, Easing, View } from 'react-native';
3+
import { Animated, Easing, View, I18nManager } from 'react-native';
44

55
const INDETERMINATE_WIDTH_FACTOR = 0.3;
66
const BAR_WIDTH_ZERO_POSITION =
@@ -152,7 +152,7 @@ export default class ProgressBar extends Component {
152152
{
153153
translateX: this.state.progress.interpolate({
154154
inputRange: [0, 1],
155-
outputRange: [innerWidth / -2, 0],
155+
outputRange: [innerWidth / (I18nManager.isRTL ? 2 : -2), 0],
156156
}),
157157
},
158158
{
@@ -176,4 +176,4 @@ export default class ProgressBar extends Component {
176176
</View>
177177
);
178178
}
179-
}
179+
}

0 commit comments

Comments
 (0)