use of com.reactnativenavigation.viewcontrollers.sidemenu.SideMenuPresenter in project react-native-navigation by wix.
the class SideMenuPresenterTest method beforeEach.
@Override
public void beforeEach() {
uut = new SideMenuPresenter();
SideMenu sideMenu = Mockito.mock(SideMenu.class);
uut.bindView(sideMenu);
}
use of com.reactnativenavigation.viewcontrollers.sidemenu.SideMenuPresenter in project react-native-navigation by wix.
the class LayoutFactory method createSideMenuRoot.
private ViewController<?> createSideMenuRoot(LayoutNode node) {
SideMenuController sideMenuController = new SideMenuController(activity, childRegistry, node.id, parseOptions(node.getOptions()), new SideMenuPresenter(), new Presenter(activity, defaultOptions));
ViewController<?> childControllerCenter = null, childControllerLeft = null, childControllerRight = null;
for (LayoutNode child : node.children) {
switch(child.type) {
case SideMenuCenter:
childControllerCenter = create(child);
childControllerCenter.setParentController(sideMenuController);
break;
case SideMenuLeft:
childControllerLeft = create(child);
childControllerLeft.setParentController(sideMenuController);
break;
case SideMenuRight:
childControllerRight = create(child);
childControllerRight.setParentController(sideMenuController);
break;
default:
throw new IllegalArgumentException("Invalid node type in sideMenu: " + node.type);
}
}
if (childControllerCenter != null) {
sideMenuController.setCenterController(childControllerCenter);
}
if (childControllerLeft != null) {
sideMenuController.setLeftController(childControllerLeft);
}
if (childControllerRight != null) {
sideMenuController.setRightController(childControllerRight);
}
return sideMenuController;
}
Aggregations