From f919e876f371fa2e5d9a168197f47095b3635201 Mon Sep 17 00:00:00 2001 From: bmgit16 Date: Wed, 25 Oct 2023 21:25:18 -0500 Subject: [PATCH 1/2] giMerge branches 'main' and 'BhuvanaBranch' of https://github.com/acm-projects/Wasted --- .DS_Store | Bin 6148 -> 6148 bytes WastedApp/App.js | 13 ++++- WastedApp/package-lock.json | 21 ++++++++ WastedApp/package.json | 2 + WastedApp/src/screens/Camera.js | 69 ++++++++++++++++++++++++++ WastedApp/src/screens/Homescreen.js | 17 ++++++- WastedApp/src/screens/landing_page.js | 20 +++++++- 7 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 WastedApp/src/screens/Camera.js diff --git a/.DS_Store b/.DS_Store index 7aa7df7c868e2b26e421a523f482a6b53a3fa274..9e04ad88022e92a699b70e62c97fa4152feee7d9 100644 GIT binary patch delta 139 zcmZoMXffC@kx6NLQbA5;afyM!HAW_87FITP4t5T1j@aOg{PN(E#FEltr^yGIyuCR& zIO7GxtE-L7bQFvXjB9lisx6HSbQDa?OloU6IYgE9t%KsTb8_?YI~l-$kr6^O@Iq-A Y)it?*No;c=^E8%;4MLmQIsWnk0FWaeRR910 delta 154 zcmZoMXffC@k;&j>QbA5;afyM!bw(y;7FITP4h}9ZE?%zK;Eeq8;F83W(qgB?qG%8= zAh9GPY4TPR@7%iRx-YQ%fBMV*`s?9ffL3BLf`;6JxX5T22meRYP0Pgxt!i k>YCcRnG9gS$Oxes_@Ok6nl-tANo;dG^E8&t>>Pjj0fj0gsQ>@~ diff --git a/WastedApp/App.js b/WastedApp/App.js index 1408d95..77c9749 100644 --- a/WastedApp/App.js +++ b/WastedApp/App.js @@ -6,11 +6,14 @@ import landing_page from './src/screens/landing_page'; import LoginScreen from './src/screens/login'; import create_account from './src/screens/create_account'; import Homescreen from './src/screens/Homescreen'; // Correct the import name - +import Camera from './src/screens/Camera'; const Stack = createNativeStackNavigator(); export default function App() { - return ( + + return ( + /** camera page */ + + + ); } diff --git a/WastedApp/package-lock.json b/WastedApp/package-lock.json index 585a83c..4701e87 100644 --- a/WastedApp/package-lock.json +++ b/WastedApp/package-lock.json @@ -12,6 +12,8 @@ "@react-navigation/native": "^6.1.8", "@react-navigation/native-stack": "^6.9.14", "expo": "~49.0.13", + "expo-camera": "~13.4.4", + "expo-media-library": "~15.4.1", "expo-status-bar": "~1.6.0", "firebase": "^10.4.0", "react": "18.2.0", @@ -9731,6 +9733,17 @@ "url-parse": "^1.5.9" } }, + "node_modules/expo-camera": { + "version": "13.4.4", + "resolved": "https://registry.npmjs.org/expo-camera/-/expo-camera-13.4.4.tgz", + "integrity": "sha512-7k54APbpSulUDR2CrD5SrmKjCdfdg4tqKRpbBOKc2J2MIBHhunExU77435JDYSejHRY5bfRHZsEp3yKwR862uw==", + "dependencies": { + "invariant": "^2.2.4" + }, + "peerDependencies": { + "expo": "*" + } + }, "node_modules/expo-constants": { "version": "14.4.2", "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-14.4.2.tgz", @@ -9773,6 +9786,14 @@ "expo": "*" } }, + "node_modules/expo-media-library": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/expo-media-library/-/expo-media-library-15.4.1.tgz", + "integrity": "sha512-lpWcT4pynWcE7TyNMUkLFH4YcueCTnq7UOJYRR0vewPEJeQXwRscka7zBtrhA+RSsJda013Q0615K+5lRLt14Q==", + "peerDependencies": { + "expo": "*" + } + }, "node_modules/expo-modules-autolinking": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/expo-modules-autolinking/-/expo-modules-autolinking-1.5.1.tgz", diff --git a/WastedApp/package.json b/WastedApp/package.json index c37bd76..f137bcb 100644 --- a/WastedApp/package.json +++ b/WastedApp/package.json @@ -13,6 +13,8 @@ "@react-navigation/native": "^6.1.8", "@react-navigation/native-stack": "^6.9.14", "expo": "~49.0.13", + "expo-camera": "~13.4.4", + "expo-media-library": "~15.4.1", "expo-status-bar": "~1.6.0", "firebase": "^10.4.0", "react": "18.2.0", diff --git a/WastedApp/src/screens/Camera.js b/WastedApp/src/screens/Camera.js new file mode 100644 index 0000000..fdb630a --- /dev/null +++ b/WastedApp/src/screens/Camera.js @@ -0,0 +1,69 @@ +import { Camera, CameraType } from 'expo-camera'; +import { useState } from 'react'; +import { Button, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; + +export default function App() { + const [type, setType] = useState(CameraType.back); + const [permission, requestPermission] = Camera.useCameraPermissions(); + + if (!permission) { + // Camera permissions are still loading + return ; + } + + if (!permission.granted) { + // Camera permissions are not granted yet + return ( + + We need your permission to show the camera +