Java 类com.facebook.react.ReactPackage 实例源码

项目:RNLearn_Project1    文件:MainApplication.java   
@Override
protected ReactInstanceManager createReactInstanceManager() {
    ReactInstanceManagerBuilder builder = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setJSMainModuleName(getJSMainModuleName())
            .setUseDeveloperSupport(getUseDeveloperSupport())
            .setRedBoxHandler(getRedBoxHandler())
            .setUIImplementationProvider(getUIImplementationProvider())
            .setInitialLifecycleState(LifecycleState.BEFORE_CREATE)
            .setNativeModuleCallExceptionHandler(
                    new ReadingNativeModuleCallExceptionHandler());

    for (ReactPackage reactPackage : getPackages()) {
        builder.addPackage(reactPackage);
    }

    String jsBundleFile = getJSBundleFile();
    if (jsBundleFile != null) {
        builder.setJSBundleFile(jsBundleFile);
    } else {
        builder.setBundleAssetName(Assertions.assertNotNull(getBundleAssetName()));
    }
    return builder.build();
}
项目:react-native-navigation    文件:NavigationReactGateway.java   
@Override
protected List<ReactPackage> getPackages() {
    List<ReactPackage> result = new ArrayList<>();

    List<ReactPackage> additionalReactPackages = NavigationApplication.instance.createAdditionalReactPackages();
    if (additionalReactPackages != null)
        result.addAll(additionalReactPackages);

    if (!containsInstanceOfClass(result, MainReactPackage.class)) {
        result.add(new MainReactPackage());
    }
    if (!containsInstanceOfClass(result, NavigationReactPackage.class)) {
        result.add(new NavigationReactPackage());
    }

    return result;
}
项目:react-native-android-audio-demo    文件:ReactInstanceSingleton.java   
public static synchronized ReactInstanceManager getReactInstanceManager(
        Application application) {
    if (sSingletonManager == null) {
        ReactInstanceManager.Builder builder = ReactInstanceManager.builder()
                .setApplication(application)
                .setJSMainModuleName("index.android")
                .setUseDeveloperSupport(BuildConfig.DEBUG)
                        // TODO figure out the right thing to put here.
                .setInitialLifecycleState(LifecycleState.BEFORE_RESUME);

        for (ReactPackage reactPackage : getPackages()) {
            builder.addPackage(reactPackage);
        }

        builder.setBundleAssetName("index.android.bundle");
        sSingletonManager = builder.build();
    }
    return sSingletonManager;
}
项目:react-native-nearby    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
        new NearbyPackage()
  );
}
项目:react-native-camera-android-simple    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
        new CameraPackage()
  );
}
项目:react-native-twitterkit    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new ReactTwitterKitPackage(CONSUMER_KEY, CONSUMER_SECRET)
    );
}
项目:react-native-collapsing-toolbar    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
      new VectorIconsPackage(),
      new RNCollapsingToolbarPackage(),
      new RNNestedScrollViewPackage()
  );
}
项目:react-native-system-setting    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
        new SystemSettingPackage()
  );
}
项目:react-native-message-compose    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
        new RNMessageComposePackage()
  );
}
项目:react-native-andorid-shadow    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
          new RNReactNativeAndoridShadowPackage()
  );
}
项目:react-native-gl-model-view    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
        new RNGLModelViewPackage()
  );
}
项目:react-native-gl-model-view    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
      new RNGLModelViewPackage()
  );
}
项目:ReactNativeAndroidAudioConverter    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
      new ReactNativeAndroidAudioConverterPackage() // <---- add this line
  );
}
项目:react-native-recyclerview-list    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
new RNRecyclerviewListPackage()
  );
}
项目:react-native-ethereum    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
      new TestPackage()
  );
}
项目:react-native-android-wear-demo    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.asList(
      new MainReactPackage(),
      new WearCommunicationReactPackage()
  );
}
项目:react-native-settings    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
        new RNSettingsPackage()
  );
}
项目:react-native-tensorflow    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
        new RNTensorFlowPackage()
  );
}
项目:react-native-alert    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
      new PLPAlertPackage()
  );
}
项目:react-native-android-material-calendar-view    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
      new MaterialCalendarViewPackage()
  );
}
项目:react-native-sync-adapter    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
      new SyncAdapterPackage()
  );
}
项目:react-native-threads    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
      new RNThreadPackage(mReactNativeHost)
  );
}
项目:react-native-threads    文件:ReactContextBuilder.java   
private void addNativeModules(ReactApplicationContext reactContext, NativeModuleRegistryBuilder nativeRegistryBuilder) {
    for (int i = 0; i < reactPackages.size(); i++) {
        ReactPackage reactPackage = reactPackages.get(i);
        for (NativeModule nativeModule : reactPackage.createNativeModules(reactContext)) {
            nativeRegistryBuilder.addNativeModule(nativeModule);
        }
    }
}
项目:react-native-threads    文件:RNThreadModule.java   
public RNThreadModule(final ReactApplicationContext reactContext, ReactNativeHost reactNativehost, ReactPackage additionalThreadPackages[]) {
  super(reactContext);
  this.reactApplicationContext = reactContext;
  threads = new HashMap<>();
  this.reactNativeHost = reactNativehost;
  this.additionalThreadPackages = additionalThreadPackages;
  reactContext.addLifecycleEventListener(this);
}
项目:react-native-threads    文件:RNThreadModule.java   
@ReactMethod
public void startThread(final String jsFileName, final Promise promise) {
  Log.d(TAG, "Starting web thread - " + jsFileName);

  String jsFileSlug = jsFileName.contains("/") ? jsFileName.replaceAll("/", "_") : jsFileName;

  JSBundleLoader bundleLoader = getDevSupportManager().getDevSupportEnabled()
          ? createDevBundleLoader(jsFileName, jsFileSlug)
          : createReleaseBundleLoader(jsFileName, jsFileSlug);

  try {
    ArrayList<ReactPackage> threadPackages = new ArrayList<ReactPackage>(Arrays.asList(additionalThreadPackages));
    threadPackages.add(0, new ThreadBaseReactPackage(getReactInstanceManager()));

    ReactContextBuilder threadContextBuilder = new ReactContextBuilder(getReactApplicationContext())
            .setJSBundleLoader(bundleLoader)
            .setDevSupportManager(getDevSupportManager())
            .setReactInstanceManager(getReactInstanceManager())
            .setReactPackages(threadPackages);

    JSThread thread = new JSThread(jsFileSlug);
    thread.runFromContext(
            getReactApplicationContext(),
            threadContextBuilder
    );
    threads.put(thread.getThreadId(), thread);
    promise.resolve(thread.getThreadId());
  } catch (Exception e) {
    promise.reject(e);
    getDevSupportManager().handleException(e);
  }
}
项目:izzati    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
        new RNFetchBlobPackage(),
        new ImageResizerPackage(),
        new ImagePickerPackage()
  );
}
项目:react-native-screen-orientation    文件:MainActivity.java   
/**
 * A list of packages used by the app. If the app uses additional views
 * or modules besides the default ones, add more packages here.
 */
