use of com.reactnativenavigation.viewcontrollers.modal.ModalStack in project react-native-navigation by wix.
the class NavigationActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (isFinishing()) {
return;
}
addDefaultSplashLayout();
navigator = new Navigator(this, new ChildControllersRegistry(), new ModalStack(this), new OverlayManager(), new RootPresenter());
navigator.bindViews();
getReactGateway().onActivityCreated(this);
}
use of com.reactnativenavigation.viewcontrollers.modal.ModalStack 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();
}
Aggregations