Search in sources :

Example 1 with SideMenuPresenter

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);
}
Also used : SideMenuPresenter(com.reactnativenavigation.viewcontrollers.sidemenu.SideMenuPresenter) SideMenu(com.reactnativenavigation.views.sidemenu.SideMenu)

Example 2 with SideMenuPresenter

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;
}
Also used : SideMenuPresenter(com.reactnativenavigation.viewcontrollers.sidemenu.SideMenuPresenter) SideMenuController(com.reactnativenavigation.viewcontrollers.sidemenu.SideMenuController) StackPresenter(com.reactnativenavigation.viewcontrollers.stack.StackPresenter) BottomTabPresenter(com.reactnativenavigation.viewcontrollers.bottomtabs.BottomTabPresenter) BottomTabsPresenter(com.reactnativenavigation.viewcontrollers.bottomtabs.BottomTabsPresenter) SideMenuPresenter(com.reactnativenavigation.viewcontrollers.sidemenu.SideMenuPresenter) Presenter(com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter) ExternalComponentPresenter(com.reactnativenavigation.viewcontrollers.externalcomponent.ExternalComponentPresenter) ComponentPresenter(com.reactnativenavigation.viewcontrollers.component.ComponentPresenter)

Aggregations

SideMenuPresenter (com.reactnativenavigation.viewcontrollers.sidemenu.SideMenuPresenter)2 BottomTabPresenter (com.reactnativenavigation.viewcontrollers.bottomtabs.BottomTabPresenter)1 BottomTabsPresenter (com.reactnativenavigation.viewcontrollers.bottomtabs.BottomTabsPresenter)1 ComponentPresenter (com.reactnativenavigation.viewcontrollers.component.ComponentPresenter)1 ExternalComponentPresenter (com.reactnativenavigation.viewcontrollers.externalcomponent.ExternalComponentPresenter)1 SideMenuController (com.reactnativenavigation.viewcontrollers.sidemenu.SideMenuController)1 StackPresenter (com.reactnativenavigation.viewcontrollers.stack.StackPresenter)1 Presenter (com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter)1 SideMenu (com.reactnativenavigation.views.sidemenu.SideMenu)1