*
This commit is contained in:
Ren Juan 2021-08-28 03:34:05 +00:00
parent 6c2cf9c460
commit ef315a96c5
4 changed files with 31 additions and 17 deletions

View File

@ -2,7 +2,7 @@
"expo": { "expo": {
"name": "GT2 Green Travel Carbon App", "name": "GT2 Green Travel Carbon App",
"slug": "GT2standalone", "slug": "GT2standalone",
"version": "2.0.0", "version": "2.0.4",
"orientation": "default", "orientation": "default",
"description": "Travel Carbon Footprint (simplified version)", "description": "Travel Carbon Footprint (simplified version)",
"icon": "./assets/images/icon.png", "icon": "./assets/images/icon.png",

View File

@ -18,12 +18,12 @@ export default function ScreenInfo() {
} }
export function ScreenInfo2() { export function ScreenInfo2() {
return ( return (
<View style={styles.settingsContainer}> <View>
<Text <Text
style={styles.settingsText} style={styles.tripControlText}
lightColor="rgba(0,0,0,0.8)" lightColor="rgba(0,0,0,0.8)"
darkColor="rgba(255,255,255,0.8)"> darkColor="rgba(255,255,255,0.8)">
Pause trip if fuel burning interrupted. {'Pause trip if fuel burning interrupted.\n'}
</Text> </Text>
</View> </View>
); );
@ -35,7 +35,7 @@ export function ScreenInfo4() {
style={styles.sensitive} style={styles.sensitive}
lightColor="rgba(0,0,0,0.8)" lightColor="rgba(0,0,0,0.8)"
darkColor="rgba(255,255,255,0.8)"> darkColor="rgba(255,255,255,0.8)">
{'higher sensitivity may cause spurious motion at rest'} {'set CO2 rate above or \nselect fuel type below\nhigher sensitivity may cause\n spurious motion at rest'}
</Text> </Text>
</View> </View>
); );
@ -91,7 +91,8 @@ const styles = StyleSheet.create({
}, },
sensitive: { sensitive: {
fontWeight: 'bold', fontWeight: 'bold',
fontSize: 10, fontSize: 14,
textAlign: 'center',
}, },
titleText: { titleText: {
color: 'white', color: 'white',
@ -109,6 +110,12 @@ const styles = StyleSheet.create({
lineHeight: 24, lineHeight: 24,
textAlign: 'center', textAlign: 'center',
}, },
tripControlText: {
fontSize: 14,
fontWeight: 'bold',
lineHeight: 24,
textAlign: 'center',
},
versionText: { versionText: {
color: 'yellow', color: 'yellow',
fontSize: 10, fontSize: 10,

View File

@ -18,7 +18,11 @@ export default function SettingsScreen( { navigation }: RootTabScreenProps<'Sett
<View style={styles.container}> <View style={styles.container}>
<Text style={styles.title}>Model Settings</Text> <Text style={styles.title}>Model Settings</Text>
<View style={styles.separator} lightColor="#eee" darkColor="rgba(255,255,255,0.1)" /> <View style={styles.separator} lightColor="#eee" darkColor="rgba(255,255,255,0.1)" />
<Text style={styles.caption}>{'\nset custom CO2 rate or use buttons below'}</Text> <View style={styles.captions}>
<Text style={styles.caption}>CO2 / km</Text>
<Text>{' '}</Text>
<Text style={styles.caption}>sensitivity</Text>
</View>
<View style={styles.inputs}> <View style={styles.inputs}>
<TextInput <TextInput
style={styles.input} style={styles.input}
@ -28,9 +32,6 @@ export default function SettingsScreen( { navigation }: RootTabScreenProps<'Sett
placeholder={Trips.co2Rate.toString()} placeholder={Trips.co2Rate.toString()}
keyboardType="numeric" keyboardType="numeric"
/> />
</View>
<Text style={styles.caption}>{'\nsensitivity'}</Text>
<View style={styles.inputs}>
<TextInput <TextInput
style={styles.input} style={styles.input}
returnKeyType={'done'} returnKeyType={'done'}
@ -90,7 +91,7 @@ const styles = StyleSheet.create({
justifyContent: 'center', justifyContent: 'center',
}, },
switch: { switch: {
marginVertical: 20, marginVertical: 2,
}, },
container: { container: {
flex: 1, flex: 1,
@ -103,8 +104,14 @@ const styles = StyleSheet.create({
flexDirection: 'row', flexDirection: 'row',
justifyContent: "space-between", justifyContent: "space-between",
}, },
captions: {
marginVertical: 15,
width: "90%",
flexDirection: 'row',
justifyContent: "center"
},
inputs: { inputs: {
marginVertical: 5, marginVertical: -20,
width: "80%", width: "80%",
flexDirection: 'row', flexDirection: 'row',
justifyContent: "center", justifyContent: "center",
@ -120,7 +127,7 @@ const styles = StyleSheet.create({
}, },
input: { input: {
height: 40, height: 40,
margin: 30, margin: 10,
borderWidth: 1, borderWidth: 1,
padding: 10, padding: 10,
}, },

View File

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