Adjustment of the MainActivity, so that DarkTheme is still active with the activated battery or system status option. Dark Theme will remain if the app is closed.
This commit is contained in:
parent
38a708821a
commit
e832e6c4ac
1 changed files with 12 additions and 5 deletions
|
@ -2,6 +2,7 @@ package org.secuso.privacyfriendlysudoku.ui;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.media.audiofx.Equalizer;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceActivity;
|
import android.preference.PreferenceActivity;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
@ -62,6 +63,12 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||||
|
|
||||||
if (settings.getBoolean("pref_dark_mode_setting", false )) {
|
if (settings.getBoolean("pref_dark_mode_setting", false )) {
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||||
|
|
||||||
|
} else if (settings.getBoolean("pref_dark_mode_automatically_by_system", false)) {
|
||||||
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
|
||||||
|
|
||||||
|
} else if(settings.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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue