This commit is contained in:
Ren Juan 2021-08-28 10:27:48 +00:00
parent ef315a96c5
commit f3b3883a8a
5 changed files with 14 additions and 5 deletions

View File

@ -1,7 +1,7 @@
import 'react-native-gesture-handler';
import { StatusBar } from 'expo-status-bar';
import React, { useState, useEffect } from 'react';
import { Text } from 'react-native';
import { Alert, Text } from 'react-native';
import * as Location from 'expo-location';
import { SafeAreaProvider } from 'react-native-safe-area-context';
@ -31,12 +31,15 @@ export default function App() {
if (status !== 'granted') {
setErrorMsg('Permission to access location was denied');
Trips.setLocEnabled(false);
Alert.alert("Permission to access location was denied, this app requires it.");
return;
} else Trips.setLocEnabled(true);
if (debug) {
let location = await Location.getCurrentPositionAsync({});
setLocation(location);
Trips.deltaLoc(location);
}
})();
}, []);

View File

@ -2,7 +2,7 @@
"expo": {
"name": "GT2 Green Travel Carbon App",
"slug": "GT2standalone",
"version": "2.0.4",
"version": "2.0.5",
"orientation": "default",
"description": "Travel Carbon Footprint (simplified version)",
"icon": "./assets/images/icon.png",
@ -29,6 +29,11 @@
}
},
"android": {
"permissions": [
"ACCESS_COARSE_LOCATION",
"ACCESS_FINE_LOCATION",
"FOREGROUND_SERVICE"
],
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#ffffff"

View File

@ -45,11 +45,12 @@ function handleHelpPress() {
const styles = StyleSheet.create({
summaryContainer: {
marginVertical: -9,
alignItems: 'center',
marginHorizontal: 50,
},
helpContainer: {
marginTop: 15,
marginTop: 10,
marginHorizontal: 20,
alignItems: 'center',
},

View File

@ -36,7 +36,7 @@ const styles = StyleSheet.create({
fontWeight: 'bold',
},
separator: {
marginVertical: 10,
marginVertical: 5,
height: 1,
width: '80%',
},

View File

@ -71,7 +71,7 @@ export default function TripScreen( { navigation }: RootTabScreenProps<'Trip'>)
title={sButtonText}
onPress={() => {
if (!getAdvised()) {
Alert.alert("GT2 2.0.n doesn't runs in background.");
Alert.alert("Note: GT2 2.0.n doesn't run in background.");
setAdvised();
}
if (!Trips.inProgress) {startTrip();