mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-13 09:39:18 +08:00
18 lines
443 B
TypeScript
18 lines
443 B
TypeScript
import { I18nManager } from 'react-native';
|
|
import { GestureDirection } from '../types';
|
|
|
|
export default function getInvertedMultiplier(
|
|
gestureDirection: GestureDirection
|
|
): 1 | -1 {
|
|
switch (gestureDirection) {
|
|
case 'vertical':
|
|
return 1;
|
|
case 'vertical-inverted':
|
|
return -1;
|
|
case 'horizontal':
|
|
return I18nManager.isRTL ? -1 : 1;
|
|
case 'horizontal-inverted':
|
|
return I18nManager.isRTL ? 1 : -1;
|
|
}
|
|
}
|