From 6fd7003a46063ed2901c7abc38de984c13ed11e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Sat, 19 Nov 2016 13:06:27 +0100 Subject: [PATCH] prepare for .27 and do appropriate changes there were a breaking in RN if you use AnimatedSurface --- README.md | 2 +- RNGL.podspec | 4 +- android/RNGL.iml | 16 +-- example/android/app/app.iml | 22 ++-- example/android/app/build.gradle | 1 - .../main/java/com/example/MainActivity.java | 1 - .../java/com/example/MainApplication.java | 6 +- example/android/build.gradle | 2 +- example/android/settings.gradle | 5 +- example/ios/example.xcodeproj/project.pbxproj | 121 ++++++++++++++---- example/package.json | 5 +- example/src/Simple/Button.js | 18 ++- example/src/Simple/OneFingerResponse.js | 1 + example/src/Simple/index.js | 115 ++++++++--------- src/GLCanvas.js | 6 +- 15 files changed, 195 insertions(+), 130 deletions(-) diff --git a/README.md b/README.md index 81de90f..f44898c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ **[Gitbook documentation](http://projectseptemberinc.gitbooks.io/gl-react/content/) / [Github](https://github.com/ProjectSeptemberInc/gl-react-native/) / [gl-react](https://github.com/ProjectSeptemberInc/gl-react/)** / [#gl-react on reactiflux](https://discordapp.com/channels/102860784329052160/106102146109325312) -# icon gl-react-native ![](https://img.shields.io/badge/react--native-%200.36.x-05F561.svg) ![](https://img.shields.io/badge/gl--react-%202.2.x-05F561.svg) +# icon gl-react-native ![](https://img.shields.io/badge/react--native-%200.37.x-05F561.svg) ![](https://img.shields.io/badge/gl--react-%202.2.x-05F561.svg) OpenGL bindings for React Native to implement complex effects over images and components, in the descriptive VDOM paradigm. diff --git a/RNGL.podspec b/RNGL.podspec index 5fdce3a..3dd2d5c 100644 --- a/RNGL.podspec +++ b/RNGL.podspec @@ -1,12 +1,12 @@ Pod::Spec.new do |s| s.name = "RNGL" - s.version = "2.36.0" + s.version = "2.37.0" s.author = "Project September" s.summary = "OpenGL bindings for React Native to implement complex effects over images and components" s.homepage = "https://github.com/ProjectSeptemberInc/gl-react-native" s.platform = :ios, "8.0" - s.source = { :git => "https://github.com/ProjectSeptemberInc/gl-react-native.git", :tag => "v2.36.0" } + s.source = { :git => "https://github.com/ProjectSeptemberInc/gl-react-native.git", :tag => "v2.37.0" } s.source_files = "ios/*.{h,m}" s.license = "MIT" diff --git a/android/RNGL.iml b/android/RNGL.iml index 622add6..58662a6 100644 --- a/android/RNGL.iml +++ b/android/RNGL.iml @@ -67,14 +67,6 @@ - - - - - - - - @@ -83,6 +75,14 @@ + + + + + + + + diff --git a/example/android/app/app.iml b/example/android/app/app.iml index 86c8504..2fe922b 100644 --- a/example/android/app/app.iml +++ b/example/android/app/app.iml @@ -66,14 +66,6 @@ - - - - - - - - @@ -82,9 +74,16 @@ + + + + + + + + - @@ -96,7 +95,7 @@ - + @@ -123,7 +122,6 @@ - @@ -132,6 +130,7 @@ + @@ -143,7 +142,6 @@ - diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 21d9954..e9fcea7 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -124,7 +124,6 @@ dependencies { compile "com.android.support:appcompat-v7:23.0.1" compile "com.facebook.react:react-native:+" // From node_modules - compile project(":RNMaterialKit") compile project(":RNGL") compile project(":react-native-fs") } diff --git a/example/android/app/src/main/java/com/example/MainActivity.java b/example/android/app/src/main/java/com/example/MainActivity.java index af05dfe..fdc2f99 100644 --- a/example/android/app/src/main/java/com/example/MainActivity.java +++ b/example/android/app/src/main/java/com/example/MainActivity.java @@ -3,7 +3,6 @@ package com.example; import com.facebook.react.ReactActivity; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; -import com.github.xinthink.rnmk.ReactMaterialKitPackage; import com.projectseptember.RNGL.RNGLPackage; import com.rnfs.RNFSPackage; diff --git a/example/android/app/src/main/java/com/example/MainApplication.java b/example/android/app/src/main/java/com/example/MainApplication.java index f72a0fb..aeb97df 100644 --- a/example/android/app/src/main/java/com/example/MainApplication.java +++ b/example/android/app/src/main/java/com/example/MainApplication.java @@ -8,7 +8,6 @@ import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; -import com.github.xinthink.rnmk.ReactMaterialKitPackage; import com.projectseptember.RNGL.RNGLPackage; import com.rnfs.RNFSPackage; @@ -28,8 +27,7 @@ public class MainApplication extends Application implements ReactApplication { return Arrays.asList( new MainReactPackage(), new RNGLPackage(), - new RNFSPackage(), - new ReactMaterialKitPackage() + new RNFSPackage() ); } }; @@ -38,4 +36,4 @@ public class MainApplication extends Application implements ReactApplication { public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } -} \ No newline at end of file +} diff --git a/example/android/build.gradle b/example/android/build.gradle index cc73e1e..4315cea 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:2.2.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/example/android/settings.gradle b/example/android/settings.gradle index 45ff32e..4594dda 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -2,11 +2,8 @@ rootProject.name = 'example' include ':app' -include ':RNMaterialKit' -project(':RNMaterialKit').projectDir = file('../node_modules/react-native-material-kit/android') - include ':RNGL' project(':RNGL').projectDir = file('../../android') include ':react-native-fs' -project(':react-native-fs').projectDir = new File(settingsDir, '../node_modules/react-native-fs/android') \ No newline at end of file +project(':react-native-fs').projectDir = new File(settingsDir, '../node_modules/react-native-fs/android') diff --git a/example/ios/example.xcodeproj/project.pbxproj b/example/ios/example.xcodeproj/project.pbxproj index a20a1f0..7cad3fb 100644 --- a/example/ios/example.xcodeproj/project.pbxproj +++ b/example/ios/example.xcodeproj/project.pbxproj @@ -21,7 +21,6 @@ 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; - 3469C4C71C723AD300AE6E0E /* libRCTMaterialKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3469C4C61C723AC400AE6E0E /* libRCTMaterialKit.a */; }; 3469C4C81C723AD300AE6E0E /* libRNFS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3469C4C01C723ABC00AE6E0E /* libRNFS.a */; }; 34BA81381CEDCC6100FCF175 /* libRNGL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3469C4BA1C723AB400AE6E0E /* libRNGL.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; @@ -105,12 +104,54 @@ remoteGlobalIDString = F12AFB9B1ADAF8F800E0535D; remoteInfo = RNFS; }; - 3469C4C51C723AC400AE6E0E /* PBXContainerItemProxy */ = { + 34B928D31DE06CDA00D205B0 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 3469C4C11C723AC400AE6E0E /* RCTMaterialKit.xcodeproj */; + containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A283A1D9B042B00D4039D; + remoteInfo = "RCTImage-tvOS"; + }; + 34B928D71DE06CDA00D205B0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; proxyType = 2; - remoteGlobalIDString = 8A1B8E771B22E4E300DB45C2; - remoteInfo = RCTMaterialKit; + remoteGlobalIDString = 2D2A28471D9B043800D4039D; + remoteInfo = "RCTLinking-tvOS"; + }; + 34B928DB1DE06CDA00D205B0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A28541D9B044C00D4039D; + remoteInfo = "RCTNetwork-tvOS"; + }; + 34B928DF1DE06CDA00D205B0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A28611D9B046600D4039D; + remoteInfo = "RCTSettings-tvOS"; + }; + 34B928E31DE06CDA00D205B0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A287B1D9B048500D4039D; + remoteInfo = "RCTText-tvOS"; + }; + 34B928E81DE06CDA00D205B0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A28881D9B049200D4039D; + remoteInfo = "RCTWebSocket-tvOS"; + }; + 34B928EC1DE06CDA00D205B0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A28131D9B038B00D4039D; + remoteInfo = "React-tvOS"; }; 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; @@ -150,7 +191,6 @@ 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 3469C4AB1C723AB400AE6E0E /* RNGL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNGL.xcodeproj; path = "../node_modules/gl-react-native/ios/RNGL.xcodeproj"; sourceTree = ""; }; 3469C4BB1C723ABC00AE6E0E /* RNFS.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNFS.xcodeproj; path = "../node_modules/react-native-fs/RNFS.xcodeproj"; sourceTree = ""; }; - 3469C4C11C723AC400AE6E0E /* RCTMaterialKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTMaterialKit.xcodeproj; path = "../node_modules/react-native-material-kit/iOS/RCTMaterialKit.xcodeproj"; sourceTree = ""; }; 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -168,7 +208,6 @@ buildActionMask = 2147483647; files = ( 34BA81381CEDCC6100FCF175 /* libRNGL.a in Frameworks */, - 3469C4C71C723AD300AE6E0E /* libRCTMaterialKit.a in Frameworks */, 3469C4C81C723AD300AE6E0E /* libRNFS.a in Frameworks */, 146834051AC3E58100842450 /* libReact.a in Frameworks */, 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, @@ -206,6 +245,7 @@ isa = PBXGroup; children = ( 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, + 34B928D41DE06CDA00D205B0 /* libRCTImage-tvOS.a */, ); name = Products; sourceTree = ""; @@ -214,6 +254,7 @@ isa = PBXGroup; children = ( 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, + 34B928DC1DE06CDA00D205B0 /* libRCTNetwork-tvOS.a */, ); name = Products; sourceTree = ""; @@ -247,6 +288,7 @@ isa = PBXGroup; children = ( 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, + 34B928E01DE06CDA00D205B0 /* libRCTSettings-tvOS.a */, ); name = Products; sourceTree = ""; @@ -255,6 +297,7 @@ isa = PBXGroup; children = ( 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, + 34B928E91DE06CDA00D205B0 /* libRCTWebSocket-tvOS.a */, ); name = Products; sourceTree = ""; @@ -277,6 +320,7 @@ isa = PBXGroup; children = ( 146834041AC3E56700842450 /* libReact.a */, + 34B928ED1DE06CDA00D205B0 /* libReact-tvOS.a */, ); name = Products; sourceTree = ""; @@ -297,18 +341,11 @@ name = Products; sourceTree = ""; }; - 3469C4C21C723AC400AE6E0E /* Products */ = { - isa = PBXGroup; - children = ( - 3469C4C61C723AC400AE6E0E /* libRCTMaterialKit.a */, - ); - name = Products; - sourceTree = ""; - }; 78C398B11ACF4ADC00677621 /* Products */ = { isa = PBXGroup; children = ( 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, + 34B928D81DE06CDA00D205B0 /* libRCTLinking-tvOS.a */, ); name = Products; sourceTree = ""; @@ -316,7 +353,6 @@ 832341AE1AAA6A7D00B99B32 /* Libraries */ = { isa = PBXGroup; children = ( - 3469C4C11C723AC400AE6E0E /* RCTMaterialKit.xcodeproj */, 3469C4BB1C723ABC00AE6E0E /* RNFS.xcodeproj */, 3469C4AB1C723AB400AE6E0E /* RNGL.xcodeproj */, 146833FF1AC3E56700842450 /* React.xcodeproj */, @@ -337,6 +373,7 @@ isa = PBXGroup; children = ( 832341B51AAA6A8300B99B32 /* libRCTText.a */, + 34B928E41DE06CDA00D205B0 /* libRCTText-tvOS.a */, ); name = Products; sourceTree = ""; @@ -444,10 +481,6 @@ ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; }, - { - ProductGroup = 3469C4C21C723AC400AE6E0E /* Products */; - ProjectRef = 3469C4C11C723AC400AE6E0E /* RCTMaterialKit.xcodeproj */; - }, { ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; @@ -560,11 +593,53 @@ remoteRef = 3469C4BF1C723ABC00AE6E0E /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 3469C4C61C723AC400AE6E0E /* libRCTMaterialKit.a */ = { + 34B928D41DE06CDA00D205B0 /* libRCTImage-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTImage-tvOS.a"; + remoteRef = 34B928D31DE06CDA00D205B0 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 34B928D81DE06CDA00D205B0 /* libRCTLinking-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTLinking-tvOS.a"; + remoteRef = 34B928D71DE06CDA00D205B0 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 34B928DC1DE06CDA00D205B0 /* libRCTNetwork-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTNetwork-tvOS.a"; + remoteRef = 34B928DB1DE06CDA00D205B0 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 34B928E01DE06CDA00D205B0 /* libRCTSettings-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTSettings-tvOS.a"; + remoteRef = 34B928DF1DE06CDA00D205B0 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 34B928E41DE06CDA00D205B0 /* libRCTText-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTText-tvOS.a"; + remoteRef = 34B928E31DE06CDA00D205B0 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 34B928E91DE06CDA00D205B0 /* libRCTWebSocket-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTWebSocket-tvOS.a"; + remoteRef = 34B928E81DE06CDA00D205B0 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 34B928ED1DE06CDA00D205B0 /* libReact-tvOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libRCTMaterialKit.a; - remoteRef = 3469C4C51C723AC400AE6E0E /* PBXContainerItemProxy */; + path = "libReact-tvOS.a"; + remoteRef = 34B928EC1DE06CDA00D205B0 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { diff --git a/example/package.json b/example/package.json index a1a2035..2b3f677 100644 --- a/example/package.json +++ b/example/package.json @@ -7,14 +7,13 @@ }, "dependencies": { "crypto": "0.0.3", - "gl-react": "2.2.6", + "gl-react": "2.2.8", "gl-react-blur": "^1.3.0", "gl-react-native": "file:..", "glsl-transitions": "^2016.2.15", "react": "15.3.2", - "react-native": "0.36.1", + "react-native": "0.37.0", "react-native-fs": "1.5.1", - "react-native-material-kit": "PyYoshi/react-native-material-kit#rn-0.25.1", "seedrandom": "gre/seedrandom#released" } } diff --git a/example/src/Simple/Button.js b/example/src/Simple/Button.js index 7bb07b4..84ba62e 100644 --- a/example/src/Simple/Button.js +++ b/example/src/Simple/Button.js @@ -9,20 +9,28 @@ const styles = StyleSheet.create({ borderWidth: 1, borderStyle: "solid", width: 150, - padding: 10 + height: 30, + alignItems: "center", + justifyContent: "center", }, text: { - color: "#333" + color: "#333", } }); class Button extends Component { render () { - const { children, width, ...rest } = this.props; + const { children, style, textStyle, ...rest } = this.props; return ( - - {children} + + + {children} + ); diff --git a/example/src/Simple/OneFingerResponse.js b/example/src/Simple/OneFingerResponse.js index 88ac41d..47982bf 100644 --- a/example/src/Simple/OneFingerResponse.js +++ b/example/src/Simple/OneFingerResponse.js @@ -77,6 +77,7 @@ class OneFingerResponse extends React.Component { ]; return diff --git a/example/src/Simple/index.js b/example/src/Simple/index.js index a3da3c8..532c478 100644 --- a/example/src/Simple/index.js +++ b/example/src/Simple/index.js @@ -1,17 +1,17 @@ import React, {Component} from "react"; -import {StyleSheet, Text, View, Image, TextInput, TouchableOpacity} from "react-native"; +import { + StyleSheet, + Text, + View, + Image, + TextInput, + TouchableOpacity, + Slider, + Switch, +} from "react-native"; import { Surface } from "gl-react-native"; -const { - mdl: { - Progress, - Slider, - Switch - }, - MKButton, -} = require("react-native-material-kit"); - import RNFS from "react-native-fs"; import HelloGL from "./HelloGL"; import Saturation from "./Saturation"; @@ -40,18 +40,16 @@ class Demos extends Component { return {React.Children.map(children, (demo, i) => - onChange(i)}> - - {""+(i+1)} - - )} + {""+(i+1)} + )} {children[value]} @@ -61,34 +59,23 @@ class Demos extends Component { } class Simple extends Component { - constructor (props) { - super(props); - this.state = { - current: 0, - saturationFactor: 1, - hue: 0, - progress: 0, - factor: 0, - text: "and I will return leading the pack", - switch1: false, - switch2: false, - switch3: false, - captured: null, - captureConfig: null - }; - this.onCapture1 = this.onCapture1.bind(this); - /* - // Crazy stress mode - const self = this; - setTimeout(function loop () { - setTimeout(loop, 100 * Math.random()); - self.setState({ current: Math.floor(8 * Math.random()) }); - }, 100); - */ - } + state = { + current: 0, + saturationFactor: 1, + hue: 0, + progress: 0, + factor: 0, + text: "and I will return leading the pack", + switch1: false, + switch2: false, + switch3: false, + captured: null, + captureConfig: null + }; - onCapture1 () { + + onCapture1 = () => { const captureConfig = { quality: Math.round((Math.random() * 100))/100, type: Math.random() < 0.5 ? "jpg": "png", @@ -100,7 +87,7 @@ class Simple extends Component { this.refs.helloGL .captureFrame(captureConfig) .then(captured => this.setState({ captured, captureConfig })); - } + }; render () { const { @@ -124,8 +111,10 @@ class Simple extends Component { - - + + {captured && this.setState({ saturationFactor })} + maximumValue={8} + onValueChange ={saturationFactor => this.setState({ saturationFactor })} /> @@ -174,8 +163,8 @@ class Simple extends Component { this.setState({ hue })} + maximumValue={2 * Math.PI} + onValueChange={hue => this.setState({ hue })} /> this.setState({ progress })} + maximumValue={1} + onValueChange={progress => this.setState({ progress })} /> @@ -230,8 +219,8 @@ class Simple extends Component { this.setState({ factor })} /> + maximumValue={2} + onValueChange={factor => this.setState({ factor })} /> @@ -246,16 +235,14 @@ class Simple extends Component { this.setState({ factor })} + maximumValue={1} + onValueChange={factor => this.setState({ factor })} /> - this.setState({ switch1 })} /> - this.setState({ switch2 })} /> - this.setState({ switch3 })} /> + this.setState({ switch1 })} /> + this.setState({ switch2 })} /> + this.setState({ switch3 })} /> - - diff --git a/src/GLCanvas.js b/src/GLCanvas.js index a174c0d..938d42d 100644 --- a/src/GLCanvas.js +++ b/src/GLCanvas.js @@ -1,6 +1,6 @@ import invariant from "invariant"; import React, {Component} from "react"; -import {requireNativeComponent, findNodeHandle} from "react-native"; + import {requireNativeComponent, findNodeHandle} from "react-native"; import defer from "promise-defer"; import captureFrame from "./GLCanvas.captureFrame"; @@ -17,6 +17,10 @@ const GLCanvasNative = requireNativeComponent("GLCanvas", GLCanvas, { class GLCanvas extends Component { + viewConfig = { + uiViewClassName: "GLCanvas" + }; + componentWillMount () { this._pendingCaptureFrame = {}; } -- 2.26.2