Adding Android ViroAR stuff
This commit is contained in:
10
mobile/.idea/workspace.xml
generated
10
mobile/.idea/workspace.xml
generated
@@ -15,8 +15,8 @@
|
|||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectFrameBounds">
|
<component name="ProjectFrameBounds">
|
||||||
<option name="x" value="-4322" />
|
<option name="x" value="82" />
|
||||||
<option name="y" value="122" />
|
<option name="y" value="121" />
|
||||||
<option name="width" value="1522" />
|
<option name="width" value="1522" />
|
||||||
<option name="height" value="1014" />
|
<option name="height" value="1014" />
|
||||||
</component>
|
</component>
|
||||||
@@ -58,8 +58,8 @@
|
|||||||
<foldersAlwaysOnTop value="true" />
|
<foldersAlwaysOnTop value="true" />
|
||||||
</navigator>
|
</navigator>
|
||||||
<panes>
|
<panes>
|
||||||
<pane id="Scope" />
|
|
||||||
<pane id="ProjectPane" />
|
<pane id="ProjectPane" />
|
||||||
|
<pane id="Scratches" />
|
||||||
<pane id="AndroidView">
|
<pane id="AndroidView">
|
||||||
<subPane>
|
<subPane>
|
||||||
<expand>
|
<expand>
|
||||||
@@ -71,8 +71,8 @@
|
|||||||
<select />
|
<select />
|
||||||
</subPane>
|
</subPane>
|
||||||
</pane>
|
</pane>
|
||||||
<pane id="Scratches" />
|
|
||||||
<pane id="PackagesPane" />
|
<pane id="PackagesPane" />
|
||||||
|
<pane id="Scope" />
|
||||||
</panes>
|
</panes>
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent">
|
<component name="PropertiesComponent">
|
||||||
@@ -191,7 +191,7 @@
|
|||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="ToolWindowManager">
|
<component name="ToolWindowManager">
|
||||||
<frame x="-4322" y="122" width="1522" height="1014" extended-state="0" />
|
<frame x="82" y="121" width="1522" height="1014" extended-state="0" />
|
||||||
<layout>
|
<layout>
|
||||||
<window_info id="Android Profiler" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
<window_info id="Android Profiler" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||||
|
|||||||
@@ -96,11 +96,8 @@
|
|||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-verifier" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-verifier" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-apk" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-apk" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-main-apk-res" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-main-apk-res" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-resources" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaPrecompile" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaPrecompile" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifest-checker" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifest-checker" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
|
||||||
@@ -112,12 +109,11 @@
|
|||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/split-apk" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/split-apk" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/splits-support" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/splits-support" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/tmp" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="jdk" jdkName="Android API 27 Platform" jdkType="Android SDK" />
|
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="library" name="Gradle: com.android.support:appcompat-v7-25.3.1" level="project" />
|
<orderEntry type="library" name="Gradle: com.android.support:appcompat-v7-25.3.1" level="project" />
|
||||||
<orderEntry type="library" name="Gradle: com.android.support:support-fragment-25.3.1" level="project" />
|
<orderEntry type="library" name="Gradle: com.android.support:support-fragment-25.3.1" level="project" />
|
||||||
|
|||||||
@@ -94,13 +94,11 @@ def enableSeparateBuildPerCPUArchitecture = false
|
|||||||
def enableProguardInReleaseBuilds = false
|
def enableProguardInReleaseBuilds = false
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
compileSdkVersion 25
|
||||||
buildToolsVersion rootProject.ext.buildToolsVersion
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.deightonar"
|
applicationId "com.deightonar"
|
||||||
minSdkVersion rootProject.ext.targetSdkVersion
|
minSdkVersion 23
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion 25
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
ndk {
|
ndk {
|
||||||
@@ -126,7 +124,7 @@ android {
|
|||||||
variant.outputs.each { output ->
|
variant.outputs.each { output ->
|
||||||
// For each separate APK per architecture, set a unique version code as described here:
|
// For each separate APK per architecture, set a unique version code as described here:
|
||||||
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
|
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
|
||||||
def versionCodes = ["armeabi-v7a":1, "x86":2]
|
def versionCodes = ["armeabi-v7a": 1, "x86": 2]
|
||||||
def abi = output.getFilter(OutputFile.ABI)
|
def abi = output.getFilter(OutputFile.ABI)
|
||||||
if (abi != null) { // null for the universal-debug, universal-release variants
|
if (abi != null) { // null for the universal-debug, universal-release variants
|
||||||
output.versionCodeOverride =
|
output.versionCodeOverride =
|
||||||
@@ -134,14 +132,28 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
productFlavors {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(dir: "libs", include: ["*.jar"])
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
|
api "com.android.support:appcompat-v7:25.3.1"
|
||||||
compile "com.facebook.react:react-native:+" // From node_modules
|
api 'com.facebook.react:react-native:+'
|
||||||
compile project(':react-native-navigation')
|
// From node_modules
|
||||||
compile project(':react-native-maps')
|
api project(':react-native-navigation')
|
||||||
|
api project(':react-native-maps')
|
||||||
|
api project(':gvr_common')
|
||||||
|
api project(':arcore_client')
|
||||||
|
api project(path: ':react_viro')
|
||||||
|
api project(path: ':viro_renderer')
|
||||||
|
api 'com.google.android.exoplayer:exoplayer:r2.2.0'
|
||||||
|
api 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
|
||||||
|
api 'com.amazonaws:aws-android-sdk-core:2.2.+'
|
||||||
|
api 'com.amazonaws:aws-android-sdk-ddb:2.2.+'
|
||||||
|
api 'com.amazonaws:aws-android-sdk-ddb-mapper:2.2.+'
|
||||||
|
api 'com.amazonaws:aws-android-sdk-cognito:2.2.+'
|
||||||
|
api 'com.amazonaws:aws-android-sdk-cognitoidentityprovider:2.2.+'
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run this once to be able to run the application with BUCK
|
// Run this once to be able to run the application with BUCK
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
||||||
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="24"
|
android:minSdkVersion="24"
|
||||||
@@ -29,7 +30,8 @@
|
|||||||
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
|
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.google.android.geo.API_KEY"
|
android:name="com.google.android.geo.API_KEY"
|
||||||
android:value="AIzaSyDN4E_vzO4cKjKHkMg_49hX1GBnU34kx4U"/>
|
android:value="AIzaSyAC7r1GjMFL1atZdbEcFSdCaXDrPnISqTc" />
|
||||||
|
<meta-data android:name="com.google.ar.core" android:value="required" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import java.util.List;
|
|||||||
import com.reactnativenavigation.NavigationApplication;
|
import com.reactnativenavigation.NavigationApplication;
|
||||||
import com.airbnb.android.react.maps.MapsPackage;
|
import com.airbnb.android.react.maps.MapsPackage;
|
||||||
|
|
||||||
|
import com.viromedia.bridge.ReactViroPackage;
|
||||||
|
|
||||||
public class MainApplication extends NavigationApplication {
|
public class MainApplication extends NavigationApplication {
|
||||||
@Override
|
@Override
|
||||||
public boolean isDebug() {
|
public boolean isDebug() {
|
||||||
@@ -25,7 +27,8 @@ public class MainApplication extends NavigationApplication {
|
|||||||
// Add additional packages you require here
|
// Add additional packages you require here
|
||||||
// No need to add RnnPackage and MainReactPackage
|
// No need to add RnnPackage and MainReactPackage
|
||||||
return Arrays.<ReactPackage>asList(
|
return Arrays.<ReactPackage>asList(
|
||||||
new MapsPackage()
|
new MapsPackage(),
|
||||||
|
new ReactViroPackage(ReactViroPackage.ViroPlatform.GVR)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,13 +23,3 @@ allprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
|
||||||
compileSdkVersion = 27
|
|
||||||
targetSdkVersion = 27
|
|
||||||
minSdkVersion = 24
|
|
||||||
buildToolsVersion = "27.0.3"
|
|
||||||
supportLibVersion = "25.3.1"
|
|
||||||
googlePlayServicesVersion = "11.8.0"
|
|
||||||
androidMapsUtilsVersion = "0.5+"
|
|
||||||
}
|
|
||||||
|
|||||||
BIN
mobile/android/keystores/debug.keystore
Normal file
BIN
mobile/android/keystores/debug.keystore
Normal file
Binary file not shown.
@@ -5,3 +5,8 @@ include ':react-native-navigation'
|
|||||||
project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/android/app/')
|
project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/android/app/')
|
||||||
include ':react-native-maps'
|
include ':react-native-maps'
|
||||||
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
|
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
|
||||||
|
include ':react_viro', ':arcore_client', ':gvr_common', ':viro_renderer'
|
||||||
|
project(':arcore_client').projectDir = new File('../node_modules/react-viro/android/arcore_client')
|
||||||
|
project(':gvr_common').projectDir = new File('../node_modules/react-viro/android/gvr_common')
|
||||||
|
project(':viro_renderer').projectDir = new File('../node_modules/react-viro/android/viro_renderer')
|
||||||
|
project(':react_viro').projectDir = new File('../node_modules/react-viro/android/react_viro')
|
||||||
@@ -321,6 +321,7 @@
|
|||||||
"-lc++",
|
"-lc++",
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
);
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = "com.us.kss.deighton-ar";
|
||||||
PRODUCT_NAME = DeightonAR;
|
PRODUCT_NAME = DeightonAR;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
};
|
};
|
||||||
@@ -347,6 +348,7 @@
|
|||||||
"-lc++",
|
"-lc++",
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
);
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = "com.us.kss.deighton-ar";
|
||||||
PRODUCT_NAME = DeightonAR;
|
PRODUCT_NAME = DeightonAR;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>com.us.kss.$(PRODUCT_NAME:rfc1034identifier)</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
@@ -17,11 +17,11 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0</string>
|
<string>1.0.0</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1</string>
|
<string>20180328.0</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>NSAppTransportSecurity</key>
|
<key>NSAppTransportSecurity</key>
|
||||||
@@ -35,10 +35,10 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
<key>NSLocationWhenInUseUsageDescription</key>
|
|
||||||
<string></string>
|
|
||||||
<key>NSCameraUsageDescription</key>
|
<key>NSCameraUsageDescription</key>
|
||||||
<string>$(PRODUCT_NAME) camera use</string>
|
<string>$(PRODUCT_NAME) camera use</string>
|
||||||
|
<key>NSLocationWhenInUseUsageDescription</key>
|
||||||
|
<string></string>
|
||||||
<key>NSPhotoLibraryUsageDescription</key>
|
<key>NSPhotoLibraryUsageDescription</key>
|
||||||
<string>$(PRODUCT_NAME) photo use</string>
|
<string>$(PRODUCT_NAME) photo use</string>
|
||||||
<key>UILaunchStoryboardName</key>
|
<key>UILaunchStoryboardName</key>
|
||||||
|
|||||||
@@ -21,9 +21,10 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"autobind-decorator": "^2.1.0",
|
"autobind-decorator": "^2.1.0",
|
||||||
|
"create-react-class": "^15.6.3",
|
||||||
"eventemitter3": "^3.0.1",
|
"eventemitter3": "^3.0.1",
|
||||||
"npm": "^5.7.1",
|
"npm": "^5.7.1",
|
||||||
"react": "16.2.0",
|
"react": "^16.2.0",
|
||||||
"react-form-binder": "^1.2.0",
|
"react-form-binder": "^1.2.0",
|
||||||
"react-native": "^0.51.1",
|
"react-native": "^0.51.1",
|
||||||
"react-native-google-maps": "^1.0.0",
|
"react-native-google-maps": "^1.0.0",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { AsyncStorage } from 'react-native'
|
|||||||
const authTokenName = 'AuthToken'
|
const authTokenName = 'AuthToken'
|
||||||
let baseURL = null
|
let baseURL = null
|
||||||
let apiPath = null
|
let apiPath = null
|
||||||
|
//
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
const localIPAddr = process.env.LOCAL_IP_ADDR
|
const localIPAddr = process.env.LOCAL_IP_ADDR
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,11 @@ import { Platform } from 'react-native'
|
|||||||
import { Navigation } from 'react-native-navigation'
|
import { Navigation } from 'react-native-navigation'
|
||||||
import { registerScreens } from './screens'
|
import { registerScreens } from './screens'
|
||||||
|
|
||||||
|
// See https://github.com/facebook/react-native/issues/12981
|
||||||
|
console.ignoredYellowBox = [
|
||||||
|
'Setting a timer'
|
||||||
|
]
|
||||||
|
|
||||||
registerScreens()
|
registerScreens()
|
||||||
|
|
||||||
Navigation.startSingleScreenApp({
|
Navigation.startSingleScreenApp({
|
||||||
|
|||||||
@@ -100,7 +100,9 @@ export class Home extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<View style={Home.styles.container}>
|
<View style={Home.styles.container}>
|
||||||
<MapView
|
<MapView
|
||||||
style={{ width: '100%', height: '50%' }}
|
style={{
|
||||||
|
width: '100%', height: '50%',
|
||||||
|
}}
|
||||||
zoomControlEnabled
|
zoomControlEnabled
|
||||||
initialRegion={{
|
initialRegion={{
|
||||||
latitude: 43.653908,
|
latitude: 43.653908,
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export class Login extends React.Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
binder: new FormBinder({email: 'john@lyon-smith.org', password: 'Skunkay'}, Login.bindings)
|
binder: new FormBinder({email: 'john@lyon-smith.org'}, Login.bindings)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ export class Login extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<KeyboardAvoidingView style={Login.styles.page} behavior='padding'
|
<KeyboardAvoidingView style={Login.styles.page} behavior='padding'
|
||||||
keyboardVerticalOffset={Platform.select({ios: 0, android: 200})}>
|
keyboardVerticalOffset={Platform.select({ios: 0, android: -220})}>
|
||||||
<Image style={Login.styles.logo} source={logoImage} resizeMode='contain' />
|
<Image style={Login.styles.logo} source={logoImage} resizeMode='contain' />
|
||||||
<View style={Login.styles.inputRow}>
|
<View style={Login.styles.inputRow}>
|
||||||
<BoundInput name='email' label='Email:' placeholder='name@xyz.com' message='Must enter a valid email' binder={this.state.binder} />
|
<BoundInput name='email' label='Email:' placeholder='name@xyz.com' message='Must enter a valid email' binder={this.state.binder} />
|
||||||
|
|||||||
@@ -1,6 +1,40 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { StyleSheet, View, TouchableOpacity, Image } from 'react-native'
|
import { StyleSheet, View } from 'react-native'
|
||||||
import backImage from './images/back.png'
|
import {
|
||||||
|
ViroARSceneNavigator, ViroARScene, ViroARPlane, ViroBox, ViroText, ViroAmbientLight
|
||||||
|
} from 'react-viro'
|
||||||
|
import createReactClass from 'create-react-class'
|
||||||
|
|
||||||
|
const styles = {
|
||||||
|
helloWorldTextStyle: {
|
||||||
|
fontFamily: 'Arial',
|
||||||
|
fontSize: 30,
|
||||||
|
color: '#ffffff',
|
||||||
|
textAlignVertical: 'center',
|
||||||
|
textAlign: 'center',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
const WorkItemSceneAR = createReactClass({
|
||||||
|
getInitialState: function() {
|
||||||
|
return {
|
||||||
|
text : "Initializing AR..."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
render: function() {
|
||||||
|
return (
|
||||||
|
<ViroARScene onTrackingInitialized={()=>{this.setState({text : "Hello World!"})}}>
|
||||||
|
<ViroAmbientLight color="#ffffff" intensity={200}/>
|
||||||
|
<ViroText text={this.state.text} scale={[.5, .5, .5]} position={[0, 0, -1]}
|
||||||
|
style={styles.helloWorldTextStyle} />
|
||||||
|
<ViroARPlane>
|
||||||
|
<ViroBox position={[0, .5, 0]} />
|
||||||
|
</ViroARPlane>
|
||||||
|
</ViroARScene>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
export class Viewer extends React.Component {
|
export class Viewer extends React.Component {
|
||||||
static navigatorStyle = {
|
static navigatorStyle = {
|
||||||
@@ -9,35 +43,25 @@ export class Viewer extends React.Component {
|
|||||||
|
|
||||||
static styles = StyleSheet.create({
|
static styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
height: '100%',
|
flex: 1,
|
||||||
width: '100%',
|
},
|
||||||
justifyContent: 'flex-start',
|
arScene: {
|
||||||
backgroundColor: '#AAAAAA',
|
flex: 1,
|
||||||
},
|
},
|
||||||
button: {
|
|
||||||
marginTop: 40,
|
|
||||||
marginLeft: 20,
|
|
||||||
width: 45,
|
|
||||||
height: 45,
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this._handlePressButton = this._handlePressButton.bind(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
_handlePressButton() {
|
|
||||||
this.props.navigator.pop()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<View style={Viewer.styles.container}>
|
<View style={Viewer.styles.arScene}>
|
||||||
<TouchableOpacity onPress={this._handlePressButton}>
|
<ViroARSceneNavigator
|
||||||
<Image style={Viewer.styles.button} source={backImage} />
|
apiKey='06F37B6A-74DA-4A83-965A-7DE2209A5C46'
|
||||||
</TouchableOpacity>
|
style={Viewer.styles.arScene}
|
||||||
|
initialScene={{ scene: WorkItemSceneAR }} debug={true} />
|
||||||
</View>
|
</View>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user