From ffd18d3a2248f2a78c2986520d7f12fd8a6bc098 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 28 Feb 2020 22:40:42 +0100 Subject: [PATCH] Night mode is in Android Q, not P --- app/src/main/java/org/jak_linux/dns66/MainActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/jak_linux/dns66/MainActivity.java b/app/src/main/java/org/jak_linux/dns66/MainActivity.java index 4c4a754d..005fca94 100644 --- a/app/src/main/java/org/jak_linux/dns66/MainActivity.java +++ b/app/src/main/java/org/jak_linux/dns66/MainActivity.java @@ -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); @@ -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.