aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/github/daneren2005/dsub/util/Util.java
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-09-09 08:38:24 -0700
committerScott Jackson <daneren2005@gmail.com>2015-09-09 08:38:24 -0700
commita3e6a41d34715b45d50c5a47d9f431140857d30d (patch)
treefd108b1d83e2f8237e96019c2db11b6fda831567 /app/src/main/java/github/daneren2005/dsub/util/Util.java
parent53a8678ddf44cbcbfe7e411ee434a244ffb80689 (diff)
downloaddsub-a3e6a41d34715b45d50c5a47d9f431140857d30d.tar.gz
dsub-a3e6a41d34715b45d50c5a47d9f431140857d30d.tar.bz2
dsub-a3e6a41d34715b45d50c5a47d9f431140857d30d.zip
Make colored action bar/status bar optional
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.java29
1 files changed, 22 insertions, 7 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 ec73afa7..24895226 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/Util.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/Util.java
@@ -19,6 +19,7 @@ package github.daneren2005.dsub.util;
import android.annotation.TargetApi;
import android.app.Activity;
+import android.graphics.Color;
import android.support.annotation.StringRes;
import android.support.v7.app.AlertDialog;
import android.content.ComponentName;
@@ -46,6 +47,8 @@ import android.text.util.Linkify;
import android.util.Log;
import android.util.SparseArray;
import android.view.Gravity;
+import android.view.Window;
+import android.view.WindowManager;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
@@ -271,14 +274,26 @@ public final class Util {
}
public static int getThemeRes(Context context, String theme) {
if(context instanceof SubsonicFragmentActivity || context instanceof SettingsActivity) {
- 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;
+ 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 {
- return R.style.Theme_DSub_Light_No_Actionbar;
+ 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)) {