use of com.reactnativenavigation.options.Options in project react-native-navigation by wix.
the class BackButtonHelperTest method beforeEach.
@Override
public void beforeEach() {
uut = new BackButtonHelper();
Activity activity = newActivity();
ChildControllersRegistry childRegistry = new ChildControllersRegistry();
stack = TestUtils.newStackController(activity).setChildRegistry(childRegistry).setBackButtonHelper(uut).build();
child1 = spy(new SimpleViewController(activity, childRegistry, "child1", new Options()));
child2 = spy(new SimpleViewController(activity, childRegistry, "child2", new Options()));
stack.ensureViewIsCreated();
}
use of com.reactnativenavigation.options.Options 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();
}
use of com.reactnativenavigation.options.Options 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.options.Options in project react-native-navigation by wix.
the class BottomTabsController method createView.
@NonNull
@Override
public BottomTabsLayout createView() {
BottomTabsLayout root = new BottomTabsLayout(getActivity());
this.bottomTabsContainer = createBottomTabsContainer();
this.bottomTabs = bottomTabsContainer.getBottomTabs();
Options resolveCurrentOptions = resolveCurrentOptions();
tabsAttacher.init(root, resolveCurrentOptions);
presenter.bindView(bottomTabsContainer, this);
tabPresenter.bindView(bottomTabs);
bottomTabs.setOnTabSelectedListener(this);
root.addBottomTabsContainer(bottomTabsContainer);
bottomTabs.addItems(createTabs());
setInitialTab(resolveCurrentOptions);
tabsAttacher.attach();
return root;
}
use of com.reactnativenavigation.options.Options in project react-native-navigation by wix.
the class NavigationModule method setDefaultOptions.
@ReactMethod
public void setDefaultOptions(ReadableMap options) {
handle(() -> {
Options defaultOptions = parse(options);
layoutFactory.setDefaultOptions(defaultOptions);
navigator().setDefaultOptions(defaultOptions);
});
}
Aggregations