Skip to content

Instantly share code, notes, and snippets.

@janicduplessis
Created August 2, 2019 20:56
Show Gist options
  • Save janicduplessis/6256d4bda0a59dd345654dacae106ea2 to your computer and use it in GitHub Desktop.
Save janicduplessis/6256d4bda0a59dd345654dacae106ea2 to your computer and use it in GitHub Desktop.
package com.th3rdwave;
import com.aakashns.reactnativedialogs.modules.DialogAndroid;
import com.facebook.react.TurboReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.module.annotations.ReactModuleList;
import com.facebook.react.module.model.ReactModuleInfo;
import com.facebook.react.module.model.ReactModuleInfoProvider;
import com.facebook.react.uimanager.ViewManager;
import com.gettipsi.stripe.CustomCardInputReactManager;
import com.gettipsi.stripe.StripeModule;
import com.github.reactnativecommunity.location.RNLocationModule;
import com.imagepicker.ImagePickerModule;
import com.learnium.RNDeviceInfo.RNDeviceModule;
import com.reactnativecommunity.asyncstorage.AsyncStorageModule;
import com.reactnativecommunity.netinfo.NetInfoModule;
import com.reactnativecommunity.statusbar.RNCStatusBarModule;
import com.swmansion.gesturehandler.react.RNGestureHandlerButtonViewManager;
import com.swmansion.gesturehandler.react.RNGestureHandlerModule;
import com.swmansion.gesturehandler.react.RNGestureHandlerRootViewManager;
import com.swmansion.reanimated.ReanimatedModule;
import com.th3rdwave.views.GooglePayButtonViewManager;
import org.devio.rn.splashscreen.SplashScreenModule;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.branch.rnbranch.RNBranchModule;
import io.sentry.RNSentryModule;
@ReactModuleList(
nativeModules = {
ImagePickerModule.class,
RNLocationModule.class,
RNDeviceModule.class,
StripeModule.class,
DialogAndroid.class,
RNBranchModule.class,
ReanimatedModule.class,
NetInfoModule.class,
RNCStatusBarModule.class,
AsyncStorageModule.class,
RNSentryModule.class,
RNGestureHandlerModule.class,
SplashScreenModule.class,
})
public class TWTurboReactPackage extends TurboReactPackage {
@Override
public NativeModule getModule(String name, ReactApplicationContext reactContext) {
switch (name) {
case ImagePickerModule.NAME:
return new ImagePickerModule(reactContext);
case RNLocationModule.NAME:
return new RNLocationModule(reactContext);
case RNDeviceModule.NAME:
return new RNDeviceModule(reactContext, false);
case StripeModule.NAME:
return new StripeModule(reactContext);
case DialogAndroid.NAME:
return new DialogAndroid(reactContext);
case RNBranchModule.NAME:
return new RNBranchModule(reactContext);
case ReanimatedModule.NAME:
return new ReanimatedModule(reactContext);
case NetInfoModule.NAME:
return new NetInfoModule(reactContext);
case RNCStatusBarModule.NAME:
return new RNCStatusBarModule(reactContext);
case AsyncStorageModule.NAME:
return new AsyncStorageModule(reactContext);
case RNSentryModule.NAME:
return new RNSentryModule(reactContext);
case RNGestureHandlerModule.MODULE_NAME:
return new RNGestureHandlerModule(reactContext);
case SplashScreenModule.NAME:
return new SplashScreenModule(reactContext);
default:
throw new IllegalArgumentException(
"In MainApplication, could not find Native module for " + name);
}
}
@Override
public ReactModuleInfoProvider getReactModuleInfoProvider() {
return new TWTurboReactPackage$$ReactModuleInfoProvider();
}
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Arrays.asList(
new GooglePayButtonViewManager(),
new CustomCardInputReactManager(),
new RNGestureHandlerRootViewManager(),
new RNGestureHandlerButtonViewManager());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment