aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2012-07-07 09:56:40 -0700
committerScott Jackson <daneren2005@gmail.com>2012-07-07 09:56:40 -0700
commit09d9a8e128640ebea9943824df9274ddb1dda71e (patch)
tree8c093204f55aba933f7947f2a6ed208c2d7a2ca4
parent62e662803c2c59bffb60d43695821ab7af980487 (diff)
downloaddsub-09d9a8e128640ebea9943824df9274ddb1dda71e.tar.gz
dsub-09d9a8e128640ebea9943824df9274ddb1dda71e.tar.bz2
dsub-09d9a8e128640ebea9943824df9274ddb1dda71e.zip
User defined cache size
-rw-r--r--subsonic-android/res/values/strings.xml2
-rw-r--r--subsonic-android/res/xml/settings.xml5
-rw-r--r--subsonic-android/src/github/daneren2005/subphonic/activity/SettingsActivity.java6
3 files changed, 6 insertions, 7 deletions
diff --git a/subsonic-android/res/values/strings.xml b/subsonic-android/res/values/strings.xml
index 2a067124..a31ada89 100644
--- a/subsonic-android/res/values/strings.xml
+++ b/subsonic-android/res/values/strings.xml
@@ -127,7 +127,7 @@
<string name="settings.server_password">Password</string>
<string name="settings.cache_title">Music cache</string>
<string name="settings.preload">Songs to preload</string>
- <string name="settings.cache_size">Cache size</string>
+ <string name="settings.cache_size">Cache size (MB)</string>
<string name="settings.cache_location">Cache location</string>
<string name="settings.cache_location_error">Invalid cache location. Using default.</string>
<string name="settings.testing_connection">Testing connection...</string>
diff --git a/subsonic-android/res/xml/settings.xml b/subsonic-android/res/xml/settings.xml
index 427826ac..4e4cd7dd 100644
--- a/subsonic-android/res/xml/settings.xml
+++ b/subsonic-android/res/xml/settings.xml
@@ -143,12 +143,11 @@
<PreferenceCategory
android:title="@string/settings.cache_title">
- <ListPreference
+ <EditTextPreference
android:title="@string/settings.cache_size"
android:key="cacheSize"
android:defaultValue="500"
- android:entryValues="@array/cacheSizeValues"
- android:entries="@array/cacheSizeNames"/>
+ android:digits="0123456789"/>
<EditTextPreference
android:title="@string/settings.cache_location"
diff --git a/subsonic-android/src/github/daneren2005/subphonic/activity/SettingsActivity.java b/subsonic-android/src/github/daneren2005/subphonic/activity/SettingsActivity.java
index 5eb32b62..bb8fdd35 100644
--- a/subsonic-android/src/github/daneren2005/subphonic/activity/SettingsActivity.java
+++ b/subsonic-android/src/github/daneren2005/subphonic/activity/SettingsActivity.java
@@ -52,7 +52,7 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
private ListPreference theme;
private ListPreference maxBitrateWifi;
private ListPreference maxBitrateMobile;
- private ListPreference cacheSize;
+ private EditTextPreference cacheSize;
private EditTextPreference cacheLocation;
private ListPreference preloadCount;
@@ -64,7 +64,7 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
theme = (ListPreference) findPreference(Constants.PREFERENCES_KEY_THEME);
maxBitrateWifi = (ListPreference) findPreference(Constants.PREFERENCES_KEY_MAX_BITRATE_WIFI);
maxBitrateMobile = (ListPreference) findPreference(Constants.PREFERENCES_KEY_MAX_BITRATE_MOBILE);
- cacheSize = (ListPreference) findPreference(Constants.PREFERENCES_KEY_CACHE_SIZE);
+ cacheSize = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_CACHE_SIZE);
cacheLocation = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_CACHE_LOCATION);
preloadCount = (ListPreference) findPreference(Constants.PREFERENCES_KEY_PRELOAD_COUNT);
@@ -145,7 +145,7 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
theme.setSummary(theme.getEntry());
maxBitrateWifi.setSummary(maxBitrateWifi.getEntry());
maxBitrateMobile.setSummary(maxBitrateMobile.getEntry());
- cacheSize.setSummary(cacheSize.getEntry());
+ cacheSize.setSummary(cacheSize.getText());
cacheLocation.setSummary(cacheLocation.getText());
preloadCount.setSummary(preloadCount.getEntry());
for (ServerSettings ss : serverSettings.values()) {