use of com.reactnativenavigation.options.Options in project react-native-navigation by wix.
the class BackButtonHelper method addToPushedChild.
public void addToPushedChild(ViewController<?> child) {
if (child.options.topBar.buttons.left != null || child.options.topBar.buttons.back.visible.isFalse())
return;
Options options = new Options();
options.topBar.buttons.back.setVisible();
child.mergeOptions(options);
}
use of com.reactnativenavigation.options.Options in project react-native-navigation by wix.
the class Presenter method onViewBroughtToFront.
public void onViewBroughtToFront(ViewController<?> viewController, Options options) {
Options withDefaultOptions = options.copy().withDefaultOptions(defaultOptions);
applyStatusBarOptions(viewController, withDefaultOptions);
}
use of com.reactnativenavigation.options.Options in project react-native-navigation by wix.
the class Presenter method applyOptions.
public void applyOptions(ViewController view, Options options) {
Options withDefaultOptions = options.copy().withDefaultOptions(defaultOptions);
applyOrientation(withDefaultOptions.layout.orientation);
applyViewOptions(view, withDefaultOptions);
applyStatusBarOptions(view, withDefaultOptions);
applyNavigationBarOptions(withDefaultOptions.navigationBar);
}
use of com.reactnativenavigation.options.Options in project react-native-navigation by wix.
the class RootPresenter method setRoot.
public void setRoot(ViewController appearingRoot, ViewController<?> disappearingRoot, Options defaultOptions, CommandListener listener, ReactInstanceManager reactInstanceManager) {
layoutDirectionApplier.apply(appearingRoot, defaultOptions, reactInstanceManager);
rootLayout.addView(appearingRoot.getView(), matchParentWithBehaviour(new BehaviourDelegate(appearingRoot)));
Options options = appearingRoot.resolveCurrentOptions(defaultOptions);
AnimationOptions enter = options.animations.setRoot.getEnter();
appearingRoot.setWaitForRender(enter.waitForRender);
if (enter.waitForRender.isTrue()) {
appearingRoot.getView().setAlpha(0);
appearingRoot.addOnAppearedListener(() -> {
if (appearingRoot.isDestroyed()) {
listener.onError("Could not set root - Waited for the view to become visible but it was destroyed");
} else {
appearingRoot.getView().setAlpha(1);
animateSetRootAndReportSuccess(appearingRoot, disappearingRoot, listener, options);
}
});
} else {
animateSetRootAndReportSuccess(appearingRoot, disappearingRoot, listener, options);
}
}
use of com.reactnativenavigation.options.Options in project react-native-navigation by wix.
the class ParentControllerTest method findControllerById_Recursive.
@Test
public void findControllerById_Recursive() {
StackController stackController = TestUtils.newStackController(activity).build();
stackController.ensureViewIsCreated();
SimpleViewController child1 = new SimpleViewController(activity, childRegistry, "child1", new Options());
SimpleViewController child2 = new SimpleViewController(activity, childRegistry, "child2", new Options());
stackController.push(child1, new CommandListenerAdapter());
stackController.push(child2, new CommandListenerAdapter());
children.add(stackController);
assertThat(uut.findController("child2")).isEqualTo(child2);
}
Aggregations