Search in sources :

Example 1 with RootOverlay

use of com.reactnativenavigation.viewcontrollers.viewcontroller.overlay.RootOverlay in project react-native-navigation by wix.

the class Navigator method setRoot.

public void setRoot(final ViewController<?> appearing, CommandListener commandListener, ReactInstanceManager reactInstanceManager) {
    previousRoot = root;
    modalStack.destroy();
    final boolean removeSplashView = isRootNotCreated();
    if (isRootNotCreated())
        getView();
    final ViewController<?> disappearing = previousRoot;
    root = appearing;
    root.setOverlay(new RootOverlay(getActivity(), contentLayout));
    root.setParentController(this);
    rootPresenter.setRoot(appearing, disappearing, defaultOptions, new CommandListenerAdapter(commandListener) {

        @Override
        public void onSuccess(String childId) {
            root.onViewDidAppear();
            if (removeSplashView)
                contentLayout.removeViewAt(0);
            destroyPreviousRoot();
            super.onSuccess(childId);
        }
    }, reactInstanceManager);
}
Also used : RootOverlay(com.reactnativenavigation.viewcontrollers.viewcontroller.overlay.RootOverlay) CommandListenerAdapter(com.reactnativenavigation.react.CommandListenerAdapter)

Aggregations

CommandListenerAdapter (com.reactnativenavigation.react.CommandListenerAdapter)1 RootOverlay (com.reactnativenavigation.viewcontrollers.viewcontroller.overlay.RootOverlay)1