use of com.reactnativenavigation.viewcontrollers.parent.ParentController 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);
}
}
Aggregations