Skip to content

Commit

Permalink
Merge pull request #7 from Tharuka-Nimesha/master
Browse files Browse the repository at this point in the history
Product track screen
  • Loading branch information
dilinade authored Oct 11, 2020
2 parents d428c3f + ce74631 commit 486b514
Show file tree
Hide file tree
Showing 9 changed files with 3,401 additions and 285 deletions.
6 changes: 3 additions & 3 deletions Mobile/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

buildscript {
ext {
buildToolsVersion = "28.0.3"
buildToolsVersion = "29.0.3"
minSdkVersion = 16
compileSdkVersion = 28
compileSdkVersion = 29
targetSdkVersion = 28
}
repositories {
Expand All @@ -21,6 +21,7 @@ buildscript {

allprojects {
repositories {
google()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
Expand All @@ -31,7 +32,6 @@ allprojects {
url("$rootDir/../node_modules/jsc-android/dist")
}

google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
Expand Down
3,547 changes: 3,281 additions & 266 deletions Mobile/package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@
"lint": "eslint ."
},
"dependencies": {
"@react-native-community/cli-platform-android": "^4.10.1",
"@react-native-community/masked-view": "^0.1.10",
"@react-navigation/bottom-tabs": "^5.3.3",
"@react-navigation/material-top-tabs": "^5.1.14",
"@react-navigation/native": "^5.2.3",
"@react-navigation/stack": "^5.2.18",
"i": "^0.3.6",
"npm": "^6.14.7",
"react": "16.11.0",
"react-native": "0.62.2",
"react-native-camera": "^3.23.1",
Expand Down
21 changes: 21 additions & 0 deletions Mobile/src/navigation/historyStack_navigation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* eslint-disable prettier/prettier */

import React from 'react';
import { createStackNavigator } from '@react-navigation/stack';

import maintab_history_screen from '../screens/maintab_history_screen';

const stack = createStackNavigator();

export default function ScanStack_navigation() {
return (
<stack.Navigator
screenOptions={{
headerTitleAlign: 'center',
headerTitleStyle: { color: 'rgba(0,0,0,.7)', fontSize:23 }
}}
>
<stack.Screen name="scan" options={{ title: 'S-Chain' }} component={maintab_history_screen} />
</stack.Navigator>
);
}
8 changes: 3 additions & 5 deletions Mobile/src/navigation/mainTab_navigation.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
/* eslint-disable prettier/prettier */
import React from 'react';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';

import AntDesign from 'react-native-vector-icons/AntDesign';
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';

import Maintab_products_screen from '../screens/maintab_products_screen';
import Maintab_history_screen from '../screens/maintab_history_screen';

import ScanStack_navigation from './scanStack_navigation';
import ProductStack_navigation from './productStack_navigation';
import HistoryStack_navigation from './historyStack_navigation';

const Tab = createBottomTabNavigator();

Expand Down Expand Up @@ -40,7 +38,7 @@ export default function MainTab_navigation() {
>
<Tab.Screen name="Scan" component={ScanStack_navigation} />
<Tab.Screen name="Products" component={ProductStack_navigation} />
<Tab.Screen name="History" component={Maintab_history_screen} />
<Tab.Screen name="History" component={HistoryStack_navigation} />
</Tab.Navigator>
);
}
2 changes: 1 addition & 1 deletion Mobile/src/navigation/productTab_navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function ProductTab_navigation() {
>
<Tab.Screen name="General" component={Product_info_screen} />
<Tab.Screen name="Track" component={Product_track_screen} />
<Tab.Screen name="Website" component={Product_website_screen} />
{/* <Tab.Screen name="Website" component={Product_website_screen} /> Use a web element if you want to */}
</Tab.Navigator>
);
}
2 changes: 1 addition & 1 deletion Mobile/src/screens/maintab_history_screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { widthPercentageToDP as wp } from 'react-native-responsive-screen';
export default function History_screen() {
return (
<View style={styles.container}>
<Text>History Screen</Text>
<Text>This Screen will show your search history</Text>
</View>
);
}
Expand Down
91 changes: 85 additions & 6 deletions Mobile/src/screens/product_track_screen.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,101 @@
/* eslint-disable prettier/prettier */

import React from 'react';
import { StyleSheet, View, Text, Image } from 'react-native';
import { StyleSheet, View, ScrollView, Text, Image } from 'react-native';
import { widthPercentageToDP as wp } from 'react-native-responsive-screen';

export default function Product_track_screen() {
return (
<View style={styles.container}>
<Text>Product Track Screen</Text>
</View>
<ScrollView style={styles.container}>
<View style={styles.topImageContainer}>
<Image
source={{ uri: 'https://www.ihannasadventures.de/wp-content/uploads/2019/03/Tag3-1024x536.jpg' }}
resizeMode='cover'
style={styles.image}
/>
</View>
<View style={styles.titleContainer}>
<Text style={styles.titleBig}>Lavazza Dark Coffee</Text>
</View>
<View style={styles.bottomContainer}>
<View style={styles.group}>
<Text style={styles.title}>Planted</Text>
<Text style={styles.Subtitle}>Date : 2019/5/16</Text>
<Text style={styles.Subtitle}>Location : Svolokia</Text>
</View>

<View style={styles.group}>
<Text style={styles.title}>Harvested</Text>
<Text style={styles.Subtitle}>Date : 2019/8/4</Text>
<Text style={styles.Subtitle}>Location : Henningsvaer</Text>
</View>

<View style={styles.group}>
<Text style={styles.title}>Process</Text>
<Text style={styles.Subtitle}>Date : 2019/8/20</Text>
<Text style={styles.Subtitle}>Location : Rovikstranda</Text>
</View>

<View style={styles.group}>
<Text style={styles.title}>Shiped</Text>
<Text style={styles.Subtitle}>Date : 2019/9/10</Text>
<Text style={styles.Subtitle}>Location : Haukland Hardbour</Text>
</View>
</View>
</ScrollView>
);
}

const styles = StyleSheet.create({
group:{
paddingVertical:wp(4),
borderBottomWidth:0.8,
borderColor:'gray'
},
Subtitle:{
fontSize: 15,
paddingLeft:wp(5)
},
title:{
fontSize: 17,
fontWeight:'bold',
marginBottom:wp(1)
},
titleBig: {
fontSize: 20,
},
bottomContainer: {
paddingBottom:wp(5),
paddingHorizontal:wp(5),
height:'auto',
width:wp(100),
justifyContent:'center',
borderColor:'gray',
borderBottomWidth:.8,
},
titleContainer:{
height:wp(20),
width:wp(100),
alignItems:'center',
justifyContent:'center',
borderColor:'gray',
borderBottomWidth:.8,
backgroundColor: 'rgba(255, 218, 194, .5)'
},
image: {
height: '100%',
width: '100%',
},
topImageContainer:{
height:wp(60),
width:wp(100),
// alignItems:'center',
// justifyContent:'center',
borderColor:'gray',
borderBottomWidth:.8,
},
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'rgba(255, 218, 194, .4)', //'white',
},
});
6 changes: 3 additions & 3 deletions Mobile/src/screens/product_website_screen.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/* eslint-disable prettier/prettier */

import React from 'react';
import { StyleSheet, View, Text, Image } from 'react-native';
import React from 'react';
import { StyleSheet, View, Text, Image, WebView } from 'react-native';
import { widthPercentageToDP as wp } from 'react-native-responsive-screen';

export default function Product_website_screen() {
return (
<View style={styles.container}>
<Text>Product Website Screen</Text>
<WebView source={{ uri: 'https://www.lavazza.com/en.html' }} />
</View>
);
}
Expand Down

0 comments on commit 486b514

Please sign in to comment.