adjpd
08/26/2021, 4:42 PMMyAppNameTheme
.
But that boolean doesn't seem dependent on the Android system's dark mode. Am I missing something?Chris Sinco [G]
08/26/2021, 4:53 PMisSystemInDarkTheme()
which is the default value for the MyAppNameTheme
from the project templateChris Sinco [G]
08/26/2021, 4:54 PMChris Sinco [G]
08/26/2021, 4:56 PMadjpd
08/26/2021, 4:57 PMChris Sinco [G]
08/26/2021, 5:03 PMChris Sinco [G]
08/26/2021, 5:05 PMMyAppNameTheme
should work for youadjpd
08/26/2021, 5:34 PMChris Sinco [G]
08/26/2021, 5:40 PMMyAppNameTheme
? If you are using isSystemInDarkTheme
, the Composables you have that are wrapped in MyAppNameThem
should automatically recompose since the system change will trigger the recomposition.Chris Sinco [G]
08/26/2021, 5:41 PMas long as the user wants the compose theme to reflect the system themeWill you have a user app setting for this?
adjpd
08/26/2021, 6:17 PMadjpd
08/26/2021, 6:18 PMChris Sinco [G]
08/26/2021, 6:47 PMMyAppNameTheme
is towards the very top of your app UI hierarchy. Here is a screencast with the Layout Inspector showing the full hierarchy of the screen. Everything below MyTheme
should recompose to dark theme.Colton Idle
08/26/2021, 6:56 PMChris Sinco [G]
08/26/2021, 6:59 PMColton Idle
08/26/2021, 7:01 PMChris Sinco [G]
08/26/2021, 7:01 PMChris Sinco [G]
08/26/2021, 7:01 PMMaterialTheme
on its own doesn’t have any awareness of the dark theme in Android. The recommended pattern is to wrap it in your own Composable, e.g. MyTheme
, and then switch the colors based on your business logicChris Sinco [G]
08/26/2021, 7:02 PMChris Sinco [G]
08/26/2021, 7:03 PMColton Idle
08/26/2021, 7:09 PMChris Sinco [G]
08/26/2021, 7:13 PM