From 55fd62eda8ab173c2df3c3371c4ce05a26c0a202 Mon Sep 17 00:00:00 2001
From: davideee222 <332916001+davideee222@users.noreply.github.com>
Date: Thu, 19 Nov 2026 11:15:34 +0100
Subject: [PATCH 1/4] feat(app): add full screen camera with gallery and file
picker
---
mobile/package-lock.json | 108 +++++++++++++++++
mobile/package.json | 3 +
mobile/src/app/_layout.tsx | 4 +-
mobile/src/app/scan.tsx | 234 +++++++++++++++++++++++++++++++++++--
4 files changed, 335 insertions(+), 14 deletions(-)
diff --git a/mobile/package-lock.json b/mobile/package-lock.json
index 8af3b6f..fb79587 100644
--- a/mobile/package-lock.json
+++ b/mobile/package-lock.json
@@ -11,11 +11,14 @@
"@expo/ui": "~58.0.27",
"@expo/vector-icons": "^15.0.2",
"expo": "~58.0.23",
+ "expo-camera": "~58.0.14",
"expo-constants": "~58.0.15",
"expo-device": "~58.0.5",
+ "expo-document-picker": "~58.0.5",
"expo-font": "~58.0.11",
"expo-glass-effect": "~58.0.5",
"expo-image": "~58.0.18",
+ "expo-image-picker": "~58.0.10",
"expo-linking": "~58.0.16",
"expo-router": "~58.0.30",
"expo-splash-screen": "~58.0.13",
@@ -2902,6 +2905,12 @@
"integrity": "sha512-hhyNJ+nbR6ZR7pToHvllEFun9TL0sbL+tk/ON75lo+Xas054uez98qRbsuNt7MBCyZKK4+8Yli/OAGZhmfBZ/g==",
"license": "MIT"
},
+ "node_modules/@types/emscripten": {
+ "version": "1.41.6",
+ "resolved": "https://registry.npmjs.org/@types/emscripten/-/emscripten-1.41.6.tgz",
+ "integrity": "sha512-uN+9i8bFT5CUcZfyIEYDrSueACEyKGbUs5kC/72DGlZZoinh84sJfVV0i8UOJD1asdzkvLPBRrKs41kZ8MdEXg==",
+ "license": "MIT"
+ },
"node_modules/@types/estree": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.10.tgz",
@@ -4083,6 +4092,15 @@
"node": "18 || 20 || >=22"
}
},
+ "node_modules/barcode-detector": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/barcode-detector/-/barcode-detector-3.2.4.tgz",
+ "integrity": "sha512-4tjallFXSratRbkzyccnfgL8w/3FtTexjWpQoPes3niFQ2DybGeaktH8w5ukc6wVUrOL7yNsoUUqmaRVn1YtJg==",
+ "license": "MIT",
+ "dependencies": {
+ "zxing-wasm": "3.1.7"
+ }
+ },
"node_modules/base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
@@ -5743,6 +5761,26 @@
"react-native": "*"
}
},
+ "node_modules/expo-camera": {
+ "version": "58.0.14",
+ "resolved": "https://registry.npmjs.org/expo-camera/-/expo-camera-58.0.14.tgz",
+ "integrity": "sha512-yEiMuJ2d7A+EqsP8rlGIvgaUzdk/rW9CXR6R7WKqludxU3H+JcSUbPC3ldr3ZpmaYlgXP3x+oOO9BfQy7yKK2A==",
+ "license": "MIT",
+ "dependencies": {
+ "barcode-detector": "^3.0.0"
+ },
+ "peerDependencies": {
+ "expo": "*",
+ "react": "*",
+ "react-native": "*",
+ "react-native-web": "*"
+ },
+ "peerDependenciesMeta": {
+ "react-native-web": {
+ "optional": true
+ }
+ }
+ },
"node_modules/expo-constants": {
"version": "58.0.15",
"resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-58.0.15.tgz",
@@ -5769,6 +5807,15 @@
"expo": "*"
}
},
+ "node_modules/expo-document-picker": {
+ "version": "58.0.5",
+ "resolved": "https://registry.npmjs.org/expo-document-picker/-/expo-document-picker-58.0.5.tgz",
+ "integrity": "sha512-DHv8GhjDwu2BbDWhV2j52iaqwWsA9P7n5nAwreiKRGQSxv0wpF/C0Cqpqj1B72io8E2KXddwxxKPWVPlV/kgtA==",
+ "license": "MIT",
+ "peerDependencies": {
+ "expo": "*"
+ }
+ },
"node_modules/expo-file-system": {
"version": "58.0.13",
"resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-58.0.13.tgz",
@@ -5821,6 +5868,27 @@
}
}
},
+ "node_modules/expo-image-loader": {
+ "version": "58.0.3",
+ "resolved": "https://registry.npmjs.org/expo-image-loader/-/expo-image-loader-58.0.3.tgz",
+ "integrity": "sha512-zlHudxC8OObyqCHmvdxJqURI7886KJ0cUJyn7R/a8FOD9fP837xKDN+u4SIt7XsSSVPNXzMd4Y7mN0pmup8NGA==",
+ "license": "MIT",
+ "peerDependencies": {
+ "expo": "*"
+ }
+ },
+ "node_modules/expo-image-picker": {
+ "version": "58.0.10",
+ "resolved": "https://registry.npmjs.org/expo-image-picker/-/expo-image-picker-58.0.10.tgz",
+ "integrity": "sha512-yqQC9UYMWSUxk6U0jaS1vE1w+b9Ru0FJmQ3KjUf9Q9oVg5xBxmg8+Ts+usazMAuPoskNIXJ++VZ+uK6br9yUGQ==",
+ "license": "MIT",
+ "dependencies": {
+ "expo-image-loader": "~58.0.3"
+ },
+ "peerDependencies": {
+ "expo": "*"
+ }
+ },
"node_modules/expo-keep-awake": {
"version": "58.0.3",
"resolved": "https://registry.npmjs.org/expo-keep-awake/-/expo-keep-awake-58.0.3.tgz",
@@ -11004,6 +11072,18 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/tagged-tag": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/tagged-tag/-/tagged-tag-1.0.0.tgz",
+ "integrity": "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/terminal-link": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz",
@@ -11799,6 +11879,34 @@
"peerDependencies": {
"zod": "^3.25.0 || ^4.0.0"
}
+ },
+ "node_modules/zxing-wasm": {
+ "version": "3.1.7",
+ "resolved": "https://registry.npmjs.org/zxing-wasm/-/zxing-wasm-3.1.7.tgz",
+ "integrity": "sha512-LI94ndlOY+xoqlkNcc0EwByrMpUXKrCX171EQ38kGWqpiRq/gcnC+ZrbRipvxI3uV4LaDtNlKo1p9Uayg1sesQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/emscripten": "^1.41.6",
+ "type-fest": "^5.10.0"
+ },
+ "peerDependencies": {
+ "@types/emscripten": ">=1.39.6"
+ }
+ },
+ "node_modules/zxing-wasm/node_modules/type-fest": {
+ "version": "5.10.0",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.10.0.tgz",
+ "integrity": "sha512-NoSdpq/WEiAg5sjmBkmV/hfxv6HJH4NqPNrqjtSO5CwRmpsDfaf4begxW34KdJykH/l1yHtwBWQkCRdoXO8mPA==",
+ "license": "(MIT OR CC0-1.0)",
+ "dependencies": {
+ "tagged-tag": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
}
}
}
diff --git a/mobile/package.json b/mobile/package.json
index 647065a..32ec8ba 100644
--- a/mobile/package.json
+++ b/mobile/package.json
@@ -6,11 +6,14 @@
"@expo/ui": "~58.0.27",
"@expo/vector-icons": "^15.0.2",
"expo": "~58.0.23",
+ "expo-camera": "~58.0.14",
"expo-constants": "~58.0.15",
"expo-device": "~58.0.5",
+ "expo-document-picker": "~58.0.5",
"expo-font": "~58.0.11",
"expo-glass-effect": "~58.0.5",
"expo-image": "~58.0.18",
+ "expo-image-picker": "~58.0.10",
"expo-linking": "~58.0.16",
"expo-router": "~58.0.30",
"expo-splash-screen": "~58.0.13",
diff --git a/mobile/src/app/_layout.tsx b/mobile/src/app/_layout.tsx
index f664743..0aee25d 100644
--- a/mobile/src/app/_layout.tsx
+++ b/mobile/src/app/_layout.tsx
@@ -4,7 +4,7 @@ export default function RootLayout() {
return (
-
+
);
-}
+}
\ No newline at end of file
diff --git a/mobile/src/app/scan.tsx b/mobile/src/app/scan.tsx
index 2870c5d..f3d72cd 100644
--- a/mobile/src/app/scan.tsx
+++ b/mobile/src/app/scan.tsx
@@ -1,20 +1,161 @@
-import PlaceholderScreen from '@/components/PlaceholderScreen';
+import { Ionicons } from '@expo/vector-icons';
+import { CameraView, useCameraPermissions } from 'expo-camera';
+import * as DocumentPicker from 'expo-document-picker';
+import * as ImagePicker from 'expo-image-picker';
import { useRouter } from 'expo-router';
-import { Pressable, View, StyleSheet, Text } from 'react-native';
+import { useRef, useState } from 'react';
+import { ActivityIndicator, Alert, Button, Image, Pressable, StyleSheet, Text, View } from 'react-native';
+import { useSafeAreaInsets } from 'react-native-safe-area-context';
+
+const FLASH_ICON = { off: 'flash-off', auto: 'flash-outline', on: 'flash' } as const;
+const NEXT_FLASH = { off: 'auto', auto: 'on', on: 'off' } as const;
export default function ScanScreen() {
const router = useRouter();
+ const [image, setImage] = useState(null);
+ const [permission, requestPermission] = useCameraPermissions();
+ const cameraRef = useRef(null);
+ const insets = useSafeAreaInsets();
+ const [flash, setFlash] = useState<'off' | 'auto' | 'on'>('off');
+ const [pdfName, setPdfName] = useState(null);
+ const [cameraReady, setCameraReady] = useState(false);
+ const [isTaking, setIsTaking] = useState(false);
+
+ const pickImage = async () => {
+ const permission = await ImagePicker.requestMediaLibraryPermissionsAsync();
+
+ if (!permission.granted) {
+ Alert.alert('Kein Zugriff', 'Bitte erlaube den Zugriff auf deine Fotos.');
+ return;
+ }
+
+ const result = await ImagePicker.launchImageLibraryAsync({
+ mediaTypes: ['images'],
+ quality: 0.7,
+ });
+
+ if (!result.canceled) {
+ setImage(result.assets[0].uri);
+ }
+ };
+
+ const takePhoto = async () => {
+ if (!cameraReady || isTaking) {
+ return;
+ }
+
+ setIsTaking(true);
+ try {
+ const photo = await cameraRef.current?.takePictureAsync({ quality: 0.7 });
+ if (photo) {
+ setImage(photo.uri);
+ }
+ } catch (error) {
+ console.warn('takePictureAsync failed', error);
+ Alert.alert('Fehler', 'Das Foto konnte nicht aufgenommen werden. Bitte versuch es nochmal.');
+ } finally {
+ setIsTaking(false);
+ }
+ };
+
+ const pickDocument = async () => {
+ const result = await DocumentPicker.getDocumentAsync({
+ type: ['application/pdf', 'image/*'],
+ copyToCacheDirectory: true,
+ });
+
+ if (!result.canceled) {
+ const file = result.assets[0];
+ setImage(file.uri);
+ setPdfName(file.mimeType === 'application/pdf' ? file.name : null);
+ }
+ };
+
+ const retake = () => {
+ setImage(null);
+ setPdfName(null);
+ setCameraReady(false);
+ };
+
+ if (!permission) {
+ return ;
+ }
+
+ if (!permission.granted) {
+ return (
+
+ Quitt braucht Zugriff auf die Kamera.
+
+
+ );
+ }
+
+ if (image) {
+ return (
+
+ {pdfName ? (
+
+
+ {pdfName}
+
+ ) : (
+
+ )}
+
+
+
+ Nochmal
+
+ router.back()}>
+ Verwenden
+
+
+
+ );
+ }
return (
-
- router.back()}
- accessibilityRole="button"
- >
- Schließen
-
+ setCameraReady(true)}
+ />
+
+
+
+
+
+
+
+ {isTaking && }
+
+
+
+
+
+
+
+
+ router.back()} accessibilityLabel="Schließen">
+
+
+
+ setFlash(NEXT_FLASH[flash])}
+ accessibilityLabel="Blitz umschalten"
+ >
+
+
+
);
}
@@ -22,9 +163,78 @@ export default function ScanScreen() {
const styles = StyleSheet.create({
container: {
flex: 1,
+ backgroundColor: '#000000',
+ },
+ closeText: {
+ color: '#FFFFFF',
+ },
+ bottomBar: {
+ position: 'absolute',
+ bottom: 0,
+ left: 0,
+ right: 0,
+ flexDirection: 'row',
+ justifyContent: 'space-around',
+ alignItems: 'center',
+ paddingTop: 20,
+ backgroundColor: 'rgba(0,0,0,0.4)',
+ },
+ sideButton: {
+ width: 52,
+ height: 52,
+ alignItems: 'center',
+ justifyContent: 'center',
+ },
+ shutter: {
+ width: 72,
+ height: 72,
+ borderRadius: 36,
+ borderWidth: 4,
+ borderColor: '#FFFFFF',
+ backgroundColor: 'rgba(255,255,255,0.3)',
+ alignItems: 'center',
+ justifyContent: 'center',
+ },
+ shutterLoading: {
+ opacity: 0.4,
+ },
+ topBar: {
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ right: 0,
+ flexDirection: 'row',
+ justifyContent: 'space-between',
+ alignItems: 'center',
+ paddingHorizontal: 12,
+ paddingBottom: 12,
+ backgroundColor: 'rgba(0,0,0,0.4)',
+ },
+ preview: {
+ flex: 1,
},
- closeButton: {
- padding: 16,
+ pdfPreview: {
+ flex: 1,
alignItems: 'center',
+ justifyContent: 'center',
+ gap: 12,
+ },
+ actionButton: {
+ paddingVertical: 12,
+ paddingHorizontal: 28,
+ borderRadius: 24,
+ borderWidth: 1,
+ borderColor: '#FFFFFF',
+ },
+ primaryButton: {
+ backgroundColor: '#FFFFFF',
+ },
+ actionText: {
+ color: '#FFFFFF',
+ fontSize: 16,
+ fontWeight: '600',
+ },
+ primaryText: {
+ color: '#000000',
},
});
From 0494850c7501df6da656f1f6213276dda0fa7ef8 Mon Sep 17 00:00:00 2001
From: davideee222 <332916001+davideee222@users.noreply.github.com>
Date: Fri, 20 Nov 2026 10:38:31 +0100
Subject: [PATCH 2/4] fix(app): keep scan screen behind onboarding guard
---
mobile/src/app/_layout.tsx | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/mobile/src/app/_layout.tsx b/mobile/src/app/_layout.tsx
index 8c1c5d4..1aecc84 100644
--- a/mobile/src/app/_layout.tsx
+++ b/mobile/src/app/_layout.tsx
@@ -10,11 +10,9 @@ function RootNavigator() {
return (
-
-
-
+
@@ -29,4 +27,4 @@ export default function RootLayout() {
);
-}
+}
\ No newline at end of file
From cbf1b890e3195539546124ebb2ea93ba115852d3 Mon Sep 17 00:00:00 2001
From: davideee222 <332916001+davideee222@users.noreply.github.com>
Date: Wed, 25 Nov 2026 09:47:37 +0100
Subject: [PATCH 3/4] fix(app): address review feedback on camera screen
---
mobile/app.json | 12 +++++
mobile/src/app/_layout.tsx | 2 +-
mobile/src/app/scan.tsx | 92 +++++++++++++++++++++++++++++---------
3 files changed, 84 insertions(+), 22 deletions(-)
diff --git a/mobile/app.json b/mobile/app.json
index 9b9cf98..a4c342f 100644
--- a/mobile/app.json
+++ b/mobile/app.json
@@ -33,6 +33,18 @@
"imageWidth": 76
}
],
+ [
+ "expo-camera",
+ {
+ "cameraPermission": "Quitt braucht Zugriff auf die Kamera, um Belege zu fotografieren."
+ }
+ ],
+ [
+ "expo-image-picker",
+ {
+ "photosPermission": "Quitt braucht Zugriff auf deine Fotos, um Belege auszuwählen."
+ }
+ ],
"expo-secure-store",
"expo-status-bar",
"expo-web-browser"
diff --git a/mobile/src/app/_layout.tsx b/mobile/src/app/_layout.tsx
index ac193f6..014a875 100644
--- a/mobile/src/app/_layout.tsx
+++ b/mobile/src/app/_layout.tsx
@@ -39,4 +39,4 @@ export default function RootLayout() {
);
-}
\ No newline at end of file
+}
diff --git a/mobile/src/app/scan.tsx b/mobile/src/app/scan.tsx
index f3d72cd..5e7e80f 100644
--- a/mobile/src/app/scan.tsx
+++ b/mobile/src/app/scan.tsx
@@ -4,7 +4,16 @@ import * as DocumentPicker from 'expo-document-picker';
import * as ImagePicker from 'expo-image-picker';
import { useRouter } from 'expo-router';
import { useRef, useState } from 'react';
-import { ActivityIndicator, Alert, Button, Image, Pressable, StyleSheet, Text, View } from 'react-native';
+import {
+ ActivityIndicator,
+ Alert,
+ Image,
+ Linking,
+ Pressable,
+ StyleSheet,
+ Text,
+ View,
+} from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
const FLASH_ICON = { off: 'flash-off', auto: 'flash-outline', on: 'flash' } as const;
@@ -77,19 +86,18 @@ export default function ScanScreen() {
setCameraReady(false);
};
+ const handlePermission = () => {
+ if (permission?.canAskAgain) {
+ requestPermission();
+ } else {
+ Linking.openSettings();
+ }
+ };
+
if (!permission) {
return ;
}
- if (!permission.granted) {
- return (
-
- Quitt braucht Zugriff auf die Kamera.
-
-
- );
- }
-
if (image) {
return (
@@ -106,7 +114,10 @@ export default function ScanScreen() {
Nochmal
- router.back()}>
+ router.back()}
+ >
Verwenden
@@ -116,16 +127,34 @@ export default function ScanScreen() {
return (
- setCameraReady(true)}
- />
+ {permission.granted ? (
+ setCameraReady(true)}
+ />
+ ) : (
+
+
+
+ Quitt braucht Zugriff auf die Kamera, um Belege zu fotografieren.
+
+
+
+ {permission.canAskAgain ? 'Zugriff erlauben' : 'Einstellungen öffnen'}
+
+
+
+ )}
-
+
@@ -138,19 +167,28 @@ export default function ScanScreen() {
{isTaking && }
-
+
- router.back()} accessibilityLabel="Schließen">
+ router.back()}
+ accessibilityLabel="Schließen"
+ >
setFlash(NEXT_FLASH[flash])}
+ disabled={!permission.granted}
accessibilityLabel="Blitz umschalten"
>
@@ -168,6 +206,18 @@ const styles = StyleSheet.create({
closeText: {
color: '#FFFFFF',
},
+ permissionBox: {
+ flex: 1,
+ alignItems: 'center',
+ justifyContent: 'center',
+ gap: 16,
+ padding: 32,
+ },
+ permissionText: {
+ color: '#FFFFFF',
+ fontSize: 16,
+ textAlign: 'center',
+ },
bottomBar: {
position: 'absolute',
bottom: 0,
From c4f6bd82542c793fabc7f7184190f3e32fdf8607 Mon Sep 17 00:00:00 2001
From: davideee222 <332916001+davideee222@users.noreply.github.com>
Date: Wed, 25 Nov 2026 15:19:19 +0100
Subject: [PATCH 4/4] fix(app): recheck camera permission and drop microphone
permission
---
mobile/app.json | 7 +++++--
mobile/src/app/scan.tsx | 15 +++++++++++++--
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/mobile/app.json b/mobile/app.json
index a4c342f..62716bb 100644
--- a/mobile/app.json
+++ b/mobile/app.json
@@ -36,7 +36,9 @@
[
"expo-camera",
{
- "cameraPermission": "Quitt braucht Zugriff auf die Kamera, um Belege zu fotografieren."
+ "cameraPermission": "Quitt braucht Zugriff auf die Kamera, um Belege zu fotografieren.",
+ "microphonePermission": false,
+ "recordAudioAndroid": false
}
],
[
@@ -47,7 +49,8 @@
],
"expo-secure-store",
"expo-status-bar",
- "expo-web-browser"
+ "expo-web-browser",
+ "@react-native-community/datetimepicker"
],
"experiments": {
"typedRoutes": true,
diff --git a/mobile/src/app/scan.tsx b/mobile/src/app/scan.tsx
index 5e7e80f..53b88d1 100644
--- a/mobile/src/app/scan.tsx
+++ b/mobile/src/app/scan.tsx
@@ -3,10 +3,11 @@ import { CameraView, useCameraPermissions } from 'expo-camera';
import * as DocumentPicker from 'expo-document-picker';
import * as ImagePicker from 'expo-image-picker';
import { useRouter } from 'expo-router';
-import { useRef, useState } from 'react';
+import { useEffect, useRef, useState } from 'react';
import {
ActivityIndicator,
Alert,
+ AppState,
Image,
Linking,
Pressable,
@@ -22,7 +23,7 @@ const NEXT_FLASH = { off: 'auto', auto: 'on', on: 'off' } as const;
export default function ScanScreen() {
const router = useRouter();
const [image, setImage] = useState(null);
- const [permission, requestPermission] = useCameraPermissions();
+ const [permission, requestPermission, getPermission] = useCameraPermissions();
const cameraRef = useRef(null);
const insets = useSafeAreaInsets();
const [flash, setFlash] = useState<'off' | 'auto' | 'on'>('off');
@@ -30,6 +31,16 @@ export default function ScanScreen() {
const [cameraReady, setCameraReady] = useState(false);
const [isTaking, setIsTaking] = useState(false);
+ // Re-check the camera permission when the user comes back from the settings.
+ useEffect(() => {
+ const subscription = AppState.addEventListener('change', (state) => {
+ if (state === 'active') {
+ getPermission();
+ }
+ });
+ return () => subscription.remove();
+ }, [getPermission]);
+
const pickImage = async () => {
const permission = await ImagePicker.requestMediaLibraryPermissionsAsync();