@Override
protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        new MainReactPackage(),
        new OrientationPackage(this)
    );
}
项目:react-native-growingio    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
        new GrowingRnPackage()
  );
}
项目:react-native-twilio-chat    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new RCTTwilioChatPackage()
    );
}
项目:rn-crash-reporter    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
          new SQLitePluginPackage(),
          new RNDeviceInfo(),
          new OrientationPackage(MainActivity.getActivity()),
          new RNSpinkitPackage(),
          new RNCrashReporterModule(MainActivity.getActivity())
  );
}
项目:react-native-call-log    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
        new CallLogPackage()
  );
}
项目:react-native-sunmi-inner-printer    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
        new SunmiInnerPrinterPackage()
  );
}
项目:LLphoto    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
        new VectorIconsPackage(),
        new RNFSPackage()
  );
}
项目:react-native-mpush    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new RCTMPushPackage()
    );
}
项目:WaveView-RN    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
          new WaveViewPackage()
  );
}
项目:react-native-mercadopago-checkout    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        new MainReactPackage(),
        new CheckoutMercadoPagoPackage()
    );
}
项目:react-native-datecs-printer    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
        new RNDatecsPrinterPackage()
  );
}
项目:react-native-compress-image    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
        new ImageCompressPackage()
  );
}
项目:react-native-text-gradient    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
      new TextGradientPackage()
  );
}
项目:react-native-fast-image    文件:MainApplication.java   
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
      new MainReactPackage(),
        new VectorIconsPackage(),
        new FastImageViewPackage()
  );
}