Fix bug in the GameActivity that caused problems with the dark mode theme

This commit is contained in:
uykek 2020-09-07 11:26:21 +02:00
parent 093c22e339
commit 873227a48e

View file

@ -138,6 +138,11 @@ public class GameActivity extends BaseActivity implements NavigationView.OnNavig
*/ */
if (sharedPref.getBoolean("pref_dark_mode_setting", false )) { if (sharedPref.getBoolean("pref_dark_mode_setting", false )) {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
} else if (sharedPref.getBoolean("pref_dark_mode_automatically_by_system", false)) {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
} else if(sharedPref.getBoolean("pref_dark_mode_automatically_by_battery", false)){
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY);
} else { } else {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
} }