aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android
diff options
context:
space:
mode:
authorowner <owner@DeeDee-Laptop>2012-07-12 12:01:17 -0700
committerowner <owner@DeeDee-Laptop>2012-07-12 12:01:17 -0700
commit1b51a47f0e43403aa4d454d2775f325a2072255f (patch)
tree6a9d5bcd0cfd2606b3800d074e69fb3f50981dea /subsonic-android
parent4a0e49a915192a315e56fe25690bc9c277534311 (diff)
downloaddsub-1b51a47f0e43403aa4d454d2775f325a2072255f.tar.gz
dsub-1b51a47f0e43403aa4d454d2775f325a2072255f.tar.bz2
dsub-1b51a47f0e43403aa4d454d2775f325a2072255f.zip
Added options for size of randomized playlists
Diffstat (limited to 'subsonic-android')
-rw-r--r--subsonic-android/res/values/strings.xml2
-rw-r--r--subsonic-android/res/xml/settings.xml14
-rw-r--r--subsonic-android/src/github/daneren2005/subphonic/activity/MainActivity.java6
-rw-r--r--subsonic-android/src/github/daneren2005/subphonic/activity/SettingsActivity.java3
-rw-r--r--subsonic-android/src/github/daneren2005/subphonic/util/Constants.java1
5 files changed, 23 insertions, 3 deletions
diff --git a/subsonic-android/res/values/strings.xml b/subsonic-android/res/values/strings.xml
index 47487e43..2431bb34 100644
--- a/subsonic-android/res/values/strings.xml
+++ b/subsonic-android/res/values/strings.xml
@@ -181,6 +181,8 @@
<string name="settings.media_button_summary">Respond to phone, headset and Bluetooth media buttons</string>
<string name="settings.screen_lit_title">Keep screen on</string>
<string name="settings.screen_lit_summary">Keeping the screen on while downloading improves download speed.</string>
+ <string name="settings.playlist_title">Playlists</string>
+ <string name="settings.playlist_random_size_title">Random Size</string>
<string name="music_service.retry">A network error occurred. Retrying %1$d of %2$d.</string>
diff --git a/subsonic-android/res/xml/settings.xml b/subsonic-android/res/xml/settings.xml
index 21d0568a..daa98b90 100644
--- a/subsonic-android/res/xml/settings.xml
+++ b/subsonic-android/res/xml/settings.xml
@@ -146,8 +146,18 @@
android:entries="@array/networkTimeoutNames"/>
</PreferenceCategory>
-
- <PreferenceCategory
+
+ <PreferenceCategory
+ android:title="@string/settings.playlist_title">
+
+ <EditTextPreference
+ android:title="@string/settings.playlist_random_size_title"
+ android:key="randomSize"
+ android:defaultValue="20"
+ android:digits="0123456789"/>
+ </PreferenceCategory>
+
+ <PreferenceCategory
android:title="@string/settings.cache_title">
<EditTextPreference
diff --git a/subsonic-android/src/github/daneren2005/subphonic/activity/MainActivity.java b/subsonic-android/src/github/daneren2005/subphonic/activity/MainActivity.java
index 7ad621ef..f7b8b6e6 100644
--- a/subsonic-android/src/github/daneren2005/subphonic/activity/MainActivity.java
+++ b/subsonic-android/src/github/daneren2005/subphonic/activity/MainActivity.java
@@ -249,9 +249,13 @@ public class MainActivity extends SubsonicTabActivity {
}
private void showAlbumList(String type) {
+ // Get users desired random playlist size
+ SharedPreferences prefs = Util.getPreferences(this);
+ int size = Integer.parseInt(prefs.getString(Constants.PREFERENCES_KEY_RANDOM_SIZE, "10"));
+
Intent intent = new Intent(this, SelectAlbumActivity.class);
intent.putExtra(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TYPE, type);
- intent.putExtra(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_SIZE, 20);
+ intent.putExtra(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_SIZE, size);
intent.putExtra(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_OFFSET, 0);
Util.startActivityWithoutTransition(this, intent);
}
diff --git a/subsonic-android/src/github/daneren2005/subphonic/activity/SettingsActivity.java b/subsonic-android/src/github/daneren2005/subphonic/activity/SettingsActivity.java
index 5cc70d14..3c362f1b 100644
--- a/subsonic-android/src/github/daneren2005/subphonic/activity/SettingsActivity.java
+++ b/subsonic-android/src/github/daneren2005/subphonic/activity/SettingsActivity.java
@@ -56,6 +56,7 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
private EditTextPreference cacheSize;
private EditTextPreference cacheLocation;
private ListPreference preloadCount;
+ private EditTextPreference randomSize;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -69,6 +70,7 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
cacheSize = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_CACHE_SIZE);
cacheLocation = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_CACHE_LOCATION);
preloadCount = (ListPreference) findPreference(Constants.PREFERENCES_KEY_PRELOAD_COUNT);
+ randomSize = (EditTextPreference) findPreference(Constants.PREFERENCES_KEY_RANDOM_SIZE);
findPreference("testConnection1").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
@@ -151,6 +153,7 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
cacheSize.setSummary(cacheSize.getText());
cacheLocation.setSummary(cacheLocation.getText());
preloadCount.setSummary(preloadCount.getEntry());
+ randomSize.setSummary(randomSize.getText());
for (ServerSettings ss : serverSettings.values()) {
ss.update();
}
diff --git a/subsonic-android/src/github/daneren2005/subphonic/util/Constants.java b/subsonic-android/src/github/daneren2005/subphonic/util/Constants.java
index 532ef81f..c6cd6df6 100644
--- a/subsonic-android/src/github/daneren2005/subphonic/util/Constants.java
+++ b/subsonic-android/src/github/daneren2005/subphonic/util/Constants.java
@@ -75,6 +75,7 @@ public final class Constants {
public static final String PREFERENCES_KEY_SCROBBLE = "scrobble";
public static final String PREFERENCES_KEY_REPEAT_MODE = "repeatMode";
public static final String PREFERENCES_KEY_WIFI_REQUIRED_FOR_DOWNLOAD = "wifiRequiredForDownload";
+ public static final String PREFERENCES_KEY_RANDOM_SIZE = "randomSize";
// Name of the preferences file.
public static final String PREFERENCES_FILE_NAME = "github.daneren2005.subphonic_preferences";