use of com.reactnativenavigation.views.toptabs.TopTabsLayoutCreator 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.views.toptabs.TopTabsLayoutCreator in project react-native-navigation by wix.
the class TopTabsViewControllerTest method beforeEach.
@Override
public void beforeEach() {
super.beforeEach();
activity = newActivity();
childRegistry = new ChildControllersRegistry();
List<Options> tabOptions = createOptions();
tabControllers = createTabsControllers(activity, tabOptions);
topTabsLayout = spy(new TopTabsViewPager(activity, tabControllers, new TopTabsAdapter(tabControllers)));
TopTabsLayoutCreator layoutCreator = Mockito.mock(TopTabsLayoutCreator.class);
Mockito.when(layoutCreator.create()).thenReturn(topTabsLayout);
Presenter presenter = new Presenter(activity, new Options());
options.topBar.buttons.back.visible = new Bool(false);
uut = spy(new TopTabsController(activity, childRegistry, "componentId", tabControllers, layoutCreator, options, presenter));
tabControllers.forEach(viewController -> viewController.setParentController(uut));
stack = spy(TestUtils.newStackController(activity).build());
stack.ensureViewIsCreated();
}
Aggregations