當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。