Java Code Examples for com.facebook.react.bridge.ReactApplicationContext
The following examples show how to use
com.facebook.react.bridge.ReactApplicationContext. These examples are extracted from open source projects.
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 Project: react-native-keychain Source File: KeychainModuleTests.java License: 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 Project: react-native-GPay Source File: UIManagerModule.java License: 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 Project: react-native-jw-media-player Source File: RNJWPlayerView.java License: 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 Project: react-native-obd2 Source File: ReactNativeOBD2Package.java License: 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 Project: react-native-twilio-programmable-voice Source File: ProximityManager.java License: 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 Project: react-native-google-nearby-connection Source File: NearbyConnectionModule.java License: MIT License | 5 votes |
public NearbyConnectionModule(ReactApplicationContext reactContext) { super(reactContext); this.reactContext = reactContext; onResume(); setLifecycleListeners(); }
Example 7
Source Project: react-native-account-manager Source File: AccountManagerPackage.java License: 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 Project: react-native-firestack Source File: FirestackStorage.java License: 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 Project: react-native-dynamic-splash Source File: DynamicSplashReactPackage.java License: 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 Project: react-native-bluetooth-status Source File: RNBluetoothManagerModule.java License: MIT License | 5 votes |
public RNBluetoothManagerModule(ReactApplicationContext reactContext) { super(reactContext); this.reactContext = reactContext; reactContext.addLifecycleEventListener(this); btAdapter = BluetoothAdapter.getDefaultAdapter(); registerBroadcastReceiver(); }
Example 11
Source Project: dingo Source File: ProxiedFetchReactPackage.java License: 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 Project: dingo Source File: SplashScreenReactPackage.java License: 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 Project: Instabug-React-Native Source File: InstabugUtil.java License: 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 Project: react-native-lanscan Source File: LANScanReactModule.java License: 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 Project: react-native-flurry-sdk Source File: FlurryPackage.java License: 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 Project: react-native-camera-face-detector Source File: RCTCameraModule.java License: 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 Project: react-native-android-sms-listener Source File: SmsListenerModule.java License: MIT License | 5 votes |
public SmsListenerModule(ReactApplicationContext context) { super(context); mReceiver = new SmsReceiver(context); getReactApplicationContext().addLifecycleEventListener(this); registerReceiverIfNecessary(mReceiver); }
Example 18
Source Project: react-native-GPay Source File: NativeAnimatedModule.java License: 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 Project: react-native-shine-button Source File: RNShineButtonModule.java License: Apache License 2.0 | 4 votes |
public RNShineButtonModule(ReactApplicationContext reactContext) { super(reactContext); }
Example 20
Source Project: react-native-message-compose Source File: RNMessageComposePackage.java License: MIT License | 4 votes |
@Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { return Arrays.<NativeModule>asList(new RNMessageComposeModule(reactContext)); }
Example 21
Source Project: react-native-android-activity Source File: ActivityStarterReactPackage.java License: MIT License | 4 votes |
@NonNull @Override public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) { return Collections.emptyList(); }
Example 22
Source Project: react-native-share Source File: InstagramStoriesShare.java License: MIT License | 4 votes |
public InstagramStoriesShare(ReactApplicationContext reactContext) { super(reactContext); this.setIntent(new Intent("com.instagram.share.ADD_TO_STORY")); }
Example 23
Source Project: react-native-payment-gateway Source File: MidtransPackage.java License: MIT License | 4 votes |
@Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { return Arrays.<NativeModule>asList(new MidtransModule(reactContext)); }
Example 24
Source Project: lottie-react-native Source File: LottiePackage.java License: Apache License 2.0 | 4 votes |
@SuppressWarnings("rawtypes") @Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { return Collections.<ViewManager>singletonList(new LottieAnimationViewManager()); }
Example 25
Source Project: react-native-share-extension Source File: ShareExPackage.java License: MIT License | 4 votes |
@Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { return Arrays.<NativeModule>asList(new ShareExModule(reactContext)); }
Example 26
Source Project: react-native-webview-crosswalk Source File: CrosswalkWebViewGroupManager.java License: MIT License | 4 votes |
public CrosswalkWebViewGroupManager (ReactApplicationContext _reactContext) { reactContext = _reactContext; }
Example 27
Source Project: react-native-sound-player Source File: RNSoundPlayerPackage.java License: MIT License | 4 votes |
@Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { return Collections.emptyList(); }
Example 28
Source Project: react-native-keychain Source File: KeychainPackage.java License: MIT License | 4 votes |
@Override @NonNull public List<NativeModule> createNativeModules(@NonNull final ReactApplicationContext reactContext) { return Collections.singletonList(KeychainModule.withWarming(reactContext)); }
Example 29
Source Project: react-native-blur-overlay Source File: SajjadBlurOverlayPackage.java License: MIT License | 4 votes |
@Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { return Collections.emptyList(); }
Example 30
Source Project: react-native-sqlite-storage Source File: SQLitePlugin.java License: MIT License | 4 votes |
public SQLitePlugin(ReactApplicationContext reactContext) { super(reactContext); this.context = reactContext.getApplicationContext(); this.threadPool = Executors.newCachedThreadPool(); }