diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 0c1713dc..c3638be2 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -1175,7 +1175,13 @@ "alert_reset_success": "All notifications have been reset", "alert_sync_complete": "Sync Complete", "alert_sync_msg": "Successfully synced notifications for your library and Trakt items.\n\nScheduled: {{upcoming}} upcoming episodes\nThis week: {{thisWeek}} episodes", - "alert_test_scheduled": "Test notification scheduled to fire instantly" + "alert_test_scheduled": "Test notification scheduled to fire instantly", + "failed_sync_notifications": "Failed to sync notifications. Please try again.", + "failed_reset_notifications": "Failed to reset notifications.", + "failed_update_notification_settings": "Failed to update notification settings", + "failed_test": "Failed to schedule test notification", + "failed_test_enable_notifications": "Failed to schedule test notification. Make sure notifications are enabled.", + "loading_settings": "Loading settings..." }, "backup": { "title": "Backup & Restore", @@ -1539,9 +1545,9 @@ "profanity": "Profanity", "alcohol": "Alcohol/Drugs", "frightening": "Frightening", - "severe":"severe", - "moderate":"moderate", - "mild":"mild", - "none":"none" + "severe": "severe", + "moderate": "moderate", + "mild": "mild", + "none": "none" } } diff --git a/src/i18n/locales/it.json b/src/i18n/locales/it.json index 6c206d59..9b26be6d 100644 --- a/src/i18n/locales/it.json +++ b/src/i18n/locales/it.json @@ -1175,7 +1175,13 @@ "alert_reset_success": "Tutte le notifiche sono state ripristinate", "alert_sync_complete": "Sincronizzazione Completata", "alert_sync_msg": "Sincronizzazione notifiche completata con successo per la libreria e gli elementi Trakt.\n\nProgrammati: {{upcoming}} episodi in arrivo\nQuesta settimana: {{thisWeek}} episodi", - "alert_test_scheduled": "Notifica di test programmata per l'invio immediato" + "alert_test_scheduled": "Notifica di test programmata per l'invio immediato", + "failed_sync_notifications": "Errore nella sincronizzazione delle notifiche. Riprova.", + "failed_reset_notifications": "Errore nel reset delle notifiche. Riprova.", + "failed_update_notification_settings": "Errore nell'aggiornamento delle impostazioni delle notifiche. Riprova", + "failed_test_enable_notifications": "Errore nella programmazione della notifica di test. Assicurati di aver garantito i permessi alle notifice per l'app.", + "failed_test": "Errore nella programmazione della notifica di test.", + "loading_settings": "Caricamento Impostazioni..." }, "backup": { "title": "Backup e Ripristino", @@ -1543,5 +1549,11 @@ "moderate": "moderata", "mild": "lieve", "none": "nessuno" + }, + "skip_intro_button": { + "skip": "Salta", + "skip_intro": "Salta Inizio", + "skip_ending": "Salta Fine", + "skip_recap": "Salta Riassunto" } } diff --git a/src/screens/NotificationSettingsScreen.tsx b/src/screens/NotificationSettingsScreen.tsx index ca00b930..5bd7b88f 100644 --- a/src/screens/NotificationSettingsScreen.tsx +++ b/src/screens/NotificationSettingsScreen.tsx @@ -1,19 +1,22 @@ import React, { useState, useEffect } from 'react'; import { - View, - Text, - StyleSheet, - ScrollView, - Switch, - TouchableOpacity, - SafeAreaView, - StatusBar, - Platform, + View, + Text, + StyleSheet, + ScrollView, + Switch, + TouchableOpacity, + SafeAreaView, + StatusBar, + Platform, } from 'react-native'; import CustomAlert from '../components/CustomAlert'; import { MaterialIcons } from '@expo/vector-icons'; import { useTheme } from '../contexts/ThemeContext'; -import { notificationService, NotificationSettings } from '../services/notificationService'; +import { + notificationService, + NotificationSettings, +} from '../services/notificationService'; import Animated, { FadeIn, FadeOut } from 'react-native-reanimated'; import { useNavigation } from '@react-navigation/native'; import { logger } from '../utils/logger'; @@ -22,636 +25,891 @@ import { useTranslation } from 'react-i18next'; const ANDROID_STATUSBAR_HEIGHT = StatusBar.currentHeight || 0; const NotificationSettingsScreen = () => { - const { t } = useTranslation(); - const navigation = useNavigation(); - const { currentTheme } = useTheme(); - const [settings, setSettings] = useState({ - enabled: true, - newEpisodeNotifications: true, - reminderNotifications: true, - upcomingShowsNotifications: true, - timeBeforeAiring: 24, - }); - const [loading, setLoading] = useState(true); - const [countdown, setCountdown] = useState(null); - const [testNotificationId, setTestNotificationId] = useState(null); - const [isSyncing, setIsSyncing] = useState(false); - const [notificationStats, setNotificationStats] = useState({ total: 0, upcoming: 0, thisWeek: 0 }); + const { t } = useTranslation(); + const navigation = useNavigation(); + const { currentTheme } = useTheme(); + const [settings, setSettings] = useState({ + enabled: true, + newEpisodeNotifications: true, + reminderNotifications: true, + upcomingShowsNotifications: true, + timeBeforeAiring: 24, + }); + const [loading, setLoading] = useState(true); + const [countdown, setCountdown] = useState(null); + const [testNotificationId, setTestNotificationId] = useState( + null, + ); + const [isSyncing, setIsSyncing] = useState(false); + const [notificationStats, setNotificationStats] = useState({ + total: 0, + upcoming: 0, + thisWeek: 0, + }); - // Custom alert state - const [alertVisible, setAlertVisible] = useState(false); - const [alertTitle, setAlertTitle] = useState(''); - const [alertMessage, setAlertMessage] = useState(''); - const [alertActions, setAlertActions] = useState([]); - // Load settings and stats on mount - useEffect(() => { - const loadSettings = async () => { - try { - const savedSettings = await notificationService.getSettings(); - setSettings(savedSettings); + // Custom alert state + const [alertVisible, setAlertVisible] = useState(false); + const [alertTitle, setAlertTitle] = useState(''); + const [alertMessage, setAlertMessage] = useState(''); + const [alertActions, setAlertActions] = useState([]); + // Load settings and stats on mount + useEffect(() => { + const loadSettings = async () => { + try { + const savedSettings = await notificationService.getSettings(); + setSettings(savedSettings); - // Load notification stats - const stats = notificationService.getNotificationStats(); - setNotificationStats(stats); - } catch (error) { - logger.error('Error loading notification settings:', error); - } finally { - setLoading(false); - } - }; + // Load notification stats + const stats = notificationService.getNotificationStats(); + setNotificationStats(stats); + } catch (error) { + logger.error('Error loading notification settings:', error); + } finally { + setLoading(false); + } + }; - loadSettings(); - }, []); + loadSettings(); + }, []); - // Refresh stats when settings change - useEffect(() => { - if (!loading) { - const stats = notificationService.getNotificationStats(); - setNotificationStats(stats); - } - }, [settings, loading]); + // Refresh stats when settings change + useEffect(() => { + if (!loading) { + const stats = notificationService.getNotificationStats(); + setNotificationStats(stats); + } + }, [settings, loading]); - // Add countdown effect - useEffect(() => { - let intervalId: NodeJS.Timeout; + // Add countdown effect + useEffect(() => { + let intervalId: NodeJS.Timeout; - if (countdown !== null && countdown > 0) { - intervalId = setInterval(() => { - setCountdown(prev => prev !== null ? prev - 1 : null); - }, 1000); - } else if (countdown === 0) { - setCountdown(null); - setTestNotificationId(null); - } + if (countdown !== null && countdown > 0) { + intervalId = setInterval(() => { + setCountdown((prev) => (prev !== null ? prev - 1 : null)); + }, 1000); + } else if (countdown === 0) { + setCountdown(null); + setTestNotificationId(null); + } - return () => { - if (intervalId) { - clearInterval(intervalId); - } - }; - }, [countdown]); + return () => { + if (intervalId) { + clearInterval(intervalId); + } + }; + }, [countdown]); - // Update a setting - const updateSetting = async (key: keyof NotificationSettings, value: boolean | number) => { - try { - const updatedSettings = { - ...settings, - [key]: value, - }; + // Update a setting + const updateSetting = async ( + key: keyof NotificationSettings, + value: boolean | number, + ) => { + try { + const updatedSettings = { + ...settings, + [key]: value, + }; - // Special case: if enabling notifications, make sure permissions are granted - if (key === 'enabled' && value === true) { - // Permissions are handled in the service - } + // Special case: if enabling notifications, make sure permissions are granted + if (key === 'enabled' && value === true) { + // Permissions are handled in the service + } - // Update settings in the service - await notificationService.updateSettings({ [key]: value }); + // Update settings in the service + await notificationService.updateSettings({ [key]: value }); - // Update local state - setSettings(updatedSettings); - } catch (error) { - logger.error('Error updating notification settings:', error); - setAlertTitle('Error'); - setAlertMessage('Failed to update notification settings'); - setAlertActions([{ label: 'OK', onPress: () => setAlertVisible(false) }]); - setAlertVisible(true); - } - }; + // Update local state + setSettings(updatedSettings); + } catch (error) { + logger.error('Error updating notification settings:', error); + setAlertTitle(t('common.error')); + setAlertMessage(t('notification.failed_update_notification_settings')); + setAlertActions([{ label: 'OK', onPress: () => setAlertVisible(false) }]); + setAlertVisible(true); + } + }; - // Set time before airing - const setTimeBeforeAiring = (hours: number) => { - updateSetting('timeBeforeAiring', hours); - }; + // Set time before airing + const setTimeBeforeAiring = (hours: number) => { + updateSetting('timeBeforeAiring', hours); + }; - const resetAllNotifications = async () => { - setAlertTitle(t('notification.alert_reset_title')); - setAlertMessage(t('notification.alert_reset_msg')); - setAlertActions([ - { label: 'Cancel', onPress: () => setAlertVisible(false), style: { color: currentTheme.colors.mediumGray } }, - { - label: t('mdblist.reset_confirm') || 'Reset', // Using mdblist or common if available, fallback for safely - onPress: async () => { - try { - const scheduledNotifications = notificationService.getScheduledNotifications?.() || []; - for (const notification of scheduledNotifications) { - await notificationService.cancelNotification(notification.id); - } - setAlertTitle(t('common.success') || 'Success'); - setAlertMessage(t('notification.alert_reset_success')); - setAlertActions([{ label: 'OK', onPress: () => setAlertVisible(false) }]); - setAlertVisible(true); - } catch (error) { - logger.error('Error resetting notifications:', error); - setAlertTitle('Error'); - setAlertMessage('Failed to reset notifications'); - setAlertActions([{ label: 'OK', onPress: () => setAlertVisible(false) }]); - setAlertVisible(true); - } - }, - style: { color: currentTheme.colors.error } - }, - ]); - setAlertVisible(true); - }; + const resetAllNotifications = async () => { + setAlertTitle(t('notification.alert_reset_title')); + setAlertMessage(t('notification.alert_reset_msg')); + setAlertActions([ + { + label: t('common.cancel'), + onPress: () => setAlertVisible(false), + style: { color: currentTheme.colors.mediumGray }, + }, + { + label: t('mdblist.reset_confirm') || 'Reset', // Using mdblist or common if available, fallback for safely + onPress: async () => { + try { + const scheduledNotifications = + notificationService.getScheduledNotifications?.() || []; + for (const notification of scheduledNotifications) { + await notificationService.cancelNotification(notification.id); + } + setAlertTitle(t('common.success') || 'Success'); + setAlertMessage(t('notification.alert_reset_success')); + setAlertActions([{ label: 'OK', onPress: () => setAlertVisible(false) }]); + setAlertVisible(true); + } catch (error) { + logger.error('Error resetting notifications:', error); + setAlertTitle('Error'); + setAlertMessage(t('notification.failed_reset_notifications')); + setAlertActions([{ label: 'OK', onPress: () => setAlertVisible(false) }]); + setAlertVisible(true); + } + }, + style: { color: currentTheme.colors.error }, + }, + ]); + setAlertVisible(true); + }; - const handleSyncNotifications = async () => { - if (isSyncing) return; + const handleSyncNotifications = async () => { + if (isSyncing) return; - setIsSyncing(true); - try { - await notificationService.syncAllNotifications(); + setIsSyncing(true); + try { + await notificationService.syncAllNotifications(); - // Refresh stats after sync - const stats = notificationService.getNotificationStats(); - setNotificationStats(stats); + // Refresh stats after sync + const stats = notificationService.getNotificationStats(); + setNotificationStats(stats); - setAlertTitle(t('notification.alert_sync_complete')); - setAlertMessage(t('notification.alert_sync_msg', { upcoming: stats.upcoming, thisWeek: stats.thisWeek })); - setAlertActions([{ label: 'OK', onPress: () => setAlertVisible(false) }]); - setAlertVisible(true); - } catch (error) { - logger.error('Error syncing notifications:', error); - setAlertTitle('Error'); - setAlertMessage('Failed to sync notifications. Please try again.'); - setAlertActions([{ label: 'OK', onPress: () => setAlertVisible(false) }]); - setAlertVisible(true); - } finally { - setIsSyncing(false); - } - }; + setAlertTitle(t('notification.alert_sync_complete')); + setAlertMessage( + t('notification.alert_sync_msg', { + upcoming: stats.upcoming, + thisWeek: stats.thisWeek, + }), + ); + setAlertActions([{ label: 'OK', onPress: () => setAlertVisible(false) }]); + setAlertVisible(true); + } catch (error) { + logger.error('Error syncing notifications:', error); + setAlertTitle(t('common.error')); + setAlertMessage(t('notification.failed_sync_notifications')); + setAlertActions([{ label: 'OK', onPress: () => setAlertVisible(false) }]); + setAlertVisible(true); + } finally { + setIsSyncing(false); + } + }; - const handleTestNotification = async () => { - try { - // Remove all previous test notifications before scheduling a new one - const scheduled = notificationService.getScheduledNotifications?.() || []; - const testNotifications = scheduled.filter(n => n.id.startsWith('test-notification-')); - if (testNotifications.length > 0 && typeof notificationService.cancelNotification === 'function') { - for (const n of testNotifications) { - await notificationService.cancelNotification(n.id); - } - } + const handleTestNotification = async () => { + try { + // Remove all previous test notifications before scheduling a new one + const scheduled = notificationService.getScheduledNotifications?.() || []; + const testNotifications = scheduled.filter((n) => + n.id.startsWith('test-notification-'), + ); + if ( + testNotifications.length > 0 && + typeof notificationService.cancelNotification === 'function' + ) { + for (const n of testNotifications) { + await notificationService.cancelNotification(n.id); + } + } + // Temporarily override timeBeforeAiring to 0 for the test notification + let originalTimeBeforeAiring: number | undefined = undefined; + if (typeof notificationService.getSettings === 'function') { + const currentSettings = await notificationService.getSettings(); + originalTimeBeforeAiring = currentSettings.timeBeforeAiring; + if (typeof notificationService.updateSettings === 'function') { + await notificationService.updateSettings({ timeBeforeAiring: 0 }); + } + } - // Temporarily override timeBeforeAiring to 0 for the test notification - let originalTimeBeforeAiring: number | undefined = undefined; - if (typeof notificationService.getSettings === 'function') { - const currentSettings = await notificationService.getSettings(); - originalTimeBeforeAiring = currentSettings.timeBeforeAiring; - if (typeof notificationService.updateSettings === 'function') { - await notificationService.updateSettings({ timeBeforeAiring: 0 }); - } - } + const testNotification = { + id: 'test-notification-' + Date.now(), + seriesId: 'test-series', + seriesName: 'Test Show', + episodeTitle: 'Test Episode', + season: 1, + episode: 1, + releaseDate: new Date(Date.now() + 5000).toISOString(), // 5 seconds from now + notified: false, + }; - const testNotification = { - id: 'test-notification-' + Date.now(), - seriesId: 'test-series', - seriesName: 'Test Show', - episodeTitle: 'Test Episode', - season: 1, - episode: 1, - releaseDate: new Date(Date.now() + 5000).toISOString(), // 5 seconds from now - notified: false - }; + const notificationId = + await notificationService.scheduleEpisodeNotification(testNotification); - const notificationId = await notificationService.scheduleEpisodeNotification(testNotification); + // Restore original timeBeforeAiring + if ( + typeof notificationService.updateSettings === 'function' && + originalTimeBeforeAiring !== undefined + ) { + await notificationService.updateSettings({ + timeBeforeAiring: originalTimeBeforeAiring, + }); + } - // Restore original timeBeforeAiring - if ( - typeof notificationService.updateSettings === 'function' && - originalTimeBeforeAiring !== undefined - ) { - await notificationService.updateSettings({ timeBeforeAiring: originalTimeBeforeAiring }); - } + if (notificationId) { + setTestNotificationId(notificationId); + setCountdown(0); // No countdown for instant notification + setAlertTitle(t('common.success') || 'Success'); + setAlertMessage(t('notification.alert_test_scheduled')); + setAlertActions([{ label: 'OK', onPress: () => setAlertVisible(false) }]); + setAlertVisible(true); + } else { + setAlertTitle(t('common.error')); + setAlertMessage(t('notification.failed_test_enable_notifications')); + setAlertActions([{ label: 'OK', onPress: () => setAlertVisible(false) }]); + setAlertVisible(true); + } + } catch (error) { + logger.error('Error scheduling test notification:', error); + setAlertTitle(t('common.error')); + setAlertMessage(t('notification.failed_test')); + setAlertActions([{ label: 'OK', onPress: () => setAlertVisible(false) }]); + setAlertVisible(true); + } + }; - if (notificationId) { - setTestNotificationId(notificationId); - setCountdown(0); // No countdown for instant notification - setAlertTitle(t('common.success') || 'Success'); - setAlertMessage(t('notification.alert_test_scheduled')); - setAlertActions([{ label: 'OK', onPress: () => setAlertVisible(false) }]); - setAlertVisible(true); - } else { - setAlertTitle('Error'); - setAlertMessage('Failed to schedule test notification. Make sure notifications are enabled.'); - setAlertActions([{ label: 'OK', onPress: () => setAlertVisible(false) }]); - setAlertVisible(true); - } - } catch (error) { - logger.error('Error scheduling test notification:', error); - setAlertTitle('Error'); - setAlertMessage('Failed to schedule test notification'); - setAlertActions([{ label: 'OK', onPress: () => setAlertVisible(false) }]); - setAlertVisible(true); - } - }; + if (loading) { + return ( + + + navigation.goBack()} + > + + + + {t('notification.title')} + + + + + + {t('notification.loading_settings')} + + + + ); + } - if (loading) { - return ( - - - navigation.goBack()} - > - - - {t('notification.title')} - - - - Loading settings... - - - ); - } + return ( + + - return ( - - + + navigation.goBack()} + > + + + {t('common.settings') || 'Settings'} + + - - navigation.goBack()} - > - - - {t('common.settings') || 'Settings'} - - + + {/* Empty for now, but ready for future actions */} + + - - {/* Empty for now, but ready for future actions */} - - + + {t('notification.title')} + - - {t('notification.title')} - + + + + + {t('notification.section_general')} + - - - - {t('notification.section_general')} + + + + + {t('notification.enable_notifications')} + + + updateSetting('enabled', value)} + trackColor={{ + false: currentTheme.colors.border, + true: currentTheme.colors.primary + '80', + }} + thumbColor={ + settings.enabled + ? currentTheme.colors.primary + : currentTheme.colors.lightGray + } + /> + + - - - - {t('notification.enable_notifications')} - - updateSetting('enabled', value)} - trackColor={{ false: currentTheme.colors.border, true: currentTheme.colors.primary + '80' }} - thumbColor={settings.enabled ? currentTheme.colors.primary : currentTheme.colors.lightGray} - /> - - + {settings.enabled && ( + <> + + + {t('notification.section_types')} + - {settings.enabled && ( - <> - - {t('notification.section_types')} + + + + + {t('notification.new_episodes')} + + + + updateSetting('newEpisodeNotifications', value) + } + trackColor={{ + false: currentTheme.colors.border, + true: currentTheme.colors.primary + '80', + }} + thumbColor={ + settings.newEpisodeNotifications + ? currentTheme.colors.primary + : currentTheme.colors.lightGray + } + /> + - - - - {t('notification.new_episodes')} - - updateSetting('newEpisodeNotifications', value)} - trackColor={{ false: currentTheme.colors.border, true: currentTheme.colors.primary + '80' }} - thumbColor={settings.newEpisodeNotifications ? currentTheme.colors.primary : currentTheme.colors.lightGray} - /> - + + + + + {t('notification.upcoming_shows')} + + + + updateSetting('upcomingShowsNotifications', value) + } + trackColor={{ + false: currentTheme.colors.border, + true: currentTheme.colors.primary + '80', + }} + thumbColor={ + settings.upcomingShowsNotifications + ? currentTheme.colors.primary + : currentTheme.colors.lightGray + } + /> + - - - - {t('notification.upcoming_shows')} - - updateSetting('upcomingShowsNotifications', value)} - trackColor={{ false: currentTheme.colors.border, true: currentTheme.colors.primary + '80' }} - thumbColor={settings.upcomingShowsNotifications ? currentTheme.colors.primary : currentTheme.colors.lightGray} - /> - + + + + + {t('notification.reminders')} + + + + updateSetting('reminderNotifications', value) + } + trackColor={{ + false: currentTheme.colors.border, + true: currentTheme.colors.primary + '80', + }} + thumbColor={ + settings.reminderNotifications + ? currentTheme.colors.primary + : currentTheme.colors.lightGray + } + /> + + - - - - {t('notification.reminders')} - - updateSetting('reminderNotifications', value)} - trackColor={{ false: currentTheme.colors.border, true: currentTheme.colors.primary + '80' }} - thumbColor={settings.reminderNotifications ? currentTheme.colors.primary : currentTheme.colors.lightGray} - /> - - + + + {t('notification.section_timing')} + - - {t('notification.section_timing')} + + {t('notification.timing_desc')} + - - {t('notification.timing_desc')} - + + {[1, 6, 12, 24].map((hours) => ( + setTimeBeforeAiring(hours)} + > + + {hours === 1 + ? t('notification.hours_1') + : `${hours} ${t('notification.hours_suffix')}`} + + + ))} + + - - {[1, 6, 12, 24].map((hours) => ( - setTimeBeforeAiring(hours)} - > - - {hours === 1 ? t('notification.hours_1') : `${hours} ${t('notification.hours_suffix')}`} - - - ))} - - + + + {t('notification.section_status')} + - - {t('notification.section_status')} + + + + + {t('notification.stats_upcoming')} + + + {notificationStats.upcoming} + + + + + + {t('notification.stats_this_week')} + + + {notificationStats.thisWeek} + + + + + + {t('notification.stats_total')} + + + {notificationStats.total} + + + - - - - {t('notification.stats_upcoming')} - {notificationStats.upcoming} - - - - {t('notification.stats_this_week')} - {notificationStats.thisWeek} - - - - {t('notification.stats_total')} - {notificationStats.total} - - + + + + {isSyncing + ? t('notification.syncing') + : t('notification.sync_button')} + + - - - - {isSyncing ? t('notification.syncing') : t('notification.sync_button')} - - + + {t('notification.sync_desc')} + + - - {t('notification.sync_desc')} - - + + + {t('notification.section_advanced')} + - - {t('notification.section_advanced')} + + + + {t('notification.reset_button')} + + - - - {t('notification.reset_button')} - + + + + {countdown !== null + ? t('notification.test_notification_in', { seconds: countdown }) + : t('notification.test_button')} + + - - - - {countdown !== null - ? t('notification.test_notification_in', { seconds: countdown }) - : t('notification.test_button')} - - - - {countdown !== null && ( - - - - {t('notification.test_notification_text', { seconds: countdown })} - - - )} - - - )} - - - setAlertVisible(false)} - actions={alertActions} - /> - - ); + {countdown !== null && ( + + + + {t('notification.test_notification_text', { seconds: countdown })} + + + )} + + + )} + + + setAlertVisible(false)} + actions={alertActions} + /> + + ); }; const styles = StyleSheet.create({ - container: { - flex: 1, - }, - header: { - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'space-between', - paddingHorizontal: 16, - paddingTop: Platform.OS === 'android' ? ANDROID_STATUSBAR_HEIGHT + 8 : 8, - }, - backButton: { - flexDirection: 'row', - alignItems: 'center', - padding: 8, - }, - backText: { - fontSize: 17, - marginLeft: 8, - }, - headerActions: { - flexDirection: 'row', - alignItems: 'center', - }, - headerButton: { - padding: 8, - marginLeft: 8, - }, - headerTitle: { - fontSize: 34, - fontWeight: 'bold', - paddingHorizontal: 16, - marginBottom: 24, - }, - content: { - flex: 1, - }, - loadingContainer: { - flex: 1, - justifyContent: 'center', - alignItems: 'center', - }, - loadingText: { - fontSize: 16, - }, - section: { - padding: 16, - borderBottomWidth: 1, - }, - sectionTitle: { - fontSize: 16, - fontWeight: 'bold', - marginBottom: 16, - }, - settingItem: { - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', - paddingVertical: 12, - borderBottomWidth: 1, - }, - settingInfo: { - flexDirection: 'row', - alignItems: 'center', - }, - settingText: { - fontSize: 16, - marginLeft: 12, - }, - settingDescription: { - fontSize: 14, - marginBottom: 16, - }, - timingOptions: { - flexDirection: 'row', - justifyContent: 'space-between', - flexWrap: 'wrap', - marginTop: 8, - }, - timingOption: { - paddingVertical: 10, - paddingHorizontal: 16, - borderRadius: 8, - borderWidth: 1, - marginBottom: 8, - width: '48%', - alignItems: 'center', - }, - timingText: { - fontSize: 14, - }, - resetButton: { - flexDirection: 'row', - alignItems: 'center', - padding: 12, - borderRadius: 8, - borderWidth: 1, - marginBottom: 8, - }, - resetButtonText: { - fontSize: 16, - fontWeight: 'bold', - marginLeft: 8, - }, - resetDescription: { - fontSize: 12, - fontStyle: 'italic', - }, - countdownContainer: { - flexDirection: 'row', - alignItems: 'center', - marginTop: 8, - padding: 8, - backgroundColor: 'rgba(0, 0, 0, 0.1)', - borderRadius: 4, - }, - countdownIcon: { - marginRight: 8, - }, - countdownText: { - fontSize: 14, - }, - statsContainer: { - flexDirection: 'row', - justifyContent: 'space-around', - padding: 16, - borderRadius: 8, - marginBottom: 16, - }, - statItem: { - alignItems: 'center', - flex: 1, - }, - statLabel: { - fontSize: 12, - marginTop: 4, - textAlign: 'center', - }, - statValue: { - fontSize: 18, - fontWeight: 'bold', - marginTop: 2, - }, + container: { + flex: 1, + }, + header: { + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-between', + paddingHorizontal: 16, + paddingTop: Platform.OS === 'android' ? ANDROID_STATUSBAR_HEIGHT + 8 : 8, + }, + backButton: { + flexDirection: 'row', + alignItems: 'center', + padding: 8, + }, + backText: { + fontSize: 17, + marginLeft: 8, + }, + headerActions: { + flexDirection: 'row', + alignItems: 'center', + }, + headerButton: { + padding: 8, + marginLeft: 8, + }, + headerTitle: { + fontSize: 34, + fontWeight: 'bold', + paddingHorizontal: 16, + marginBottom: 24, + }, + content: { + flex: 1, + }, + loadingContainer: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + }, + loadingText: { + fontSize: 16, + }, + section: { + padding: 16, + borderBottomWidth: 1, + }, + sectionTitle: { + fontSize: 16, + fontWeight: 'bold', + marginBottom: 16, + }, + settingItem: { + flexDirection: 'row', + justifyContent: 'space-between', + alignItems: 'center', + paddingVertical: 12, + borderBottomWidth: 1, + }, + settingInfo: { + flexDirection: 'row', + alignItems: 'center', + }, + settingText: { + fontSize: 16, + marginLeft: 12, + }, + settingDescription: { + fontSize: 14, + marginBottom: 16, + }, + timingOptions: { + flexDirection: 'row', + justifyContent: 'space-between', + flexWrap: 'wrap', + marginTop: 8, + }, + timingOption: { + paddingVertical: 10, + paddingHorizontal: 16, + borderRadius: 8, + borderWidth: 1, + marginBottom: 8, + width: '48%', + alignItems: 'center', + }, + timingText: { + fontSize: 14, + }, + resetButton: { + flexDirection: 'row', + alignItems: 'center', + padding: 12, + borderRadius: 8, + borderWidth: 1, + marginBottom: 8, + }, + resetButtonText: { + fontSize: 16, + fontWeight: 'bold', + marginLeft: 8, + }, + resetDescription: { + fontSize: 12, + fontStyle: 'italic', + }, + countdownContainer: { + flexDirection: 'row', + alignItems: 'center', + marginTop: 8, + padding: 8, + backgroundColor: 'rgba(0, 0, 0, 0.1)', + borderRadius: 4, + }, + countdownIcon: { + marginRight: 8, + }, + countdownText: { + fontSize: 14, + }, + statsContainer: { + flexDirection: 'row', + justifyContent: 'space-around', + padding: 16, + borderRadius: 8, + marginBottom: 16, + }, + statItem: { + alignItems: 'center', + flex: 1, + }, + statLabel: { + fontSize: 12, + marginTop: 4, + textAlign: 'center', + }, + statValue: { + fontSize: 18, + fontWeight: 'bold', + marginTop: 2, + }, }); -export default NotificationSettingsScreen; \ No newline at end of file +export default NotificationSettingsScreen;