Search in sources :

Example 1 with EventEmitter

use of com.reactnativenavigation.react.events.EventEmitter in project react-native-navigation by wix.

the class NavigationReactInitializer method emitAppLaunched.

private void emitAppLaunched(@NonNull ReactContext context) {
    if (!isActivityReadyForUi)
        return;
    waitingForAppLaunchEvent = false;
    new EventEmitter(context).appLaunched();
}
Also used : EventEmitter(com.reactnativenavigation.react.events.EventEmitter)

Example 2 with EventEmitter

use of com.reactnativenavigation.react.events.EventEmitter in project react-native-navigation by wix.

the class NavigatorTest method beforeEach.

@Override
public void beforeEach() {
    super.beforeEach();
    childRegistry = new ChildControllersRegistry();
    eventEmitter = Mockito.mock(EventEmitter.class);
    reactInstanceManager = Mockito.mock(ReactInstanceManager.class);
    overlayManager = spy(new OverlayManager());
    imageLoaderMock = ImageLoaderMock.mock();
    activityController = newActivityController(TestActivity.class);
    activity = activityController.create().get();
    modalStack = spy(new ModalStack(activity));
    rootPresenter = spy(new RootPresenter());
    modalStack.setEventEmitter(Mockito.mock(EventEmitter.class));
    uut = new Navigator(activity, childRegistry, modalStack, overlayManager, rootPresenter);
    activity.setNavigator(uut);
    ViewController<?> initialChild = new SimpleViewController(activity, childRegistry, "initialChild", Options.EMPTY);
    parentController = newStack(initialChild);
    parentVisibilityListener = spy(new ViewController.ViewVisibilityListener() {

        @Override
        public boolean onViewAppeared(View view) {
            return false;
        }

        @Override
        public boolean onViewDisappear(View view) {
            return false;
        }
    });
    parentController.setViewVisibilityListener(parentVisibilityListener);
    child1 = new SimpleViewController(activity, childRegistry, "child1", tabOptions);
    child2 = new SimpleViewController(activity, childRegistry, "child2", tabOptions);
    child3 = new SimpleViewController(activity, childRegistry, "child3", tabOptions);
    child4 = new SimpleViewController(activity, childRegistry, "child4", tabOptions);
    child5 = new SimpleViewController(activity, childRegistry, "child5", tabOptions);
    uut.bindViews();
    activityController.visible();
    activityController.postCreate(Bundle.EMPTY);
    idleMainLooper();
}
Also used : OverlayManager(com.reactnativenavigation.viewcontrollers.overlay.OverlayManager) ModalStack(com.reactnativenavigation.viewcontrollers.modal.ModalStack) ReactInstanceManager(com.facebook.react.ReactInstanceManager) EventEmitter(com.reactnativenavigation.react.events.EventEmitter) ChildControllersRegistry(com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry) TestActivity(com.reactnativenavigation.TestActivity) RootPresenter(com.reactnativenavigation.viewcontrollers.viewcontroller.RootPresenter) SimpleViewController(com.reactnativenavigation.mocks.SimpleViewController) View(android.view.View)

Example 3 with EventEmitter

use of com.reactnativenavigation.react.events.EventEmitter in project react-native-navigation by wix.

the class NativeCommandListenerTest method beforeEach.

@Override
public void beforeEach() {
    promise = Mockito.mock(Promise.class);
    eventEmitter = Mockito.mock(EventEmitter.class);
    uut = new NativeCommandListener(COMMAND_NAME, COMMAND_ID, promise, eventEmitter, mockNow());
}
Also used : Promise(com.facebook.react.bridge.Promise) EventEmitter(com.reactnativenavigation.react.events.EventEmitter) NativeCommandListener(com.reactnativenavigation.react.NativeCommandListener)

Aggregations

EventEmitter (com.reactnativenavigation.react.events.EventEmitter)3 View (android.view.View)1 ReactInstanceManager (com.facebook.react.ReactInstanceManager)1 Promise (com.facebook.react.bridge.Promise)1 TestActivity (com.reactnativenavigation.TestActivity)1 SimpleViewController (com.reactnativenavigation.mocks.SimpleViewController)1 NativeCommandListener (com.reactnativenavigation.react.NativeCommandListener)1 ChildControllersRegistry (com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry)1 ModalStack (com.reactnativenavigation.viewcontrollers.modal.ModalStack)1 OverlayManager (com.reactnativenavigation.viewcontrollers.overlay.OverlayManager)1 RootPresenter (com.reactnativenavigation.viewcontrollers.viewcontroller.RootPresenter)1