Adjusting the SettingsActivity
Here it is checked whether the battery and system have the value true at the same time. In this case the Battery value is set to false to solve the problem that both options can have the same value.
This commit is contained in:
parent
954dffca34
commit
67e73a6175
1 changed files with 4 additions and 0 deletions
|
@ -90,6 +90,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
||||||
|
|
||||||
public void restartActivity() {
|
public void restartActivity() {
|
||||||
Intent i = new Intent(getApplicationContext(), MainActivity.class);
|
Intent i = new Intent(getApplicationContext(), MainActivity.class);
|
||||||
|
recreate();
|
||||||
finish();
|
finish();
|
||||||
startActivity(i);
|
startActivity(i);
|
||||||
}
|
}
|
||||||
|
@ -225,6 +226,9 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
||||||
findPreference("pref_dark_mode_automatically_by_system").setEnabled(false);
|
findPreference("pref_dark_mode_automatically_by_system").setEnabled(false);
|
||||||
findPreference("pref_dark_mode_automatically_by_battery").setEnabled(false);
|
findPreference("pref_dark_mode_automatically_by_battery").setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
|
if (sp.getBoolean("pref_dark_mode_automatically_by_battery", false) && sp.getBoolean("pref_dark_mode_automatically_by_system", false) ) {
|
||||||
|
sp.edit().putBoolean("pref_dark_mode_automatically_by_battery", false).commit();
|
||||||
|
}
|
||||||
|
|
||||||
findPreference("pref_dark_mode_automatically_by_system").setEnabled(!sp.getBoolean("pref_dark_mode_automatically_by_battery", false));
|
findPreference("pref_dark_mode_automatically_by_system").setEnabled(!sp.getBoolean("pref_dark_mode_automatically_by_battery", false));
|
||||||
findPreference("pref_dark_mode_automatically_by_battery").setEnabled(!sp.getBoolean("pref_dark_mode_automatically_by_system", false));
|
findPreference("pref_dark_mode_automatically_by_battery").setEnabled(!sp.getBoolean("pref_dark_mode_automatically_by_system", false));
|
||||||
|
|
Loading…
Reference in a new issue