update: local changes
This commit is contained in:
@@ -400,26 +400,29 @@ export default function CameraScreen({
|
||||
}
|
||||
};
|
||||
|
||||
if (!permission) {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.infoText}>Berechtigungen werden geladen...</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
// On iOS we need the expo-camera permission, on Android we bypass it since we use USB
|
||||
if (Platform.OS !== 'android') {
|
||||
if (!permission) {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.infoText}>Berechtigungen werden geladen...</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
if (!permission.granted && !isUsbConnected) {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.infoText}>Wir benötigen deine Erlaubnis, um die Kamera anzuzeigen</Text>
|
||||
<TouchableOpacity style={styles.btn} onPress={requestPermission}>
|
||||
<Text style={styles.btnText}>Erlaubnis erteilen</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity style={[styles.btn, styles.cancelBtn]} onPress={handleLocalCancel}>
|
||||
<Text style={styles.btnText}>Zurück</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
);
|
||||
if (!permission.granted && !isUsbConnected) {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.infoText}>Wir benötigen deine Erlaubnis, um die Kamera anzuzeigen</Text>
|
||||
<TouchableOpacity style={styles.btn} onPress={requestPermission}>
|
||||
<Text style={styles.btnText}>Erlaubnis erteilen</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity style={[styles.btn, styles.cancelBtn]} onPress={handleLocalCancel}>
|
||||
<Text style={styles.btnText}>Zurück</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const renderContent = () => {
|
||||
@@ -625,20 +628,20 @@ export default function CameraScreen({
|
||||
{/* Camera Preview Background */}
|
||||
<View style={styles.previewContainer}>
|
||||
<View style={styles.cameraWrapper}>
|
||||
{Platform.OS === 'android' && (
|
||||
{Platform.OS === 'android' ? (
|
||||
<UsbCameraView
|
||||
ref={usbCameraRef}
|
||||
style={[styles.cameraPreview, { position: 'absolute', opacity: isUsbConnected ? 1 : 0, zIndex: isUsbConnected ? 10 : 1 }]}
|
||||
style={[styles.cameraPreview, { position: 'absolute', opacity: 1, zIndex: 10 }]}
|
||||
/>
|
||||
) : (
|
||||
<CameraView
|
||||
ref={expoCameraRef}
|
||||
style={[styles.cameraPreview, { position: 'absolute', opacity: 1, zIndex: 10 }]}
|
||||
facing="front"
|
||||
pictureSize={pictureSize === 'fallback' ? undefined : pictureSize}
|
||||
onCameraReady={handleCameraReady}
|
||||
/>
|
||||
)}
|
||||
|
||||
<CameraView
|
||||
ref={expoCameraRef}
|
||||
style={[styles.cameraPreview, { position: 'absolute', opacity: isUsbConnected ? 0 : 1, zIndex: isUsbConnected ? 1 : 10 }]}
|
||||
facing="front"
|
||||
pictureSize={pictureSize === 'fallback' ? undefined : pictureSize}
|
||||
onCameraReady={handleCameraReady}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user