Skip to content
Merged
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
13 changes: 9 additions & 4 deletions src/components/ProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
ViewStyle,
StyleProp,
LayoutChangeEvent,
I18nManager,
} from 'react-native';
import setColor from 'color';
import { withTheme } from '../core/theming';
Expand Down Expand Up @@ -44,6 +45,7 @@ type State = {

const INDETERMINATE_DURATION = 2000;
const INDETERMINATE_MAX_WIDTH = 0.6;
const { isRTL } = I18nManager;

/**
* Progress bar is an indicator used to present progress of some activity in the app.
Expand Down Expand Up @@ -187,14 +189,17 @@ class ProgressBar extends React.Component<Props, State> {
? {
inputRange: [0, 0.5, 1],
outputRange: [
-0.5 * width,
-0.5 * INDETERMINATE_MAX_WIDTH * width,
0.7 * width,
(isRTL ? 1 : -1) * 0.5 * width,
(isRTL ? 1 : -1) *
0.5 *
INDETERMINATE_MAX_WIDTH *
width,
(isRTL ? -1 : 1) * 0.7 * width,
],
}
: {
inputRange: [0, 1],
outputRange: [-0.5 * width, 0],
outputRange: [(isRTL ? 1 : -1) * 0.5 * width, 0],
}
),
},
Expand Down