Skip to content

Commit

Permalink
Sprint 1
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCommet committed Feb 20, 2017
1 parent 64f5044 commit 04e6ee9
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 80 deletions.
12 changes: 11 additions & 1 deletion android-app/food_sense/index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
47 changes: 23 additions & 24 deletions android-app/food_sense/src/components/SignUp.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -20,18 +20,13 @@ export default class SignUp extends Component{
render() {
return (
<View style={styles.container}>
<View style = {styles.header}>
<View style = {styles.headerRect} >
<Button transparent>
<Icon name='ios-arrow-back' style={{color: "#FFFFFF", fontSize: height * .08, marginTop: height * .02}} />
</Button>
<Text style = {styles.headerText}>Food Sense</Text>
</View>
</View>
<View>
<View style={styles.logoContainer}>
<Text style={styles.title}>Food Sense</Text>
</View>
<ScrollView>
<Fumi
style = {styles.input}
style = {{marginTop: height * .15}}
label={'Username'}
iconClass={FontAwesomeIcon}
iconName={'envelope'}
Expand Down Expand Up @@ -82,11 +77,15 @@ export default class SignUp extends Component{
this.refs.passwordText.focus();
}}
/>
<Button block style = {{marginTop: height * .02, backgroundColor: '#26A69A'}}>
<Text style={{color: '#FFFFFF', fontSize: height * .03}}>
Create Account!
</Text>
</Button>
<View style = {{marginTop: height * .05}}>
<Button
ref = "loginButton"
onPress = {()=>onLoginPress(this.state.username, this.state.password, this.props.navigator)}
title = "Create Account"
color = "#26A69A"
accessibilityLabel="Login to the Application after entering password"
/>
</View>
</ScrollView>
</View>

Expand All @@ -97,8 +96,7 @@ export default class SignUp extends Component{

const styles = StyleSheet.create({
container: {
flex:1,
backgroundColor: '#E0F2F1'
flex:1
},
logoContainer: {
alignItems: 'center',
Expand All @@ -110,7 +108,7 @@ const styles = StyleSheet.create({
fontSize: 30
},
responsiveSpacing: {
marginTop: height * .1
marginTop: 0
},
header: {

Expand Down Expand Up @@ -139,8 +137,9 @@ const styles = StyleSheet.create({

});

const onBack = (_navigator) => {
_navigator.push({
id: 'SignUp'
})
};
{/*This tests to see if an email address is in a valid format*/}
function validateEmail(email)
{
var re = /\S+@\S+\.\S+/;
return re.test(email);
}
63 changes: 8 additions & 55 deletions android-app/food_sense/src/components/TabHolder.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,8 @@
import React, { Component} from 'react';
import { StyleSheet, View, StatusBar } from 'react-native';
import {Container, Content, Header, Title, Button, Subtitle, Left,
Right, Body, Icon, Tabs} from 'native-base';
import Dimensions from 'Dimensions';

import JournalTab from './JournalTab';
import PredictorTab from './PredictorTab';

const height = Dimensions.get('window').height;
const width = Dimensions.get('window').height;

export default class tabHolder extends Component{
render() {
return (
<Container theme = {{brandPrimary:'#029c88'}}>
<Header style = {{backgroundColor: '#029c88'}}>
<Left>
<Button transparent>
<Icon name="menu" />
</Button>
</Left>
<Body>
<Title>Food Sense</Title>
</Body>
<Right>
<Button transparent>
<Icon name="settings" />
</Button>
</Right>
</Header>

<Content>
<View>
<StatusBar
backgroundColor='#029c88'
barStyle="light-content"
/>
</View>
<Tabs style = {styles.tabStyle}>
<JournalTab tabLabel='Journal' />
<PredictorTab tabLabel='Predictor' />
</Tabs>
</Content>
</Container>
);
}
}

const styles = StyleSheet.create({
tabStyle:{
backgroundColor: '#029c88'
}

});
<View style = {styles.header}>
<View style = {styles.headerRect} >
<Button transparent>
<Icon name='ios-arrow-back' style={{color: "#FFFFFF", fontSize: height * .08, marginTop: height * .02}} />
</Button>
<Text style = {styles.headerText}>Food Sense</Text>
</View>
</View>

0 comments on commit 04e6ee9

Please sign in to comment.