Created
April 5, 2024 09:09
-
-
Save nawanirakshit/35de040328ecde657a9f44941d78c6fb to your computer and use it in GitHub Desktop.
Android: Change app 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
We can select any othe of the following theme mode to work with | |
1. AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM | |
This mode is used when we need to select the system assigned mode | |
2. AppCompatDelegate.MODE_NIGHT_NO | |
This mode is used when we need to set the Light mode in the app | |
3. AppCompatDelegate.MODE_NIGHT_YES | |
This mode is used when we need to set the Dark mode in the app | |
and to set the theme we need to add one of the above in following method | |
AppCompatDelegate.setDefaultNightMode(SELECTED THEME HERE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment