15 lines
547 B
Markdown
15 lines
547 B
Markdown
# How to detect dark mode
|
|
|
|
|
|
Inside your Composable you can use **isSystemInDarkTheme** to detect if the device is running in dark mode.
|
|
|
|
```kotlin
|
|
val dark = isSystemInDarkTheme()
|
|
```
|
|
|
|
-------------
|
|
|
|
## See also:
|
|
* [Official Docs](https://developer.android.com/reference/kotlin/androidx/compose/foundation/package-summary#issystemindarktheme)
|
|
* [Learn-Jetpack-Compose-By-Example/DarkModeActivity](https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/theme/DarkModeActivity.kt)
|