fix: camera unmount, sticker trash, update reset
This commit is contained in:
@@ -29,7 +29,7 @@ import {
|
||||
import { THEME } from '../styles/theme';
|
||||
import { logger } from '../services/logger';
|
||||
import KioskMode from '../../modules/kiosk-mode';
|
||||
import { AppSettings, loadSettings, saveSettings, APP_VERSION } from '../services/settings';
|
||||
import { AppSettings, loadSettings, saveSettings } from '../services/settings';
|
||||
import { FRAMES } from '../data/frames';
|
||||
|
||||
interface AdminScreenProps {
|
||||
@@ -229,7 +229,7 @@ export default function AdminScreen({ currentSettings, onSave, onClose }: AdminS
|
||||
}
|
||||
|
||||
const updated: AppSettings = {
|
||||
appVersion: APP_VERSION,
|
||||
appLastUpdate: currentSettings.appLastUpdate,
|
||||
countdownDuration: duration,
|
||||
printerIp: ipTrimmed,
|
||||
adminPassword: password.trim(),
|
||||
|
||||
@@ -56,6 +56,7 @@ interface CameraScreenProps {
|
||||
selectedFrameId: string | null;
|
||||
footerText: string;
|
||||
useFrontCamera: boolean;
|
||||
isObscured: boolean;
|
||||
}
|
||||
|
||||
export default function CameraScreen({
|
||||
@@ -74,6 +75,7 @@ export default function CameraScreen({
|
||||
selectedFrameId,
|
||||
footerText,
|
||||
useFrontCamera,
|
||||
isObscured,
|
||||
}: CameraScreenProps) {
|
||||
const [permission, requestPermission] = useCameraPermissions();
|
||||
const [isUsbConnected, setIsUsbConnected] = useState<boolean>(false);
|
||||
@@ -653,10 +655,10 @@ export default function CameraScreen({
|
||||
{/* Camera Preview Background */}
|
||||
<View style={styles.previewContainer}>
|
||||
<View style={styles.cameraWrapper}>
|
||||
{Platform.OS === 'android' && !useFrontCamera ? (
|
||||
{!isObscured && isUsbConnected && !useFrontCamera ? (
|
||||
<UsbCameraView
|
||||
ref={usbCameraRef}
|
||||
style={[styles.cameraPreview, { position: 'absolute', opacity: 1, zIndex: 10 }]}
|
||||
style={StyleSheet.absoluteFill}
|
||||
/>
|
||||
) : (
|
||||
<CameraView
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
faRightFromBracket,
|
||||
faFaceGrinStars,
|
||||
faBorderAll,
|
||||
faTrash,
|
||||
} from '@fortawesome/free-solid-svg-icons';
|
||||
import { THEME } from '../styles/theme';
|
||||
import { printImageLocal } from '../services/printer';
|
||||
@@ -432,7 +433,7 @@ export default function PreviewScreen({
|
||||
))}
|
||||
</View>
|
||||
<View style={styles.collageFooter}>
|
||||
<Text style={styles.collageFooterText}>SCHNAPPIX FOTOBOX</Text>
|
||||
<Text style={styles.collageFooterText}>{eventText}</Text>
|
||||
<Text style={styles.collageFooterDate}>{new Date().toLocaleDateString('de-DE')}</Text>
|
||||
</View>
|
||||
</View>
|
||||
@@ -454,7 +455,7 @@ export default function PreviewScreen({
|
||||
))}
|
||||
</View>
|
||||
<View style={styles.collageFooter}>
|
||||
<Text style={styles.collageFooterText}>SCHNAPPIX FOTOBOX</Text>
|
||||
<Text style={styles.collageFooterText}>{eventText}</Text>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
@@ -475,7 +476,7 @@ export default function PreviewScreen({
|
||||
))}
|
||||
</View>
|
||||
<View style={styles.collageFooter}>
|
||||
<Text style={styles.collageFooterText}>SCHNAPPIX FOTOBOX</Text>
|
||||
<Text style={styles.collageFooterText}>{eventText}</Text>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
@@ -554,9 +555,20 @@ export default function PreviewScreen({
|
||||
)}
|
||||
</TouchableOpacity>
|
||||
|
||||
{/* Global Trash Can for Stickers */}
|
||||
{selectedStickerId !== null && (
|
||||
<TouchableOpacity
|
||||
style={styles.globalTrashButton}
|
||||
onPress={() => handleStickerDelete(selectedStickerId)}
|
||||
activeOpacity={0.7}
|
||||
>
|
||||
<FontAwesomeIcon icon={faTrash} color="#fff" size={32} />
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
|
||||
{/* Right panel: Controls */}
|
||||
<View style={styles.controlPanel}>
|
||||
<Text style={styles.header}>DEIN FOTO</Text>
|
||||
<Text style={styles.header}>{eventText}</Text>
|
||||
|
||||
{/* Thumbnail Reel for Photo Selection */}
|
||||
{photoUris.length > 1 && (
|
||||
@@ -568,6 +580,7 @@ export default function PreviewScreen({
|
||||
<ScrollView horizontal showsHorizontalScrollIndicator={false} contentContainerStyle={styles.thumbnailReelContent}>
|
||||
{photoUris.map((uri, idx) => {
|
||||
const isActive = activeUris.includes(uri);
|
||||
const indexInSelection = activeUris.indexOf(uri) + 1;
|
||||
return (
|
||||
<TouchableOpacity
|
||||
key={idx}
|
||||
@@ -578,7 +591,7 @@ export default function PreviewScreen({
|
||||
<Image source={{ uri }} style={styles.thumbnailImage} />
|
||||
{isActive && (
|
||||
<View style={styles.thumbnailCheck}>
|
||||
<Text style={{ color: '#fff', fontSize: 10, fontWeight: 'bold' }}>✓</Text>
|
||||
<Text style={{ color: '#fff', fontSize: 14, fontWeight: 'bold' }}>{indexInSelection}</Text>
|
||||
</View>
|
||||
)}
|
||||
</TouchableOpacity>
|
||||
@@ -739,6 +752,23 @@ const styles = StyleSheet.create({
|
||||
textShadowOffset: { width: 0, height: 0 },
|
||||
textShadowRadius: 12,
|
||||
},
|
||||
globalTrashButton: {
|
||||
position: 'absolute',
|
||||
top: 40,
|
||||
alignSelf: 'center',
|
||||
width: 60,
|
||||
height: 60,
|
||||
borderRadius: 30,
|
||||
backgroundColor: THEME.colors.error,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
zIndex: 9999,
|
||||
shadowColor: '#000',
|
||||
shadowOffset: { width: 0, height: 4 },
|
||||
shadowOpacity: 0.5,
|
||||
shadowRadius: 6,
|
||||
elevation: 8,
|
||||
},
|
||||
thumbnailInstruction: {
|
||||
color: THEME.colors.textMuted,
|
||||
fontSize: 12,
|
||||
|
||||
Reference in New Issue
Block a user