How to use light mode and dark mode in Android Studio and Kotlin
A step by step guide on setting up and using dark and light mode in Kotlin and Android Studio.
Step One: Alter the Theme
In the Theme.kt file, change the colors associated with Light and Dark mode.
Step Two: Update Color Scheme Code
In the Theme.kt file, change the color scheme code to match the one below.
Step Three: Use the Colors
To apply the colors use code similar to MaterialTheme.colorScheme.background or MaterialTheme.colorScheme.primary.
Step Four: Test
Run the app on a device to confirm the theme works.
Any Questions?
We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.