Commit f1076df8 authored by Akalanka B. A. IT18114836's avatar Akalanka B. A. IT18114836

Merge branch 'IT18125962' into 'master'

src file added

See merge request !5
parents 41574b8d 440f3e9a
import React, { useRef,useState, useEffect } from 'react';
import * as eva from '@eva-design/eva';
import { ApplicationProvider, IconRegistry, useTheme } from '@ui-kitten/components';
import { EvaIconsPack } from '@ui-kitten/eva-icons';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
//import {AppNavigator} from './_Navigation';
//const { Navigator, Screen } = createStackNavigator();
import { StyleSheet,Keyboard, SafeAreaView, TouchableWithoutFeedback, Image, useWindowDimensions, View, DrawerLayoutAndroid, ImageBackground, ScrollView, TouchableOpacity, Dimensions } from 'react-native';
import { IndexPath, Drawer, DrawerItem, BottomNavigation, BottomNavigationTab, Button, Datepicker, Autocomplete, AutocompleteItem, RadioGroup, Radio, Card, CheckBox, Divider, Layout, TopNavigation, Icon, Input, Text, TopNavigationAction } from '@ui-kitten/components';
import { BallIndicator, BarIndicator, DotIndicator, MaterialIndicator, PacmanIndicator, PulseIndicator, SkypeIndicator, UIActivityIndicator, WaveIndicator,} from 'react-native-indicators';
// import {storeData, getData} from './_AsyncStorage';
export const MainScreen = ({navigation,route}) => {
const windowWidth = useWindowDimensions().width;
const windowHeight = useWindowDimensions().height;
const Uname ='Randima'
const [age,setAge] = React.useState(route.params.age);
const [gender,setGender] = React.useState(route.params.gender);
const [name,setName] = React.useState(route.params.name);
return (
<Layout style={{backgroundColor:'#f2e5fe',height:windowHeight-20,width:windowWidth,justifyContent:'space-between'}}>
<Card >
<View style={{flexDirection:'row',justifyContent:'center',alignItems:'center'}}>
<Text category='h5'style={{marginLeft:10,fontWeight:'bold'}}>CoviDoc</Text>
</View>
</Card>
<Card style={{borderRadius:10,backgroundColor:'#787fde',margin:5,height:200}}>
<Text category='h1' style={{fontWeight:'bold',color:'#fff'}}>Hello {name}!</Text>
<Text category='h5'style={{color:'#fff'}}>Let's Get Start</Text>
</Card>
<Card onPress={()=>{ console.log('press');navigation.navigate("full",{age: age,gender:gender,name:name,navigation:navigation});}}style={{width:windowWidth-10,height:70,borderRadius:10 ,margin:5,justifyContent:'center',alignItems:'center',backgroundColor:'#8674e3'}}>
<Text style={styles.text}>Full Checkup</Text>
</Card>
<View style={{flexDirection:'row',justifyContent:'space-between',margin:5}}>
<View>
<Card onPress={()=>{ console.log('press');navigation.navigate("symptom",{age: age,gender:gender});}} style={{width:windowWidth/2-10,height:100,borderRadius:10,backgroundColor:'#8674e3' }}>
<Text style={styles.text}>Symptom Tracker</Text>
</Card>
</View>
<TouchableOpacity ></TouchableOpacity>
<View>
<Card onPress={()=>{ console.log('press');navigation.navigate("helth",{age: age,gender:gender});}} style={{width:windowWidth/2-10,height:100 ,borderRadius:10,backgroundColor:'#8674e3'}}>
<Text style={styles.text}>Health History Tracker</Text>
</Card>
</View>
</View>
<View style={{flexDirection:'row',justifyContent:'space-between',margin:5}}>
<View>
<Card onPress={()=>{ console.log('press');navigation.navigate("breathtime",{age: age,gender:gender});}} style={{width:windowWidth/2-10,height:100 ,borderRadius:10,backgroundColor:'#8674e3' }}>
<Text style={styles.text}>Breathing Analysis</Text>
</Card>
</View>
<View>
<Card onPress={()=>{ console.log('press');navigation.navigate("ctimage",{uid: 1,});}} style={{width:windowWidth/2-10,height:100,borderRadius:10,backgroundColor:'#8674e3' }}>
<Text style={styles.text}>CT Image Analysis</Text>
</Card>
</View>
</View>
<View style={{flexDirection:'row',justifyContent:'center',margin:5}}>
<View>
<Card onPress={()=>{ console.log('press');navigation.navigate("xray",{uid: 1,});}} style={{width:windowWidth-10 ,justifyContent:'center',alignItems:'center',height:100 ,borderRadius:10,backgroundColor:'#8674e3'}}>
<Text style={styles.text}>Xray Image Analysis</Text>
</Card>
</View>
{/* <View>
<Card style={{width:windowWidth/2-10,height:100 ,borderRadius:10,backgroundColor:'#8674e3'}}>
<Text style={styles.text}>Report View</Text>
</Card>
</View> */}
</View>
{/* <Card onPress={()=>{ console.log('press');navigation.navigate("mail",{uid: 1,});}} style={{width:windowWidth-10,height:70,borderRadius:10 ,margin:5,backgroundColor:'#8674e3'}}>
<Text style={styles.text}>Doctor Recormendation</Text>
</Card> */}
</Layout>
);
}
const styles = StyleSheet.create({
text: {
color: "white",
fontWeight:'bold'
},
icon:{
height:20, width:20
}
});
\ No newline at end of file
import React, { useState, useEffect } from 'react';
import { SafeAreaView, Image, useWindowDimensions, View, ImageBackground } from 'react-native';
import { Button, Layout, Icon, Text, useTheme } from '@ui-kitten/components';
import { /*BallIndicator, BarIndicator, DotIndicator, */ MaterialIndicator/*, PacmanIndicator, PulseIndicator, SkypeIndicator, UIActivityIndicator, WaveIndicator,*/} from 'react-native-indicators';
//import {storeData, getData} from './_AsyncStorage';
//import { app_name, API, API_VERSION, ThemeContext, cipher } from './_Configuration';
//import CryptoJS from "react-native-crypto-js";
//unused imports removed
export const SplashScreen = ({ navigation }) => {
const windowWidth = useWindowDimensions().width;
const windowHeight = useWindowDimensions().height;
const [init, setInit] = React.useState(0);
//navigation.reset({index: 0, routes: [{ name: 'register' }],});
useEffect(()=>{
// }
if(init == 0){
console.log('print --');
setInit(2);
}
setTimeout( ()=>{navigation.reset({index: 0, routes: [{ name: 'results' }], navigation:navigation});},3000);
}, init);
return (
<SafeAreaView style={{ flex: 1 }}>
{/* <ImageBackground source={require('./Images/back5.jpg')} style={{width: windowWidth, height: windowHeight}}> */}
<Layout style={{ flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: 'white' }}>
{/* <Image source={require('./Images/3.png')} style={{width: windowWidth/2, height: windowHeight/3, resizeMode: 'contain' }}/> */}
<View style={{}}><Image style={{width:windowWidth,}} source={require('./Images/logo.png')}/></View>
<View style={{height: 50, marginTop:10}}>
<MaterialIndicator size={30} color="white"/>
{/* <Button onPress={()=>{navigation.reset({index: 0, routes: [{ name: 'results' }], navigation:navigation});}}>Press</Button> */}
</View>
</Layout>
{/* </ImageBackground> */}
</SafeAreaView>
);
};
import AsyncStorage from '@react-native-async-storage/async-storage';
export const storeData = async (key, value) => {
try {
await AsyncStorage.setItem(key, value);
return true;
} catch (e) {
return false;
}
}
export const getData = async (key) => {
try {
const value = await AsyncStorage.getItem(key);
if(value !== null) {
return value;
}else{
return null;
}
} catch(e) {
return null;
}
}
import React from 'react';
const axios = require('axios').default;
export const app_name = 'CoviDoc';
export const default_theme = 'light';
export const API_URL = 'http://7da2-34-105-7-232.ngrok.io/';
export const API = axios.create({
baseURL: API_URL,
timeout: 10000,
headers: {'x-application': 'crx'},
});
export const API_URL1 = 'https://cxray.herokuapp.com/';
export const API1 = axios.create({
baseURL: API_URL1,
timeout: 10000,
headers: {'x-application': 'crx'},
});
export const API_VERSION = 'v3';
export const ThemeContext = React.createContext({
theme: 'light',
toggleTheme: () => {},
});
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
const { Navigator, Screen } = createStackNavigator();
import { SplashScreen } from './SplashScreen';
import { MainScreen } from './MainScreen';
import { SymptomTracker } from './subScreens/SymptomTracker';
import Xray from './subScreens/Xray';
import Mail from './subScreens/Mail';
import CTimage from './subScreens/CTimage';
import XrayResults from './subScreens/Results';
import {HealthTracker} from './subScreens/HealthTracker';
import {Breathtime} from './subScreens/Breathtime';
import {FullCheckUp} from './subScreens/FullCheckUp';
import { useEffect } from 'react/cjs/react.production.min';
import { TextSave } from './subScreens/TextSave';
const HomeNavigator = () => (
<Navigator headerMode='none'>
<Screen name='splash' component={SplashScreen}/>
<Screen name='main' component={MainScreen}/>
<Screen name='symptom' component={SymptomTracker}/>
<Screen name='full' component={FullCheckUp}/>
<Screen name='breathtime' component={Breathtime}/>
<Screen name='helth' component={HealthTracker}/>
<Screen name='textsave' component={TextSave}/>
<Screen name='xray' component={Xray}/>
<Screen name='mail' component={Mail}/>
<Screen name='ctimage' component={CTimage}/>
<Screen name='results' component={XrayResults}/>
</Navigator>
);
// useEffect(()=>{console.log('navigation');});
export const AppNavigator = () => (
<NavigationContainer>
<HomeNavigator/>
</NavigationContainer>
);
This diff is collapsed.
import React, { useState, useEffect } from 'react';
import { Image, View, ImageBackground, Dimensions, ScrollView, TouchableOpacity, Alert} from 'react-native';
import { Button, Card, Input, Layout, Text,RadioGroup, Radio,} from '@ui-kitten/components';
import {storeData, getData} from '../_AsyncStorage';
import { app_name, API, API_VERSION, cipher } from '../_Configuration';
import * as ImagePicker from 'react-native-image-picker';
import axios from 'axios';
import { readDir } from 'react-native-fs';
export default class XrayResults extends React.Component {
state = {
gender:0 , operation : 0, age:(0) ,name:''
};
windowWidth = Dimensions.get("window").width;
windowHeight = Dimensions.get("window").height;
componentDidMount = () => {
console.log(this.props.navigation);
}
number =(age1)=>{
if (!/^[0-9]+$/.test(age1)) {
console.log('Enter Only Number');
this.setState({age:(0)});
Alert.alert('Age must be a Number');
} else {
console.log('Success');
}
}
render() {
return (
<View style={{justifyContent:'flex-start',paddingTop:100,alignItems:'center',backgroundColor:'#d0c5fa',height:this.windowHeight}}>
<Card style={{borderRadius: 10, marginTop:5,height:400, marginHorizontal:20,backgroundColor:'#f4e6fc'}}>
<View style={{marginVertical:5}}><Text style={{marginVertical:5}}>Enter your Name..</Text>
< Input value={this.state.name} onChangeText={(value)=>{this.setState({name:(value)})}}></Input>
</View>
<Text>Choose your gender..</Text>
<View style={{flex: 1, flexDirection: 'row', marginTop: 20}}>
<View style={(this.state.gender == 0) ? {height: 100, width: this.windowWidth/2 -45, borderWidth: 1, borderColor: '#A30FC1'}:{height: 100, width: this.windowWidth/2 -45}}>
<TouchableOpacity onPress={() => {this.setState({gender:0})}}>
<Image source={require('../Images/man.png')}
style={{width: this.windowWidth/2 -55, height: 85, resizeMode: 'contain', margin:5 }}/>
</TouchableOpacity>
</View>
<View style={(this.state.gender == 1) ? {height: 100, width: this.windowWidth/2 -45, borderWidth: 1, borderColor: '#A30FC1'}:{height: 100, width: this.windowWidth/2 -45}}>
<TouchableOpacity onPress={() => {this.setState({gender:1})}}>
<Image source={require('../Images/woman.png')}
style={{width: this.windowWidth/2 -55, height: 85, resizeMode: 'contain', margin:5 }}/>
</TouchableOpacity>
</View>
</View>
<RadioGroup
selectedIndex={this.state.gender}
onChange={index => this.setState({gender:index})}
style={{flex: 1, flexDirection: 'row', justifyContent: 'space-around', marginTop: 110}}>
<Radio>Male</Radio>
<Radio>Female</Radio>
</RadioGroup>
<View style={{marginVertical:10}}><Text style={{marginVertical:20}}>Choose your Age..</Text>
< Input value={this.state.age} onChangeText={(value)=>{this.number(value);this.setState({age:(value)})}}></Input>
</View>
</Card>
<TouchableOpacity
onPress={()=>{ this.props.navigation.navigate("main",{age: this.state.age,gender: this.state.gender, name: this.state.name , navigation:this.props.navigation});
}}>
<View style={{height:50,width:200,marginVertical:20,justifyContent:'center',alignItems:'center',backgroundColor:'#7f00c7'}}><Text style={{color:'#fff'}}>Next</Text></View>
</TouchableOpacity>
</View>
);
}}
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment