Skip to content

Instantly share code, notes, and snippets.

@igorescodro
Last active May 14, 2022 20:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igorescodro/91b75ea22dd5433ee72ba01c6da692e3 to your computer and use it in GitHub Desktop.
Save igorescodro/91b75ea22dd5433ee72ba01c6da692e3 to your computer and use it in GitHub Desktop.
val dynamicColor = isDynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S
val colorScheme = when {
dynamicColor && isDarkTheme -> dynamicDarkColorScheme(LocalContext.current)
dynamicColor && !isDarkTheme -> dynamicLightColorScheme(LocalContext.current)
isDarkTheme -> MyAppDarkColorScheme
else -> MyAppLightColorScheme
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment