Reputation: 344
How to set light theme by default in Android?
I need to know how can I set light theme by default even if the user enable dark theme in his smart phone with Java code.
Upvotes: 2
Views: 4252
Reputation: 1336
You can do this by just copying light theme Properties into Night theme file.
Go to res>values>themes.
In themes folder, you will see two files themes.xml
and themes.xml(night)
.
Step 1:
themes.xml
colors and paste them into themes.xml(night)
.Step 2:
Replace this
<style name="<app name here>" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
to this
<style name="Theme.CurrentLocation" parent="Theme.MaterialComponents.Light">
Upvotes: 3