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);
}
}
Aggregations