From cd78bf1c0168affa83164fcf352b806fdd5fbc6d Mon Sep 17 00:00:00 2001 From: list Date: Thu, 31 Mar 2022 14:56:42 +0200 Subject: [PATCH] Add RTL support --- FlipToggle.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/FlipToggle.js b/FlipToggle.js index 11f6f3e..86c0a56 100644 --- a/FlipToggle.js +++ b/FlipToggle.js @@ -13,7 +13,8 @@ import { TouchableOpacity, Image, Animated, - Easing + Easing, + I18nManager, } from 'react-native'; import PropTypes from 'prop-types'; @@ -111,7 +112,7 @@ class FlipToggle extends React.Component { toValue = 0; } Animated.timing(this.offsetX, { - toValue: toValue, + toValue: I18nManager.isRTL?toValue *-1 :toValue, duration: 300, useNativeDriver: true, }).start();