aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-05-20 22:38:07 -0700
committerScott Jackson <daneren2005@gmail.com>2013-05-20 22:38:07 -0700
commite0f4fe41d82dd85cadb3b8cd3ec66a38eb502205 (patch)
treef90f250bde19c73c524b6a55d60845c4b89d3af1
parentfe4097946e733bf16647802019e78d0cd8f282d1 (diff)
downloaddsub-e0f4fe41d82dd85cadb3b8cd3ec66a38eb502205.tar.gz
dsub-e0f4fe41d82dd85cadb3b8cd3ec66a38eb502205.tar.bz2
dsub-e0f4fe41d82dd85cadb3b8cd3ec66a38eb502205.zip
Added themeing to settings activity
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/SettingsActivity.java27
1 files changed, 23 insertions, 4 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SettingsActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SettingsActivity.java
index 57125047..1996173f 100644
--- a/subsonic-android/src/github/daneren2005/dsub/activity/SettingsActivity.java
+++ b/subsonic-android/src/github/daneren2005/dsub/activity/SettingsActivity.java
@@ -48,7 +48,6 @@ import java.util.LinkedHashMap;
import java.util.Map;
public class SettingsActivity extends PreferenceActivity implements SharedPreferences.OnSharedPreferenceChangeListener {
-
private static final String TAG = SettingsActivity.class.getSimpleName();
private final Map<String, ServerSettings> serverSettings = new LinkedHashMap<String, ServerSettings>();
private boolean testingConnection;
@@ -67,12 +66,13 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
private EditTextPreference bufferLength;
private Preference addServerPreference;
private PreferenceCategory serversCategory;
- private int serverCount = 3;
+ private int serverCount = 3;
private SharedPreferences settings;
@Override
public void onCreate(Bundle savedInstanceState) {
+ applyTheme();
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.settings);
@@ -139,8 +139,8 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
update();
}
-
- @Override
+
+ @Override
protected void onDestroy() {
super.onDestroy();
@@ -283,6 +283,25 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
return screen;
}
+
+ private void applyTheme() {
+ String activeTheme = Util.getTheme(this);
+ if ("dark".equals(activeTheme)) {
+ setTheme(R.style.Theme_DSub_Dark);
+ } else if ("light".equals(activeTheme)) {
+ setTheme(R.style.Theme_DSub_Light);
+ } else if ("dark_fullscreen".equals(activeTheme)) {
+ setTheme(R.style.Theme_DSub_Dark_Fullscreen);
+ } else if ("light_fullscreen".equals(activeTheme)) {
+ setTheme(R.style.Theme_DSub_Light_Fullscreen);
+ } else if("holo".equals(activeTheme)) {
+ setTheme(R.style.Theme_DSub_Holo);
+ } else if("holo_fullscreen".equals(activeTheme)) {
+ setTheme(R.style.Theme_DSub_Holo_Fullscreen);
+ }else {
+ setTheme(R.style.Theme_DSub_Holo);
+ }
+ }
private void setHideMedia(boolean hide) {
File nomediaDir = new File(FileUtil.getSubsonicDirectory(), ".nomedia");