diff --git a/App.tsx b/App.tsx index b2328eec..52c5b4bb 100644 --- a/App.tsx +++ b/App.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { ActivityIndicator, AppState, Linking, StyleSheet, Text, View } from 'react-native'; import { StatusBar } from 'expo-status-bar'; import { useColorScheme } from 'react-native'; -import { NavigationContainer, createNavigationContainerRef } from '@react-navigation/native'; +import { DarkTheme, DefaultTheme, NavigationContainer, createNavigationContainerRef } from '@react-navigation/native'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import { createNativeStackNavigator, type NativeStackScreenProps } from '@react-navigation/native-stack'; import { Mail, Calendar, BookUser, HardDrive, Settings } from 'lucide-react-native'; @@ -267,6 +267,13 @@ export default function App() { const resolvedScheme: 'light' | 'dark' = themePref === 'system' ? (systemScheme === 'light' ? 'light' : 'dark') : themePref; const statusBarStyle: 'light' | 'dark' = resolvedScheme === 'light' ? 'dark' : 'light'; + // React Navigation's default theme is light: without this its containers + // paint white behind and between screens, even in dark mode. + const background = useColors().background; + const navigationTheme = React.useMemo(() => { + const base = resolvedScheme === 'light' ? DefaultTheme : DarkTheme; + return { ...base, colors: { ...base.colors, background, card: background } }; + }, [resolvedScheme, background]); // Persisted active account is the signal that the user was already signed // in on the previous launch. When present we render the main UI with the // cached mail list instead of the "Restoring session" spinner; the real @@ -642,7 +649,7 @@ export default function App() { } return ( - + diff --git a/android/app/src/main/res/values-night/colors.xml b/android/app/src/main/res/values-night/colors.xml index 3c05de5b..683123ba 100644 --- a/android/app/src/main/res/values-night/colors.xml +++ b/android/app/src/main/res/values-night/colors.xml @@ -1 +1,4 @@ - \ No newline at end of file + + + #09090b + \ No newline at end of file diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml index d1b8dedd..033c15b6 100644 --- a/android/app/src/main/res/values/colors.xml +++ b/android/app/src/main/res/values/colors.xml @@ -3,4 +3,6 @@ #09090b #023c69 #09090b + + #ffffff \ No newline at end of file diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index ba943153..0115d6b9 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -4,6 +4,7 @@ @drawable/rn_edit_text_material @color/colorPrimary #09090b + @color/window_background