use of com.reactnativenavigation.views.stack.StackBehaviour in project react-native-navigation by wix.
the class StackController method addInitialChild.
private void addInitialChild(StackLayout stackLayout) {
if (isEmpty())
return;
ViewController<?> childController = peek();
ViewGroup child = childController.getView();
setChildId(child);
childController.addOnAppearedListener(this::startChildrenBellowTopChild);
stackLayout.addView(child, 0, matchParentWithBehaviour(new StackBehaviour(this)));
presenter.applyInitialChildLayoutOptions(resolveCurrentOptions());
}
use of com.reactnativenavigation.views.stack.StackBehaviour in project react-native-navigation by wix.
the class StackController method pop.
public void pop(Options mergeOptions, CommandListener listener) {
if (!canPop()) {
listener.onError("Nothing to pop");
return;
}
peek().mergeOptions(mergeOptions);
Options disappearingOptions = resolveCurrentOptions(presenter.getDefaultOptions());
final ViewController<?> disappearing = stack.pop();
if (!isViewCreated())
return;
final ViewController<?> appearing = stack.peek();
disappearing.onViewWillDisappear();
ViewGroup appearingView = appearing.getView();
if (appearingView.getLayoutParams() == null) {
appearingView.setLayoutParams(matchParentWithBehaviour(new StackBehaviour(this)));
}
if (appearingView.getParent() == null) {
getView().addView(appearingView, 0);
}
if (disappearingOptions.animations.pop.enabled.isTrueOrUndefined()) {
Options appearingOptions = resolveChildOptions(appearing).withDefaultOptions(presenter.getDefaultOptions());
animator.pop(appearing, disappearing, disappearingOptions, presenter.getAdditionalPopAnimations(appearingOptions, disappearingOptions), () -> finishPopping(appearing, disappearing, listener));
} else {
finishPopping(appearing, disappearing, listener);
}
}
Aggregations