- Improved theme.
This commit is contained in:
An Bui 2025-11-02 22:58:37 +07:00
parent fe8dbc2b93
commit b53e72be1a
18 changed files with 423 additions and 56 deletions

View file

@ -515,4 +515,13 @@ public class UIUtils {
return luminance > 186;
}
public static void setDarkOrLight(int mode) {
if (mode == MainSettingsManager.THEME_LIGHT) {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
} else if (mode == MainSettingsManager.THEME_DARK) {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
} else {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
}
}
}