本文整理汇总了Java中com.facebook.react.bridge.NativeModule类的典型用法代码示例。如果您正苦于以下问题:Java NativeModule类的具体用法?Java NativeModule怎么用?Java NativeModule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NativeModule类属于com.facebook.react.bridge包,在下文中一共展示了NativeModule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import com.facebook.react.bridge.NativeModule; //导入依赖的package包/类
private NativeModule create() {
SoftAssertions.assertCondition(mModule == null, "Creating an already created module.");
ReactMarker.logMarker(CREATE_MODULE_START, mName);
SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "createModule")
.arg("name", mName)
.flush();
NativeModule module = assertNotNull(mProvider).get();
mProvider = null;
if (mInitializeNeeded) {
doInitialize(module);
mInitializeNeeded = false;
}
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
ReactMarker.logMarker(CREATE_MODULE_END);
return module;
}
示例2: createNativeModules
import com.facebook.react.bridge.NativeModule; //导入依赖的package包/类
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext catalystApplicationContext) {
return Arrays.<NativeModule>asList(
// Core list
new AndroidInfoModule(),
new ExceptionsManagerModule(reactInstanceManager.getDevSupportManager()),
new AppStateModule(catalystApplicationContext),
new Timing(catalystApplicationContext, reactInstanceManager.getDevSupportManager()),
new UIManagerStubModule(catalystApplicationContext),
new SourceCodeModule(catalystApplicationContext),
new JSCHeapCapture(catalystApplicationContext),
// Main list
new AsyncStorageModule(catalystApplicationContext),
new IntentModule(catalystApplicationContext),
new LocationModule(catalystApplicationContext),
new NetworkingModule(catalystApplicationContext),
new NetInfoModule(catalystApplicationContext),
new VibrationModule(catalystApplicationContext),
new WebSocketModule(catalystApplicationContext),
new ThreadSelfModule(catalystApplicationContext)
);
}
示例3: createNativeModules
import com.facebook.react.bridge.NativeModule; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public List<NativeModule> createNativeModules(
ReactApplicationContext reactContext,
ReactInstanceManager reactInstanceManager) {
final Map<String, NativeModule> moduleMap = new HashMap<>();
for (ReactPackage reactPackage: mChildReactPackages) {
List<NativeModule> nativeModules;
if (reactPackage instanceof ReactInstancePackage) {
ReactInstancePackage reactInstancePackage = (ReactInstancePackage) reactPackage;
nativeModules = reactInstancePackage.createNativeModules(
reactContext,
reactInstanceManager);
} else {
nativeModules = reactPackage.createNativeModules(reactContext);
}
for (NativeModule nativeModule: nativeModules) {
moduleMap.put(nativeModule.getName(), nativeModule);
}
}
return new ArrayList(moduleMap.values());
}
示例4: createNativeModules
import com.facebook.react.bridge.NativeModule; //导入依赖的package包/类
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new RNSweetAlertModule(reactContext));
return modules;
}
示例5: createNativeModules
import com.facebook.react.bridge.NativeModule; //导入依赖的package包/类
@Override
public List<NativeModule> createNativeModules(
ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new MusicPlayerModule(reactContext));
return modules;
}
示例6: createNativeModules
import com.facebook.react.bridge.NativeModule; //导入依赖的package包/类
@Override
public List<NativeModule> createNativeModules(
ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new WebRTCModule(reactContext));
return modules;
}
示例7: createNativeModules
import com.facebook.react.bridge.NativeModule; //导入依赖的package包/类
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactApplicationContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new RNSpeechToText(reactApplicationContext));
return modules;
}
示例8: createNativeModules
import com.facebook.react.bridge.NativeModule; //导入依赖的package包/类
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new DownloadFileManager(reactContext));
return modules;
}
示例9: ModuleHolder
import com.facebook.react.bridge.NativeModule; //导入依赖的package包/类
public ModuleHolder(NativeModule nativeModule) {
mName = nativeModule.getName();
mCanOverrideExistingModule = nativeModule.canOverrideExistingModule();
mSupportsWebWorkers = nativeModule.supportsWebWorkers();
mHasConstants = true;
mModule = nativeModule;
}
示例10: createNativeModules
import com.facebook.react.bridge.NativeModule; //导入依赖的package包/类
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactApplicationContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new NfcManager(reactApplicationContext));
return modules;
}
示例11: createNativeModules
import com.facebook.react.bridge.NativeModule; //导入依赖的package包/类
/**
* @param reactContext react application context that can be used to create modules
* @return list of native modules to register with the newly created catalyst instance
*/
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new NfcReactNativeSimpleModule(reactContext));
return modules;
}
示例12: createNativeModules
import com.facebook.react.bridge.NativeModule; //导入依赖的package包/类
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new SystemSetting(reactContext));
return modules;
}
示例13: createNativeModules
import com.facebook.react.bridge.NativeModule; //导入依赖的package包/类
@Override
public List<NativeModule> createNativeModules(
ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new BackgroundTaskModule(reactContext));
return modules;
}
示例14: createNativeModules
import com.facebook.react.bridge.NativeModule; //导入依赖的package包/类
@Override
public List<NativeModule> createNativeModules(
ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new SomeExampleModule(reactContext));
return modules;
}
示例15: getJavaModules
import com.facebook.react.bridge.NativeModule; //导入依赖的package包/类
Collection<JavaModuleWrapper> getJavaModules(
JSInstance jsInstance) {
ArrayList<JavaModuleWrapper> javaModules = new ArrayList<>();
for (Map.Entry<Class<? extends NativeModule>, ModuleHolder> entry : mModules.entrySet()) {
Class<?> type = entry.getKey();
if (!CxxModuleWrapper.class.isAssignableFrom(type)) {
javaModules.add(new JavaModuleWrapper(jsInstance, entry.getValue()));
}
}
return javaModules;
}