@@ -20,7 +20,7 @@ import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
2020import DrawerItems from './DrawerItems' ;
2121import { PreferencesContext } from './PreferencesContext' ;
2222import App from './RootNavigator' ;
23- import { deviceColorsSupported } from '../utils' ;
23+ import { dynamicThemeSupported } from '../utils' ;
2424import {
2525 CombinedDefaultTheme ,
2626 CombinedDarkTheme ,
@@ -45,7 +45,7 @@ export default function PaperExample() {
4545 InitialState | undefined
4646 > ( ) ;
4747
48- const [ shouldUseDeviceColors , setShouldUseDeviceColors ] =
48+ const [ shouldUseDynamicTheme , setShouldUseDynamicTheme ] =
4949 React . useState ( true ) ;
5050 const [ isDarkMode , setIsDarkMode ] = React . useState ( false ) ;
5151 const [ rtl , setRtl ] = React . useState < boolean > (
@@ -56,12 +56,12 @@ export default function PaperExample() {
5656 const [ rippleEffectEnabled , setRippleEffectEnabled ] = React . useState ( true ) ;
5757
5858 const theme = React . useMemo ( ( ) => {
59- if ( deviceColorsSupported && shouldUseDeviceColors ) {
59+ if ( dynamicThemeSupported && shouldUseDynamicTheme ) {
6060 return isDarkMode ? DynamicDarkTheme : DynamicLightTheme ;
6161 }
6262
6363 return isDarkMode ? DarkTheme : LightTheme ;
64- } , [ isDarkMode , shouldUseDeviceColors ] ) ;
64+ } , [ isDarkMode , shouldUseDynamicTheme ] ) ;
6565
6666 React . useEffect ( ( ) => {
6767 const restoreState = async ( ) => {
@@ -128,8 +128,8 @@ export default function PaperExample() {
128128
129129 const preferences = React . useMemo (
130130 ( ) => ( {
131- toggleShouldUseDeviceColors : ( ) =>
132- setShouldUseDeviceColors ( ( oldValue ) => ! oldValue ) ,
131+ toggleShouldUseDynamicTheme : ( ) =>
132+ setShouldUseDynamicTheme ( ( oldValue ) => ! oldValue ) ,
133133 toggleTheme : ( ) => setIsDarkMode ( ( oldValue ) => ! oldValue ) ,
134134 toggleRtl : ( ) => setRtl ( ( rtl ) => ! rtl ) ,
135135 toggleCollapsed : ( ) => setCollapsed ( ! collapsed ) ,
@@ -140,14 +140,14 @@ export default function PaperExample() {
140140 collapsed,
141141 rtl,
142142 theme,
143- shouldUseDeviceColors ,
143+ shouldUseDynamicTheme : shouldUseDynamicTheme ,
144144 } ) ,
145145 [
146146 rtl ,
147147 theme ,
148148 collapsed ,
149149 customFontLoaded ,
150- shouldUseDeviceColors ,
150+ shouldUseDynamicTheme ,
151151 rippleEffectEnabled ,
152152 ]
153153 ) ;
0 commit comments