MainApplication.java 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package com.edufound;
  2. import android.app.Application;
  3. import com.brentvatne.react.ReactVideoPackage;
  4. import com.edufound.mobile.BuildConfig;
  5. import com.facebook.react.ReactApplication;
  6. import com.facebook.react.ReactNativeHost;
  7. import com.facebook.react.ReactPackage;
  8. import com.facebook.react.bridge.ReactApplicationContext;
  9. import com.facebook.react.shell.MainReactPackage;
  10. import com.facebook.soloader.SoLoader;
  11. import com.github.yamill.orientation.OrientationPackage;
  12. import com.imagepicker.ImagePickerPackage;
  13. import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
  14. import java.util.Arrays;
  15. import java.util.List;
  16. public class MainApplication extends Application implements ReactApplication {
  17. private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
  18. @Override
  19. public boolean getUseDeveloperSupport() {
  20. return BuildConfig.DEBUG;
  21. }
  22. @Override
  23. protected List<ReactPackage> getPackages() {
  24. return Arrays.<ReactPackage>asList(
  25. new MainReactPackage(),
  26. new ReactVideoPackage(),
  27. new RNGestureHandlerPackage(),
  28. new CustomPackage(),
  29. new ReactVideoPackage(),
  30. new OrientationPackage(),
  31. new ImagePickerPackage()
  32. );
  33. }
  34. @Override
  35. protected String getJSMainModuleName() {
  36. return "index";
  37. }
  38. };
  39. @Override
  40. public ReactNativeHost getReactNativeHost() {
  41. return mReactNativeHost;
  42. }
  43. @Override
  44. public void onCreate() {
  45. super.onCreate();
  46. SoLoader.init(this, /* native exopackage */ false);
  47. }
  48. }