aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/github/daneren2005/dsub/util/Util.java
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2016-09-02 17:08:50 -0700
committerScott Jackson <daneren2005@gmail.com>2016-09-02 17:08:50 -0700
commit2a3f49f2b61042cd57dbcc6d0acd7f8754fe534b (patch)
treee3016e759aa958c7b3baf6d83dfb4310e1883499 /app/src/main/java/github/daneren2005/dsub/util/Util.java
parentd3cd581edd08ba9811aa4f87362ea81a02fe11db (diff)
downloaddsub-2a3f49f2b61042cd57dbcc6d0acd7f8754fe534b.tar.gz
dsub-2a3f49f2b61042cd57dbcc6d0acd7f8754fe534b.tar.bz2
dsub-2a3f49f2b61042cd57dbcc6d0acd7f8754fe534b.zip
Fixes #656: Add Day/Night themes
Diffstat (limited to 'app/src/main/java/github/daneren2005/dsub/util/Util.java')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/Util.java59
1 files changed, 0 insertions, 59 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/util/Util.java b/app/src/main/java/github/daneren2005/dsub/util/Util.java
index 759c6799..b1f1617d 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/Util.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/Util.java
@@ -274,65 +274,6 @@ public final class Util {
editor.putBoolean(Constants.PREFERENCES_KEY_ALBUMS_PER_FOLDER + instance, perFolder);
editor.commit();
}
-
- public static String getTheme(Context context) {
- SharedPreferences prefs = getPreferences(context);
- return prefs.getString(Constants.PREFERENCES_KEY_THEME, null);
- }
- public static int getThemeRes(Context context) {
- return getThemeRes(context, getTheme(context));
- }
- public static int getThemeRes(Context context, String theme) {
- if(context instanceof SubsonicFragmentActivity || context instanceof SettingsActivity) {
- if(Util.getPreferences(context).getBoolean(Constants.PREFERENCES_KEY_COLOR_ACTION_BAR, true)) {
- if ("dark".equals(theme)) {
- return R.style.Theme_DSub_Dark_No_Actionbar;
- } else if ("black".equals(theme)) {
- return R.style.Theme_DSub_Black_No_Actionbar;
- } else if ("holo".equals(theme)) {
- return R.style.Theme_DSub_Holo_No_Actionbar;
- } else {
- return R.style.Theme_DSub_Light_No_Actionbar;
- }
- } else {
- if ("dark".equals(theme)) {
- return R.style.Theme_DSub_Dark_No_Color;
- } else if ("black".equals(theme)) {
- return R.style.Theme_DSub_Black_No_Color;
- } else if ("holo".equals(theme)) {
- return R.style.Theme_DSub_Holo_No_Color;
- } else {
- return R.style.Theme_DSub_Light_No_Color;
- }
- }
- } else {
- if ("dark".equals(theme)) {
- return R.style.Theme_DSub_Dark;
- } else if ("black".equals(theme)) {
- return R.style.Theme_DSub_Black;
- } else if ("holo".equals(theme)) {
- return R.style.Theme_DSub_Holo;
- } else {
- return R.style.Theme_DSub_Light;
- }
- }
- }
- public static void setTheme(Context context, String theme) {
- SharedPreferences.Editor editor = getPreferences(context).edit();
- editor.putString(Constants.PREFERENCES_KEY_THEME, theme);
- editor.commit();
- }
-
- public static void applyTheme(Context context, String theme) {
- context.setTheme(getThemeRes(context, theme));
-
- SharedPreferences prefs = Util.getPreferences(context);
- if(prefs.getBoolean(Constants.PREFERENCES_KEY_OVERRIDE_SYSTEM_LANGUAGE, false)) {
- Configuration config = new Configuration();
- config.locale = Locale.ENGLISH;
- context.getResources().updateConfiguration(config, context.getResources().getDisplayMetrics());
- }
- }
public static boolean getDisplayTrack(Context context) {
SharedPreferences prefs = getPreferences(context);