mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-02 23:05:01 +08:00
Convert modules to use @ReactModule instead of getName()
Reviewed By: astreet Differential Revision: D3334273 fbshipit-source-id: a33bf72c5c184844885ef3ef610a05d9c102c8ea
This commit is contained in:
committed by
Facebook Github Bot 2
parent
9965642ebc
commit
c64213653e
@@ -12,6 +12,7 @@ package com.facebook.react.modules.systeminfo;
|
||||
import android.os.Build;
|
||||
|
||||
import com.facebook.react.bridge.BaseJavaModule;
|
||||
import com.facebook.react.bridge.annotations.ReactModule;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -21,13 +22,9 @@ import javax.annotation.Nullable;
|
||||
/**
|
||||
* Module that exposes Android Constants to JS.
|
||||
*/
|
||||
@ReactModule(name = "AndroidConstants")
|
||||
public class AndroidInfoModule extends BaseJavaModule {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "AndroidConstants";
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Map<String, Object> getConstants() {
|
||||
HashMap<String, Object> constants = new HashMap<String, Object>();
|
||||
|
||||
Reference in New Issue
Block a user