use of com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter in project react-native-navigation by wix.
the class ParentControllerTest method beforeEach.
@Override
public void beforeEach() {
super.beforeEach();
activity = newActivity();
childRegistry = new ChildControllersRegistry();
children = new ArrayList<>();
Options initialOptions = new Options();
initialOptions.topBar.title.text = new Text(INITIAL_TITLE);
presenter = spy(new Presenter(activity, new Options()));
uut = spy(new ParentController<ViewGroup>(activity, childRegistry, "uut", presenter, initialOptions) {
@Override
public ViewController<?> getCurrentChild() {
return children.get(0);
}
@NonNull
@Override
public ViewGroup createView() {
FrameLayout layout = new FrameLayout(activity);
for (ViewController<?> child : children) {
child.setParentController(this);
layout.addView(child.getView());
}
return layout;
}
@Override
public void sendOnNavigationButtonPressed(String buttonId) {
}
@NonNull
@Override
public Collection<ViewController<?>> getChildControllers() {
return children;
}
});
}
use of com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter in project react-native-navigation by wix.
the class LayoutFactory method createBottomTabs.
private ViewController<?> createBottomTabs(LayoutNode node) {
List<ViewController<?>> tabs = map(node.children, this::create);
BottomTabsPresenter bottomTabsPresenter = new BottomTabsPresenter(tabs, defaultOptions, new BottomTabsAnimator());
return new BottomTabsController(activity, tabs, childRegistry, eventEmitter, new ImageLoader(), node.id, parseOptions(node.getOptions()), new Presenter(activity, defaultOptions), new BottomTabsAttacher(tabs, bottomTabsPresenter, defaultOptions), bottomTabsPresenter, new BottomTabPresenter(activity, tabs, new ImageLoader(), new TypefaceLoader(activity), defaultOptions));
}
use of com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter in project react-native-navigation by wix.
the class ChildControllerTest method beforeEach.
@Override
public void beforeEach() {
childRegistry = spy(new ChildControllersRegistry());
presenter = Mockito.mock(Presenter.class);
uut = new SimpleViewController(newActivity(), childRegistry, "childId", presenter, new Options()) {
@Override
public Options resolveCurrentOptions() {
return resolvedOptions;
}
};
ParentController<?> parent = Mockito.mock(ParentController.class);
Mockito.when(parent.resolveChildOptions(uut)).thenReturn(Options.EMPTY);
uut.setParentController(parent);
}
Aggregations