Rename Day/Night and Day/Black to "Dynamic". On v28/Android Pie and lower, themes still change based on time of day. On Android 10 and up, theme changes in accordance with system dark mode setting.

This commit is contained in:
Morgan Lim 2020-07-09 15:54:27 -04:00
parent d10ea92edd
commit f506bfb14a
2 changed files with 10 additions and 3 deletions

View File

@ -24,6 +24,7 @@ import android.content.SharedPreferences;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.media.AudioManager; import android.media.AudioManager;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.os.Handler; import android.os.Handler;
@ -85,7 +86,13 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte
private static ImageLoader IMAGE_LOADER; private static ImageLoader IMAGE_LOADER;
static { static {
// If Android Pie or older, set night mode by system clock
if (Build.VERSION.SDK_INT<29) {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_AUTO); AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_AUTO);
} else {
// Else, for Android 10+, follow system dark mode setting
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
}
} }
final List<SubsonicFragment> backStack = new ArrayList<>(); final List<SubsonicFragment> backStack = new ArrayList<>();

View File

@ -162,8 +162,8 @@
<string name="settings.theme_light">Light</string> <string name="settings.theme_light">Light</string>
<string name="settings.theme_dark">Dark</string> <string name="settings.theme_dark">Dark</string>
<string name="settings.theme_black">Black</string> <string name="settings.theme_black">Black</string>
<string name="settings.theme_day_night">Day/Night</string> <string name="settings.theme_day_night">Dynamic (Light/Dark)</string>
<string name="settings.theme_day_black_night">Day/Black Night</string> <string name="settings.theme_day_black_night">Dynamic (Light/Black)</string>
<string name="settings.theme_fullscreen">Fullscreen</string> <string name="settings.theme_fullscreen">Fullscreen</string>
<string name="settings.theme_fullscreen_summary">Hide as many UI elements as Android will allow</string> <string name="settings.theme_fullscreen_summary">Hide as many UI elements as Android will allow</string>
<string name="settings.track_title">Display Track #</string> <string name="settings.track_title">Display Track #</string>