3 Commits

Author SHA1 Message Date
John Lyon-Smith
8282a7c339 Revert debug config 2018-06-28 08:33:47 -07:00
John Lyon-Smith
ea15132d59 Revert to user location from map with better GPS accuracy 2018-06-28 08:32:00 -07:00
John Lyon-Smith
d9fe36cdde Version 1.4.0-20180627.0 2018-06-27 22:35:04 -07:00
14 changed files with 48 additions and 70 deletions

View File

@@ -101,8 +101,8 @@ android {
applicationId "com.deightonar"
minSdkVersion 24
targetSdkVersion 27
versionCode 12
versionName "1.3.0"
versionCode 13
versionName "1.4.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}

View File

@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.deightonar"
android:versionCode="11"
android:versionName="1.3.0">
android:versionName="1.4.0">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

View File

@@ -19,11 +19,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.0</string>
<string>1.4.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>20180604.0</string>
<string>20180627.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>

View File

@@ -1,10 +1,7 @@
import React from "react"
import {
StyleSheet,
Text,
TextInput,
SectionList,
Image,
View,
TouchableOpacity,
TouchableHighlight,
@@ -31,12 +28,8 @@ import KeyboardSpacer from "react-native-keyboard-spacer"
import hardhatPinImage from "./images/hardhat-pin.png"
import clipboardPinImage from "./images/clipboard-pin.png"
import questionPinImage from "./images/question-pin.png"
import locationImage from "./images/location.png"
import moment from "moment"
const neverAskForLocationPermissionKeyName = "NeverAskForLocationPermission"
const neverAskForCameraKeyName = "NeverAskForCameraPermission"
export class Home extends React.Component {
constructor(props) {
super(props)
@@ -48,8 +41,8 @@ export class Home extends React.Component {
showWorkItems: true,
haveCameraPermission: false,
haveLocationPermission: false,
currentPosition: null,
}
this.currentPosition = null
this.isMapReady = false
this.goToRegionWhenReady = false
this.region = null
@@ -97,6 +90,7 @@ export class Home extends React.Component {
}
)
} else {
navigator.geolocation.requestAuthorization()
this.state.haveLocationPermission = true
this.state.haveCameraPermission = true
}
@@ -176,8 +170,8 @@ export class Home extends React.Component {
}
handleWorkItemsListPress() {
if (this.state.currentPosition) {
const { coords } = this.state.currentPosition
if (this.currentPosition) {
const { coords } = this.currentPosition
this.props.history.push(
`/workItemList?latLng=${coords.latitude},${coords.longitude}`
@@ -210,13 +204,13 @@ export class Home extends React.Component {
}
handleGlassesPress() {
const { sections: workItems, currentPosition } = this.state
const { sections: workItems } = this.state
if (currentPosition) {
if (this.currentPosition) {
const {
latitude: latitude1,
longitude: longitude1,
} = currentPosition.coords
} = this.currentPosition.coords
let closestWorkItem = config.alwaysShowWorkItemInAR ? workItems[0] : null
let shortestDistance = config.minDistanceToItem
@@ -248,10 +242,8 @@ export class Home extends React.Component {
}
handleMyLocationPress() {
const { currentPosition } = this.state
if (currentPosition && this.isMapReady) {
const { coords } = currentPosition
if (this.currentPosition && this.isMapReady) {
const { coords } = this.currentPosition
this.mapView.animateToCoordinate({
latitude: coords.latitude,
@@ -281,14 +273,12 @@ export class Home extends React.Component {
}
handlePositionUpdate(position) {
this.setState({ currentPosition: position })
this.currentPosition = position
}
getCoordinateDistance(coordinate) {
const { currentPosition } = this.state
if (currentPosition) {
const { coords } = currentPosition
if (this.currentPosition) {
const { coords } = this.currentPosition
const { latitude, longitude } = coordinate
return (
@@ -313,7 +303,6 @@ export class Home extends React.Component {
waitModal,
haveCameraPermission,
haveLocationPermission,
currentPosition,
} = this.state
return (
@@ -340,7 +329,7 @@ export class Home extends React.Component {
showWorkItems && { height: "40%" },
!showWorkItems && { flexGrow: 1 },
]}
showsUserLocation={false}
showsUserLocation
showsBuildings={false}
showsTraffic={false}
showsIndoors={false}
@@ -376,14 +365,6 @@ export class Home extends React.Component {
</Callout>
</Marker>
))}
{currentPosition && (
<Marker
key={sections.length}
coordinate={currentPosition.coords}
anchor={{ x: 0.5, y: 0.5 }}
image={locationImage}
/>
)}
</MapView>
<View
style={{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

View File

@@ -1,6 +1,6 @@
export const config = {
localIPAddr: "192.168.1.175",
//localIPAddr: "192.168.1.14",
// localIPAddr: "192.168.1.175",
localIPAddr: "192.168.1.14",
viroAPIKey: "06F37B6A-74DA-4A83-965A-7DE2209A5C46",
googleGeocodeAPIKey: "AIzaSyCs4JVT6gysnY5dAJ7KjVJYeykLv_xz1GI",
googleGeocodeURL: "https://maps.googleapis.com/maps/api/geocode/json",
@@ -32,6 +32,4 @@ export const config = {
// },
// alwaysShowWorkItemInAR: true,
geoSampleDelay: 3000,
}

View File

@@ -15,36 +15,35 @@ export class Geolocation extends Component {
constructor(props) {
super(props)
reactAutoBind(this)
if (props.watch) {
this.intervalId = setInterval(this.updateLocation, config.geoSampleDelay)
} else {
this.intervalId = -1
}
this.watchId = -1
}
componentDidMount() {
this.updateLocation()
}
componentWillUnmount() {
if (this.intervalId !== -1) {
clearInterval(this.intervalId)
this.intervalId = -1
}
}
updateLocation() {
navigator.geolocation.getCurrentPosition(
(position) => {
this.props.onUpdate(position)
if (this.props.watch) {
;(this.watchId = navigator.geolocation.watchPosition((position) =>
this.props.onUpdate(position)
)),
null,
{ distanceFilter: 5, maximumAge: 0, enableHighAccuracy: true }
}
},
null,
{ distanceFilter: 5, maximumAge: 0, enableHighAccuracy: true }
)
}
componentWillUnmount() {
if (this.watchId !== -1) {
navigator.geolocation.clearWatch(this.watchId)
navigator.geolocation.stopObserving()
this.watchId = -1
}
}
render() {
return null
}

View File

@@ -1,6 +1,6 @@
export const versionInfo = {
version: '1.3.0',
fullVersion: '1.3.0-20180604.0',
version: '1.4.0',
fullVersion: '1.4.0-20180627.0',
title: 'Deighton AR System',
copyright: '© 2018, Kingston Software Solutions.',
supportEmail: 'support@kss.us.com',

View File

@@ -1,6 +1,6 @@
{
"name": "deighton-ar",
"version": "1.3.0",
"version": "1.4.0",
"description": "Deighton AR Training System",
"main": "index.js",
"repository": {

View File

@@ -1,6 +1,6 @@
export const versionInfo = {
version: '1.3.0',
fullVersion: '1.3.0-20180604.0',
version: '1.4.0',
fullVersion: '1.4.0-20180627.0',
title: 'Deighton AR System',
copyright: '© 2018, Kingston Software Solutions.',
supportEmail: 'support@kss.us.com',

View File

@@ -15,11 +15,11 @@
buildFormat: "full",
tags: {
major: 1,
minor: 3,
minor: 4,
patch: 0,
build: 20180604,
build: 20180627,
revision: 0,
sequence: 12,
sequence: 13,
tz: "America/Los_Angeles",
title: "Deighton AR System",
copyright: "© 2018, Kingston Software Solutions.",

View File

@@ -1,6 +1,6 @@
export const versionInfo = {
version: '1.3.0',
fullVersion: '1.3.0-20180604.0',
version: '1.4.0',
fullVersion: '1.4.0-20180627.0',
title: 'Deighton AR System',
copyright: '© 2018, Kingston Software Solutions.',
supportEmail: 'support@kss.us.com',