当前位置: 首页>>代码示例>>Java>>正文


Java NativeModule类代码示例

本文整理汇总了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;
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:17,代码来源:ModuleHolder.java

示例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)
    );
}
 
开发者ID:joltup,项目名称:react-native-threads,代码行数:24,代码来源:ThreadBaseReactPackage.java

示例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());
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:25,代码来源:CompositeReactPackage.java

示例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;
}
 
开发者ID:Clip-sub,项目名称:react-native-sweet-alert,代码行数:8,代码来源:RNSweetAlertPackage.java

示例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;
}
 
开发者ID:hiteshsahu,项目名称:React-Native-Music-Player,代码行数:8,代码来源:MusicPlayerModulePackage.java

示例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;
}
 
开发者ID:angellsl10,项目名称:react-native-webrtc,代码行数:9,代码来源:WebRTCModulePackage.java

示例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;
}
 
开发者ID:marshmelloX,项目名称:react-native-stt,代码行数:9,代码来源:RNSpeechToTextPackage.java

示例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;
}
 
开发者ID:liuhong1happy,项目名称:react-native-download-manager,代码行数:9,代码来源:DownloadFilePackage.java

示例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;
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:8,代码来源:ModuleHolder.java

示例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;
}
 
开发者ID:whitedogg13,项目名称:react-native-nfc-manager,代码行数:8,代码来源:NfcManagerPackage.java

示例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;
}
 
开发者ID:petersobolev,项目名称:nfc-react-native-simple,代码行数:12,代码来源:NfcReactNativeSimplePackage.java

示例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;
}
 
开发者ID:c19354837,项目名称:react-native-system-setting,代码行数:9,代码来源:SystemSettingPackage.java

示例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;
}
 
开发者ID:jamesisaac,项目名称:react-native-background-task,代码行数:10,代码来源:BackgroundTaskPackage.java

示例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;
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:8,代码来源:ReactPackage.java

示例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;
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:12,代码来源:NativeModuleRegistry.java


注:本文中的com.facebook.react.bridge.NativeModule类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。