Francois Morvillier
02/25/2022, 5:07 PMCard(backgroundColor = MaterialTheme.colorScheme.surface) {
Text(text, color = MaterialTheme.colorScheme.onSurface)
}
Is there a good guide to best practices on the topic?CRamsan
02/25/2022, 5:09 PMFrancois Morvillier
02/25/2022, 5:22 PMKirill Grouchnikov
02/25/2022, 6:44 PMFrancois Morvillier
02/25/2022, 7:11 PMsetContent {
CompositionLocalProvider(
LocalNavController provides navController,
// ...
) {
MyTheme(darkTheme = LocalUiSettings.current.darkMode.collectAsState(initial = false).value) {
Scaffold( ... ) {
// everything goes here
}
}
}
Chris Sinco [G]
02/26/2022, 1:25 AMI find myself needing to specify background and foreground colors for every component in order to have the Dark Theme properly applied.Where are you seeing issues where the dark theme is not being applied to your expectations? On device and/or in Previews?
Chris Sinco [G]
02/26/2022, 1:27 AMandroidx.compose.foundation.isSystemInDarkTheme()
?Chris Sinco [G]
02/26/2022, 1:28 AMChris Sinco [G]
02/26/2022, 1:30 AMFrancois Morvillier
02/26/2022, 2:13 AMKirill Grouchnikov
02/26/2022, 4:18 AMFrancois Morvillier
02/28/2022, 5:10 PMChris Sinco [G]
02/28/2022, 5:35 PMChris Sinco [G]
02/28/2022, 5:35 PMI didn’t realize all the components had been duplicatedCould you elaborate?
Francois Morvillier
02/28/2022, 6:20 PMCould you elaborate?Text, Card, Surface etc. each have a version in androidx.compose.material and in androidx.compose.material3. In my tests only the later respond automatically to the material 3 theming which makes it unfortunately unwieldy to switch back and forth from material to material 3 theming.
Chris Sinco [G]
02/28/2022, 6:23 PMChris Sinco [G]
02/28/2022, 6:24 PMFrancois Morvillier
02/28/2022, 6:41 PMChris Sinco [G]
02/28/2022, 7:35 PMFrancois Morvillier
02/28/2022, 9:18 PMChris Sinco [G]
02/28/2022, 11:17 PM