Commit 785d7df1 authored by Gaëtan Renaudeau's avatar Gaëtan Renaudeau Committed by GitHub

Merge pull request #155 from gevorg94/background_color

[android] Set transparent background.
parents 777221b4 c0296b93
......@@ -52,6 +52,16 @@ public class GLCanvasManager extends SimpleViewManager<GLCanvas> {
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")
public void setPointerEvents(GLCanvas view, @Nullable String pointerEventsStr) {
if (pointerEventsStr != null) {
......
import invariant from "invariant";
import React, {Component} from "react";
import {requireNativeComponent, findNodeHandle} from "react-native";
import {requireNativeComponent, findNodeHandle, processColor} from "react-native";
import captureFrame from "./GLCanvas.captureFrame";
const serializeOption = config =>
......@@ -114,13 +114,15 @@ class GLCanvas extends Component {
render () {
const {
width, height,
width, height, style,
onLoad, onProgress, eventsThrough,
...restProps } = this.props;
const { backgroundColor } = style;
return <GLCanvasNative
ref="native"
{...restProps}
backgroundColor={processColor(backgroundColor)}
style={{ width, height }}
onGLLoad={onLoad ? onLoad : 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