From 3cb235113a5d56b02c6433b4c05d92bc942e0c30 Mon Sep 17 00:00:00 2001 From: Diamant Haxhimusa Date: Fri, 5 Oct 2018 09:55:48 +0200 Subject: [PATCH] Add RTL support --- src/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 62a1e9b..0a4d8da 100644 --- a/src/index.js +++ b/src/index.js @@ -6,6 +6,7 @@ import { Text, View, ViewPropTypes, + I18nManager, } from 'react-native' import PropTypes from 'prop-types' @@ -30,11 +31,13 @@ const styles = StyleSheet.create({ position: 'absolute', top: 0, left: 0, + right: 0 }, halfCircle: { position: 'absolute', top: 0, left: 0, + right: 0, borderTopRightRadius: 0, borderBottomRightRadius: 0, backgroundColor: '#f00', @@ -179,11 +182,10 @@ export default class PercentageCircle extends React.PureComponent { width: radius, height: radius * 2, borderRadius: radius, - backgroundColor, transform: [ - { translateX: radius / 2 }, + { translateX: I18nManager.isRTL ? -radius / 2 : radius / 2 }, { rotate }, - { translateX: -radius / 2 }, + { translateX: I18nManager.isRTL ? radius / 2 : -radius / 2 }, ], }, ]}