Added Header, Icon and MessageModal. Refactor screens into directories.
This commit is contained in:
73
mobile/src/ARViewer/ARViewer.js
Normal file
73
mobile/src/ARViewer/ARViewer.js
Normal file
@@ -0,0 +1,73 @@
|
||||
import React from 'react'
|
||||
import { StyleSheet, View } from 'react-native'
|
||||
import {
|
||||
ViroARSceneNavigator, ViroARScene, ViroARPlane, ViroBox, ViroText, ViroAmbientLight
|
||||
} from 'react-viro'
|
||||
import autobind from 'autobind-decorator'
|
||||
import backImage from './images/back.png'
|
||||
|
||||
const styles = {
|
||||
helloWorldTextStyle: {
|
||||
fontFamily: 'Arial',
|
||||
fontSize: 30,
|
||||
color: '#ffffff',
|
||||
textAlignVertical: 'center',
|
||||
textAlign: 'center',
|
||||
},
|
||||
buttons : {
|
||||
height: 80,
|
||||
width: 80,
|
||||
},
|
||||
}
|
||||
|
||||
class WorkItemSceneAR extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
text : "Initializing AR..."
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
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 ARViewer extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
@autobind
|
||||
_handlePress() {
|
||||
this.props.history.replace('/')
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View style={{ width: '100%', height: '100%' }} >
|
||||
<ViroARSceneNavigator
|
||||
style={{ width: '100%', height: '100%' }}
|
||||
apiKey='06F37B6A-74DA-4A83-965A-7DE2209A5C46'
|
||||
initialScene={{ scene: WorkItemSceneAR }} />
|
||||
|
||||
<View style={{position: 'absolute', left: 50, right: 0, top: 50}}>
|
||||
<TouchableHighlight style={styles.buttons} onPress={this._handlePress} underlayColor={'#00000000'} >
|
||||
<Image source={backImage} />
|
||||
</TouchableHighlight>
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user