mirror of
https://github.com/status-im/react-native.git
synced 2025-02-22 06:08:24 +00:00
Replace String with constants for Module names in Fb4aCoreInfraPackage
Summary: Using constants is safer than using strings. More details at D12843649 Reviewed By: sahrens Differential Revision: D8226521 fbshipit-source-id: 4c78c8dfe0bd658f46c8f81e50ceae9299fc6f3c
This commit is contained in:
parent
8d5d144046
commit
fe498096b6
@ -20,7 +20,7 @@ import javax.annotation.Nullable;
|
||||
@ReactModule(name = JSDevSupport.MODULE_NAME)
|
||||
public class JSDevSupport extends ReactContextBaseJavaModule {
|
||||
|
||||
static final String MODULE_NAME = "JSDevSupport";
|
||||
public static final String MODULE_NAME = "JSDevSupport";
|
||||
|
||||
public static final int ERROR_CODE_EXCEPTION = 0;
|
||||
public static final int ERROR_CODE_VIEW_NOT_FOUND = 1;
|
||||
|
@ -19,9 +19,11 @@ import java.util.Map;
|
||||
/**
|
||||
* {@link NativeModule} that allows JS to set allowRTL and get isRTL status.
|
||||
*/
|
||||
@ReactModule(name = "I18nManager")
|
||||
@ReactModule(name = I18nManagerModule.NAME)
|
||||
public class I18nManagerModule extends ContextBaseJavaModule {
|
||||
|
||||
public static final String NAME = "I18nManager";
|
||||
|
||||
private final I18nUtil sharedI18nUtilInstance = I18nUtil.getInstance();
|
||||
|
||||
public I18nManagerModule(Context context) {
|
||||
@ -30,7 +32,7 @@ public class I18nManagerModule extends ContextBaseJavaModule {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "I18nManager";
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -25,10 +25,10 @@ import com.facebook.react.modules.network.ForwardingCookieHandler;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.annotation.Nullable;
|
||||
import okhttp3.OkHttpClient;
|
||||
@ -38,9 +38,9 @@ import okhttp3.WebSocket;
|
||||
import okhttp3.WebSocketListener;
|
||||
import okio.ByteString;
|
||||
|
||||
@ReactModule(name = "WebSocketModule", hasConstants = false)
|
||||
@ReactModule(name = WebSocketModule.NAME, hasConstants = false)
|
||||
public final class WebSocketModule extends ReactContextBaseJavaModule {
|
||||
|
||||
public static final String NAME="WebSocketModule";
|
||||
public interface ContentHandler {
|
||||
void onMessage(String text, WritableMap params);
|
||||
|
||||
@ -67,7 +67,7 @@ public final class WebSocketModule extends ReactContextBaseJavaModule {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "WebSocketModule";
|
||||
return NAME;
|
||||
}
|
||||
|
||||
public void setContentHandler(final int id, final ContentHandler contentHandler) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user