fix: move CameraScreen off-screen when not active so TextureView doesn't cover UI
This commit is contained in:
@@ -147,7 +147,13 @@ export default function App() {
|
||||
Keep CameraScreen ALWAYS mounted in the background to prevent
|
||||
Android expo-camera hardware crashes when unmounting right after capture
|
||||
*/}
|
||||
<View style={StyleSheet.absoluteFill}>
|
||||
<View
|
||||
style={[
|
||||
StyleSheet.absoluteFill,
|
||||
currentScreen !== 'camera' && { opacity: 0, zIndex: -10, transform: [{ translateX: -10000 }] }
|
||||
]}
|
||||
pointerEvents={currentScreen === 'camera' ? 'auto' : 'none'}
|
||||
>
|
||||
<CameraScreen
|
||||
countdownDuration={settings.countdownDuration}
|
||||
onPhotoCaptured={handlePhotoCaptured}
|
||||
@@ -169,7 +175,7 @@ export default function App() {
|
||||
|
||||
{/* Overlay PreviewScreen if active */}
|
||||
{currentScreen === 'preview' && (
|
||||
<View style={StyleSheet.absoluteFill}>
|
||||
<View style={[StyleSheet.absoluteFill, { zIndex: 100, elevation: 100, backgroundColor: '#000' }]}>
|
||||
<PreviewScreen
|
||||
photoUris={photoUris}
|
||||
printerIp={settings.printerIp}
|
||||
@@ -188,7 +194,7 @@ export default function App() {
|
||||
|
||||
{/* Overlay AdminScreen if active */}
|
||||
{currentScreen === 'admin' && (
|
||||
<View style={StyleSheet.absoluteFill}>
|
||||
<View style={[StyleSheet.absoluteFill, { zIndex: 100, elevation: 100, backgroundColor: '#000' }]}>
|
||||
<AdminScreen
|
||||
currentSettings={settings}
|
||||
onSave={handleSaveSettings}
|
||||
|
||||
Reference in New Issue
Block a user