-
-
Save skydoves/267c6b020ef77434e1cbeee5c8b720aa to your computer and use it in GitHub Desktop.
nia_theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun NiaTheme( | |
darkTheme: Boolean = isSystemInDarkTheme(), | |
dynamicColor: Boolean = false, | |
androidTheme: Boolean = false, | |
content: @Composable () -> Unit | |
) { | |
val colorScheme = when { | |
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { | |
val context = LocalContext.current | |
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) | |
} | |
androidTheme && darkTheme -> DarkAndroidColorScheme | |
androidTheme -> LightAndroidColorScheme | |
darkTheme -> DarkDefaultColorScheme | |
else -> LightDefaultColorScheme | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment