use of com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController in project react-native-navigation by wix.
the class LayoutFactory method createTopTabs.
private ViewController<?> createTopTabs(LayoutNode node) {
final List<ViewController<?>> tabs = new ArrayList<>();
for (int i = 0; i < node.children.size(); i++) {
ViewController<?> tabController = create(node.children.get(i));
Options options = parseOptions(node.children.get(i).getOptions());
options.setTopTabIndex(i);
tabs.add(tabController);
}
return new TopTabsController(activity, childRegistry, node.id, tabs, new TopTabsLayoutCreator(activity, tabs), parseOptions(node.getOptions()), new Presenter(activity, defaultOptions));
}
use of com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController in project react-native-navigation by wix.
the class TopTabsViewControllerTest method createTabsControllers.
private List<ViewController<?>> createTabsControllers(Activity activity, List<Options> tabOptions) {
List<ViewController<?>> tabControllers = new ArrayList<>(SIZE);
for (int i = 0; i < SIZE; i++) {
ComponentViewController viewController = new ComponentViewController(activity, childRegistry, "idTab" + i, "theComponentName", new TestComponentViewCreator(), tabOptions.get(i), new Presenter(activity, new Options()), new ComponentPresenter(Options.EMPTY));
tabControllers.add(spy(viewController));
}
return tabControllers;
}
use of com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController in project react-native-navigation by wix.
the class NavigationModule method setStackRoot.
@ReactMethod
public void setStackRoot(String commandId, String onComponentId, ReadableArray children, Promise promise) {
handle(() -> {
ArrayList<ViewController<?>> _children = new ArrayList<>();
for (int i = 0; i < children.size(); i++) {
final LayoutNode layoutTree = LayoutNodeParser.parse(jsonParser.parse(children.getMap(i)));
_children.add(layoutFactory.create(layoutTree));
}
navigator().setStackRoot(onComponentId, _children, new NativeCommandListener("setStackRoot", commandId, promise, eventEmitter, now));
});
}
use of com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController in project react-native-navigation by wix.
the class SideMenuControllerTest method onViewAppeared.
@Test
public void onViewAppeared() {
ViewController left = spy(this.left);
ViewGroup leftView = spy(left.getView());
when(left.findController(leftView)).thenReturn(left);
Mockito.doReturn(leftView).when(left).getView();
ViewController right = spy(this.right);
ViewGroup rightView = spy(right.getView());
when(right.findController(rightView)).thenReturn(right);
Mockito.doReturn(rightView).when(right).getView();
setLeftRight(left, right);
uut.onViewWillAppear();
verify(leftView).requestLayout();
verify(rightView).requestLayout();
}
use of com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController in project react-native-navigation by wix.
the class BottomTabsAttacherTest method beforeEach.
@Override
public void beforeEach() {
mode = Mockito.mock(AttachMode.class);
List<ViewController<?>> tabs = Arrays.asList(mock(ViewController.class), mock(ViewController.class));
uut = new BottomTabsAttacher(tabs, Mockito.mock(BottomTabsPresenter.class), defaultOptions);
uut.attachStrategy = mode;
}
Aggregations