Search in sources :

Example 1 with StackAnimationOptions

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());
    }
}
Also used : ButtonOptions(com.reactnativenavigation.options.ButtonOptions) StackAnimationOptions(com.reactnativenavigation.options.StackAnimationOptions) Options(com.reactnativenavigation.options.Options) StackAnimationOptions(com.reactnativenavigation.options.StackAnimationOptions)

Aggregations

ButtonOptions (com.reactnativenavigation.options.ButtonOptions)1 Options (com.reactnativenavigation.options.Options)1 StackAnimationOptions (com.reactnativenavigation.options.StackAnimationOptions)1