mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-03 15:24:58 +08:00
Reverted commit D3334273
Reviewed By: astreet Differential Revision: D3334273 fbshipit-source-id: a3849604ea89db74900850c294685e7da9aeeacc
This commit is contained in:
committed by
Facebook Github Bot 7
parent
757ab0b936
commit
705daabbb1
@@ -11,17 +11,17 @@ package com.facebook.react.modules.i18nmanager;
|
||||
|
||||
import com.facebook.react.bridge.NativeModule;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.bridge.ReactContext;
|
||||
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
||||
import com.facebook.react.bridge.ReactMethod;
|
||||
import com.facebook.react.bridge.annotations.ReactModule;
|
||||
import com.facebook.react.common.MapBuilder;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* {@link NativeModule} that allows JS to set allowRTL and get isRTL status.
|
||||
*/
|
||||
@ReactModule(name = "I18nManager")
|
||||
public class I18nManagerModule extends ReactContextBaseJavaModule {
|
||||
|
||||
private final I18nUtil sharedI18nUtilInstance = I18nUtil.getInstance();
|
||||
@@ -30,12 +30,15 @@ public class I18nManagerModule extends ReactContextBaseJavaModule {
|
||||
super(reactContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "I18nManager";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getConstants() {
|
||||
final Map<String, Object> constants = MapBuilder.newHashMap();
|
||||
constants.put(
|
||||
"isRTL",
|
||||
sharedI18nUtilInstance.isRTL(
|
||||
constants.put("isRTL", sharedI18nUtilInstance.isRTL(
|
||||
getReactApplicationContext()
|
||||
));
|
||||
return constants;
|
||||
@@ -45,13 +48,15 @@ public class I18nManagerModule extends ReactContextBaseJavaModule {
|
||||
public void allowRTL(boolean value) {
|
||||
sharedI18nUtilInstance.allowRTL(
|
||||
getReactApplicationContext(),
|
||||
value);
|
||||
value
|
||||
);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void forceRTL(boolean value) {
|
||||
sharedI18nUtilInstance.forceRTL(
|
||||
getReactApplicationContext(),
|
||||
value);
|
||||
value
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user