From f3b3883a8a8860c22712d884e54ed6ba82f1b695 Mon Sep 17 00:00:00 2001 From: Ren Juan Date: Sat, 28 Aug 2021 10:27:48 +0000 Subject: [PATCH] 2.0.5 --- Ejectable/App.tsx | 5 ++++- Ejectable/app.json | 7 ++++++- Ejectable/components/EndScreenInfo.tsx | 3 ++- Ejectable/screens/ModalScreen.tsx | 2 +- Ejectable/screens/TripScreen.tsx | 2 +- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Ejectable/App.tsx b/Ejectable/App.tsx index f06ee32f..d30b4a49 100644 --- a/Ejectable/App.tsx +++ b/Ejectable/App.tsx @@ -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); + } })(); }, []); diff --git a/Ejectable/app.json b/Ejectable/app.json index aa47faf3..3cb7c15a 100644 --- a/Ejectable/app.json +++ b/Ejectable/app.json @@ -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" diff --git a/Ejectable/components/EndScreenInfo.tsx b/Ejectable/components/EndScreenInfo.tsx index 12f10c6b..053df26b 100644 --- a/Ejectable/components/EndScreenInfo.tsx +++ b/Ejectable/components/EndScreenInfo.tsx @@ -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', }, diff --git a/Ejectable/screens/ModalScreen.tsx b/Ejectable/screens/ModalScreen.tsx index 2fdd48e0..d2bd351e 100644 --- a/Ejectable/screens/ModalScreen.tsx +++ b/Ejectable/screens/ModalScreen.tsx @@ -36,7 +36,7 @@ const styles = StyleSheet.create({ fontWeight: 'bold', }, separator: { - marginVertical: 10, + marginVertical: 5, height: 1, width: '80%', }, diff --git a/Ejectable/screens/TripScreen.tsx b/Ejectable/screens/TripScreen.tsx index 0dd72322..2bde6c2e 100644 --- a/Ejectable/screens/TripScreen.tsx +++ b/Ejectable/screens/TripScreen.tsx @@ -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();