Search in sources :

Example 1 with ScreenAnimationListener

use of com.reactnativenavigation.utils.ScreenAnimationListener in project react-native-navigation by wix.

the class ModalPresenter method dismissModal.

void dismissModal(ViewController<?> toDismiss, @Nullable ViewController<?> toAdd, ViewController<?> root, CommandListener listener) {
    if (modalsLayout == null) {
        listener.onError("Can not dismiss modal before activity is created");
        return;
    }
    if (toAdd != null) {
        toAdd.attachView(toAdd == root ? rootLayout : modalsLayout, 0);
        toAdd.onViewDidAppear();
    }
    Options options = toDismiss.resolveCurrentOptions(defaultOptions);
    if (options.animations.dismissModal.getExit().enabled.isTrueOrUndefined()) {
        modalAnimator.dismiss(toAdd, toDismiss, options.animations.dismissModal, new ScreenAnimationListener() {

            @Override
            public void onEnd() {
                onDismissEnd(toDismiss, listener);
            }
        });
    } else {
        onDismissEnd(toDismiss, listener);
    }
}
Also used : Options(com.reactnativenavigation.options.Options) AnimationOptions(com.reactnativenavigation.options.AnimationOptions) ScreenAnimationListener(com.reactnativenavigation.utils.ScreenAnimationListener)

Aggregations

AnimationOptions (com.reactnativenavigation.options.AnimationOptions)1 Options (com.reactnativenavigation.options.Options)1 ScreenAnimationListener (com.reactnativenavigation.utils.ScreenAnimationListener)1