Search in sources :

Example 1 with Navigator

use of com.reactnativenavigation.viewcontrollers.navigator.Navigator in project react-native-navigation by wix.

the class NavigationActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (isFinishing()) {
        return;
    }
    addDefaultSplashLayout();
    navigator = new Navigator(this, new ChildControllersRegistry(), new ModalStack(this), new OverlayManager(), new RootPresenter());
    navigator.bindViews();
    getReactGateway().onActivityCreated(this);
}
Also used : OverlayManager(com.reactnativenavigation.viewcontrollers.overlay.OverlayManager) ModalStack(com.reactnativenavigation.viewcontrollers.modal.ModalStack) Navigator(com.reactnativenavigation.viewcontrollers.navigator.Navigator) ChildControllersRegistry(com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry) RootPresenter(com.reactnativenavigation.viewcontrollers.viewcontroller.RootPresenter)

Example 2 with Navigator

use of com.reactnativenavigation.viewcontrollers.navigator.Navigator in project react-native-navigation by wix.

the class Presenter method applyBackgroundColor.

private void applyBackgroundColor(ViewController view, Options options) {
    if (options.layout.backgroundColor.hasValue()) {
        if (view instanceof Navigator)
            return;
        LayerDrawable ld = new LayerDrawable(new Drawable[] { new ColorDrawable(options.layout.backgroundColor.get()) });
        int top = view.resolveCurrentOptions().statusBar.drawBehind.isTrue() ? 0 : SystemUiUtils.getStatusBarHeight(view.getActivity());
        if (!(view instanceof ParentController)) {
            MarginLayoutParams lp = (MarginLayoutParams) view.getView().getLayoutParams();
            if (lp.topMargin != 0)
                top = 0;
        }
        ld.setLayerInset(0, 0, top, 0, 0);
        view.getView().setBackground(ld);
    }
}
Also used : ParentController(com.reactnativenavigation.viewcontrollers.parent.ParentController) ColorDrawable(android.graphics.drawable.ColorDrawable) Navigator(com.reactnativenavigation.viewcontrollers.navigator.Navigator) LayerDrawable(android.graphics.drawable.LayerDrawable) MarginLayoutParams(android.view.ViewGroup.MarginLayoutParams)

Aggregations

Navigator (com.reactnativenavigation.viewcontrollers.navigator.Navigator)2 ColorDrawable (android.graphics.drawable.ColorDrawable)1 LayerDrawable (android.graphics.drawable.LayerDrawable)1 MarginLayoutParams (android.view.ViewGroup.MarginLayoutParams)1 ChildControllersRegistry (com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry)1 ModalStack (com.reactnativenavigation.viewcontrollers.modal.ModalStack)1 OverlayManager (com.reactnativenavigation.viewcontrollers.overlay.OverlayManager)1 ParentController (com.reactnativenavigation.viewcontrollers.parent.ParentController)1 RootPresenter (com.reactnativenavigation.viewcontrollers.viewcontroller.RootPresenter)1