diff --git a/android-app/food_sense/index.android.js b/android-app/food_sense/index.android.js index e44b7da..6793273 100644 --- a/android-app/food_sense/index.android.js +++ b/android-app/food_sense/index.android.js @@ -11,12 +11,22 @@ import { Text, View, StatusBar, - Navigator + Navigator, + BackAndroid } from 'react-native'; import Login from './src/components/Login'; import SignUp from './src/components/SignUp'; import Journal from './src/components/Journal'; + +BackAndroid.addEventListener('hardwareBackPress', () => { + if (_navigator.getCurrentRoutes().length === 1 ) { + return false; + } + _navigator.pop(); + return true; +}); + export default class food_sense extends Component { render() { return ( diff --git a/android-app/food_sense/src/components/SignUp.js b/android-app/food_sense/src/components/SignUp.js index b175b45..28b9566 100644 --- a/android-app/food_sense/src/components/SignUp.js +++ b/android-app/food_sense/src/components/SignUp.js @@ -1,6 +1,6 @@ import React, { Component} from 'react'; -import { StyleSheet, View, Text, Alert, TextInput, StatusBar, ScrollView} from 'react-native'; -import {Icon, Button} from 'native-base'; +import { StyleSheet, View, Text, Alert, TextInput, StatusBar, ScrollView, Button} from 'react-native'; +import {Icon} from 'native-base'; import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome'; import { Fumi } from 'react-native-textinput-effects'; import Dimensions from 'Dimensions'; @@ -20,18 +20,13 @@ export default class SignUp extends Component{ render() { return ( - - - - Food Sense - - + + Food Sense + - + + - - - Food Sense - - - - - - - - - - - - - - - - - ); - } -} - -const styles = StyleSheet.create({ - tabStyle:{ - backgroundColor: '#029c88' - } - -}); \ No newline at end of file + + + + Food Sense + +