Commit c0296b93 authored by gevorg94's avatar gevorg94

pass backgroundColor directly to GLCanvas

parent 3426cc2a
...@@ -52,6 +52,16 @@ public class GLCanvasManager extends SimpleViewManager<GLCanvas> { ...@@ -52,6 +52,16 @@ public class GLCanvasManager extends SimpleViewManager<GLCanvas> {
view.setZOrderMediaOverlay(overlay); view.setZOrderMediaOverlay(overlay);
} }
@ReactProp(name = "setZOrderOnTop")
public void setZOrderOnTop (GLCanvas view, boolean setZOrderOnTop) {
view.setZOrderOnTop(setZOrderOnTop);
}
@ReactProp(name = "backgroundColor")
public void setBackgroundColor (GLCanvas view, Integer color) {
view.setBackgroundColor(color);
}
@ReactProp(name = "pointerEvents") @ReactProp(name = "pointerEvents")
public void setPointerEvents(GLCanvas view, @Nullable String pointerEventsStr) { public void setPointerEvents(GLCanvas view, @Nullable String pointerEventsStr) {
if (pointerEventsStr != null) { if (pointerEventsStr != null) {
......
import invariant from "invariant"; import invariant from "invariant";
import React, {Component} from "react"; import React, {Component} from "react";
import {requireNativeComponent, findNodeHandle} from "react-native"; import {requireNativeComponent, findNodeHandle, processColor} from "react-native";
import captureFrame from "./GLCanvas.captureFrame"; import captureFrame from "./GLCanvas.captureFrame";
const serializeOption = config => const serializeOption = config =>
...@@ -114,13 +114,15 @@ class GLCanvas extends Component { ...@@ -114,13 +114,15 @@ class GLCanvas extends Component {
render () { render () {
const { const {
width, height, width, height, style,
onLoad, onProgress, eventsThrough, onLoad, onProgress, eventsThrough,
...restProps } = this.props; ...restProps } = this.props;
const { backgroundColor } = style;
return <GLCanvasNative return <GLCanvasNative
ref="native" ref="native"
{...restProps} {...restProps}
backgroundColor={processColor(backgroundColor)}
style={{ width, height }} style={{ width, height }}
onGLLoad={onLoad ? onLoad : null} onGLLoad={onLoad ? onLoad : null}
onGLProgress={onProgress ? onProgress : null} onGLProgress={onProgress ? onProgress : null}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment