use of com.reactnativenavigation.options.StackAnimationOptions in project react-native-navigation by wix.
the class StackController method push.
public void push(ViewController<?> child, CommandListener listener) {
if (findController(child.getId()) != null) {
listener.onError("A stack can't contain two children with the same id: " + child.getId());
return;
}
final ViewController<?> toRemove = stack.peek();
if (size() > 0)
backButtonHelper.addToPushedChild(child);
child.setParentController(this);
stack.push(child.getId(), child);
if (!isViewCreated())
return;
Options resolvedOptions = resolveCurrentOptions(presenter.getDefaultOptions());
addChildToStack(child, resolvedOptions);
if (toRemove != null) {
StackAnimationOptions animation = resolvedOptions.animations.push;
if (animation.enabled.isTrueOrUndefined()) {
animator.push(child, toRemove, resolvedOptions, presenter.getAdditionalPushAnimations(this, child, resolvedOptions), () -> onPushAnimationComplete(child, toRemove, listener));
} else {
onPushAnimationComplete(child, toRemove, listener);
}
} else {
listener.onSuccess(child.getId());
}
}
Aggregations