mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-03 15:24:58 +08:00
Provide RTL support for new Navigator -- Make RTL works in NUX
Summary: Provide RTL support in NavigationPager Reviewed By: fkgozali Differential Revision: D3536850 fbshipit-source-id: 29890a125dc5e001b4c10208cd53bfeca0d9b5c3
This commit is contained in:
committed by
Facebook Github Bot 3
parent
471ee87445
commit
38a6eec0db
@@ -32,6 +32,8 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const I18nManager = require('I18nManager');
|
||||
|
||||
import type {
|
||||
NavigationSceneRendererProps,
|
||||
} from 'NavigationTypeDefinition';
|
||||
@@ -87,11 +89,14 @@ function forHorizontal(props: NavigationSceneRendererProps): Object {
|
||||
|
||||
const index = scene.index;
|
||||
const inputRange = [index - 1, index, index + 1];
|
||||
|
||||
const width = layout.initWidth;
|
||||
const outputRange = I18nManager.isRTL ?
|
||||
([-width, 0, width]: Array<number>) :
|
||||
([width, 0, -width]: Array<number>);
|
||||
|
||||
const translateX = position.interpolate({
|
||||
inputRange,
|
||||
outputRange: ([width, 0, -width]: Array<number>),
|
||||
outputRange,
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user