Skip to content

Instantly share code, notes, and snippets.

@hsmnzaydn
Created June 26, 2022 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hsmnzaydn/9a51834e54a1c68bfa0bdd993f05b7ea to your computer and use it in GitHub Desktop.
Save hsmnzaydn/9a51834e54a1c68bfa0bdd993f05b7ea to your computer and use it in GitHub Desktop.
val colorScheme = when {
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
val context = LocalContext.current
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
}
darkTheme -> DarkColorScheme
else -> LightColorScheme
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment