1 | import { I18nManager } from 'react-native';
|
2 |
|
3 | import type { GestureDirection } from '../types';
|
4 |
|
5 | export default function getInvertedMultiplier(
|
6 | gestureDirection: GestureDirection
|
7 | ): 1 | -1 {
|
8 | switch (gestureDirection) {
|
9 | case 'vertical':
|
10 | return 1;
|
11 | case 'vertical-inverted':
|
12 | return -1;
|
13 | case 'horizontal':
|
14 | return I18nManager.getConstants().isRTL ? -1 : 1;
|
15 | case 'horizontal-inverted':
|
16 | return I18nManager.getConstants().isRTL ? 1 : -1;
|
17 | }
|
18 | }
|