Light / Dark Themes
Support different custom attributes for Light and Dark themes
By default Theme.Kevin.Base
theme is based on Material's DayNight
theme which changes between light and dark based on the current device theme.
When you override an attribute, its value will be applied for both light and dark modes.
For example:
To apply a different attribute values for light or dark mode, it is recommended to follow Android's best practice and create an alternative Android Resources Directory specifically for your light mode theme.
You can implement this similar to values-notnight
or values-night
example, depending on your project's structure:
Forcing Light or Dark theme
If you are only interested in using either light or dark mode exclusively you can do it by simply switching parent theme from Theme.Kevin.Base
to:
Theme.Kevin.Base.Light
- light mode
Theme.Kevin.Base.Dark
- dark mode
This means that regardless of the active system theme, the SDK will adhere to either light or dark palette only.
You still have the option to customize each of the attributes, as demonstrated in the example below:
Last updated