com.facebook.react.bridge.ReactApplicationContext Java Examples
The following examples show how to use
com.facebook.react.bridge.ReactApplicationContext.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: KeychainModuleTests.java From react-native-keychain with MIT License | 6 votes |
@Test @Config(sdk = Build.VERSION_CODES.P) public void testGetSecurityLevel_NoBiometry_api28() throws Exception { // GIVE: final ReactApplicationContext context = getRNContext(); final KeychainModule module = new KeychainModule(context); final Promise mockPromise = mock(Promise.class); // WHEN: final JavaOnlyMap options = new JavaOnlyMap(); options.putString(Maps.ACCESS_CONTROL, AccessControl.DEVICE_PASSCODE); module.getSecurityLevel(options, mockPromise); // THEN: verify(mockPromise).resolve(SecurityLevel.SECURE_HARDWARE.name()); }
Example #2
Source File: UIManagerModule.java From react-native-GPay with MIT License | 6 votes |
@Deprecated public UIManagerModule( ReactApplicationContext reactContext, ViewManagerResolver viewManagerResolver, UIImplementationProvider uiImplementationProvider, int minTimeLeftInFrameForNonBatchedOperationMs) { super(reactContext); DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(reactContext); mEventDispatcher = new EventDispatcher(reactContext); mModuleConstants = createConstants(viewManagerResolver); mCustomDirectEvents = UIManagerModuleConstants.getDirectEventTypeConstants(); mUIImplementation = uiImplementationProvider.createUIImplementation( reactContext, viewManagerResolver, mEventDispatcher, minTimeLeftInFrameForNonBatchedOperationMs); reactContext.addLifecycleEventListener(this); }
Example #3
Source File: RNJWPlayerView.java From react-native-jw-media-player with MIT License | 6 votes |
private static Context getNonBuggyContext(ThemedReactContext reactContext, ReactApplicationContext appContext) { Context superContext = reactContext; if (!contextHasBug(appContext.getCurrentActivity())) { superContext = appContext.getCurrentActivity(); } else if (contextHasBug(superContext)) { // we have the bug! let's try to find a better context to use if (!contextHasBug(reactContext.getCurrentActivity())) { superContext = reactContext.getCurrentActivity(); } else if (!contextHasBug(reactContext.getApplicationContext())) { superContext = reactContext.getApplicationContext(); } else { // ¯\_(ツ)_/¯ } } return superContext; }
Example #4
Source File: ReactNativeOBD2Package.java From react-native-obd2 with MIT License | 5 votes |
@Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { List<NativeModule> modules = new ArrayList<>(); modules.add(new ReactNativeOBD2Module(reactContext)); return modules; }
Example #5
Source File: ProximityManager.java From react-native-twilio-programmable-voice with MIT License | 5 votes |
public ProximityManager(ReactApplicationContext context, EventManager em) { eventManager = em; powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE); proximitySensor = sensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); initProximityWakeLock(); }
Example #6
Source File: NearbyConnectionModule.java From react-native-google-nearby-connection with MIT License | 5 votes |
public NearbyConnectionModule(ReactApplicationContext reactContext) { super(reactContext); this.reactContext = reactContext; onResume(); setLifecycleListeners(); }
Example #7
Source File: AccountManagerPackage.java From react-native-account-manager with MIT License | 5 votes |
@Override public List<NativeModule> createNativeModules( ReactApplicationContext reactContext) { List<NativeModule> modules = new ArrayList<>(); modules.add(new AccountManagerModule(reactContext)); return modules; }
Example #8
Source File: FirestackStorage.java From react-native-firestack with MIT License | 5 votes |
public FirestackStorage(ReactApplicationContext reactContext) { super(reactContext); Log.d(TAG, "Attaching FirestackStorage"); this.context = reactContext; mReactContext = reactContext; Log.d(TAG, "New instance"); }
Example #9
Source File: DynamicSplashReactPackage.java From react-native-dynamic-splash with MIT License | 5 votes |
@Override public List<NativeModule> createNativeModules( ReactApplicationContext reactContext) { List<NativeModule> modules = new ArrayList<>(); modules.add(new DynamicSplashModule(reactContext)); return modules; }
Example #10
Source File: RNBluetoothManagerModule.java From react-native-bluetooth-status with MIT License | 5 votes |
public RNBluetoothManagerModule(ReactApplicationContext reactContext) { super(reactContext); this.reactContext = reactContext; reactContext.addLifecycleEventListener(this); btAdapter = BluetoothAdapter.getDefaultAdapter(); registerBroadcastReceiver(); }
Example #11
Source File: ProxiedFetchReactPackage.java From dingo with GNU General Public License v3.0 | 5 votes |
@Override public List<NativeModule> createNativeModules( ReactApplicationContext reactContext) { List<NativeModule> modules = new ArrayList<>(); modules.add(new ProxiedFetchModule(reactContext)); return modules; }
Example #12
Source File: SplashScreenReactPackage.java From dingo with GNU General Public License v3.0 | 5 votes |
@Override public List<NativeModule> createNativeModules( ReactApplicationContext reactContext) { List<NativeModule> modules = new ArrayList<>(); modules.add(new SplashScreenModule(reactContext)); return modules; }
Example #13
Source File: InstabugUtil.java From Instabug-React-Native with MIT License | 5 votes |
public static void sendEvent(ReactApplicationContext reactContext, String eventName, WritableMap params) { reactContext .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class) .emit(eventName, params); }
Example #14
Source File: LANScanReactModule.java From react-native-lanscan with MIT License | 5 votes |
@Override public List<NativeModule> createNativeModules( ReactApplicationContext reactContext) { List<NativeModule> modules = new ArrayList<>(); modules.add(new LANScanModule(reactContext)); return modules; }
Example #15
Source File: FlurryPackage.java From react-native-flurry-sdk with Apache License 2.0 | 5 votes |
@Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { List<NativeModule> modules = new ArrayList<>(); modules.add(new FlurryModule(reactContext)); return modules; }
Example #16
Source File: RCTCameraModule.java From react-native-camera-face-detector with MIT License | 5 votes |
public RCTCameraModule(ReactApplicationContext reactContext) { super(reactContext); _reactContext = reactContext; _sensorOrientationChecker = new RCTSensorOrientationChecker(_reactContext); _reactContext.addLifecycleEventListener(this); sound.load(MediaActionSound.SHUTTER_CLICK); }
Example #17
Source File: SmsListenerModule.java From react-native-android-sms-listener with MIT License | 5 votes |
public SmsListenerModule(ReactApplicationContext context) { super(context); mReceiver = new SmsReceiver(context); getReactApplicationContext().addLifecycleEventListener(this); registerReceiverIfNecessary(mReceiver); }
Example #18
Source File: NativeAnimatedModule.java From react-native-GPay with MIT License | 5 votes |
@Override public void initialize() { ReactApplicationContext reactCtx = getReactApplicationContext(); UIManagerModule uiManager = reactCtx.getNativeModule(UIManagerModule.class); reactCtx.addLifecycleEventListener(this); uiManager.addUIManagerListener(this); }
Example #19
Source File: RNShineButtonModule.java From react-native-shine-button with Apache License 2.0 | 4 votes |
public RNShineButtonModule(ReactApplicationContext reactContext) { super(reactContext); }
Example #20
Source File: RNMessageComposePackage.java From react-native-message-compose with MIT License | 4 votes |
@Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { return Arrays.<NativeModule>asList(new RNMessageComposeModule(reactContext)); }
Example #21
Source File: ActivityStarterReactPackage.java From react-native-android-activity with MIT License | 4 votes |
@NonNull @Override public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) { return Collections.emptyList(); }
Example #22
Source File: InstagramStoriesShare.java From react-native-share with MIT License | 4 votes |
public InstagramStoriesShare(ReactApplicationContext reactContext) { super(reactContext); this.setIntent(new Intent("com.instagram.share.ADD_TO_STORY")); }
Example #23
Source File: MidtransPackage.java From react-native-payment-gateway with MIT License | 4 votes |
@Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { return Arrays.<NativeModule>asList(new MidtransModule(reactContext)); }
Example #24
Source File: LottiePackage.java From lottie-react-native with Apache License 2.0 | 4 votes |
@SuppressWarnings("rawtypes") @Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { return Collections.<ViewManager>singletonList(new LottieAnimationViewManager()); }
Example #25
Source File: ShareExPackage.java From react-native-share-extension with MIT License | 4 votes |
@Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { return Arrays.<NativeModule>asList(new ShareExModule(reactContext)); }
Example #26
Source File: CrosswalkWebViewGroupManager.java From react-native-webview-crosswalk with MIT License | 4 votes |
public CrosswalkWebViewGroupManager (ReactApplicationContext _reactContext) { reactContext = _reactContext; }
Example #27
Source File: RNSoundPlayerPackage.java From react-native-sound-player with MIT License | 4 votes |
@Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { return Collections.emptyList(); }
Example #28
Source File: KeychainPackage.java From react-native-keychain with MIT License | 4 votes |
@Override @NonNull public List<NativeModule> createNativeModules(@NonNull final ReactApplicationContext reactContext) { return Collections.singletonList(KeychainModule.withWarming(reactContext)); }
Example #29
Source File: SajjadBlurOverlayPackage.java From react-native-blur-overlay with MIT License | 4 votes |
@Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { return Collections.emptyList(); }
Example #30
Source File: SQLitePlugin.java From react-native-sqlite-storage with MIT License | 4 votes |
public SQLitePlugin(ReactApplicationContext reactContext) { super(reactContext); this.context = reactContext.getApplicationContext(); this.threadPool = Executors.newCachedThreadPool(); }