Skip to content

Commit

Permalink
Night mode is in Android Q, not P
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-klode committed Feb 28, 2020
1 parent 88e27c6 commit ffd18d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/org/jak_linux/dns66/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected void onCreate(Bundle savedInstanceState) {
config = FileHelper.loadCurrentSettings(this);
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
} else if (config.nightMode) {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
Expand Down Expand Up @@ -133,7 +133,7 @@ public boolean onCreateOptionsMenu(Menu menu) {
menu.findItem(R.id.setting_show_notification).setChecked(config.showNotification);
menu.findItem(R.id.setting_night_mode).setChecked(config.nightMode);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
menu.findItem(R.id.setting_night_mode).setVisible(false);
}
// On Android O, require users to configure notifications via notification channels.
Expand Down

0 comments on commit ffd18d3

Please sign in to comment.