aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src/github/daneren2005/subphonic/activity
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/src/github/daneren2005/subphonic/activity
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/src/github/daneren2005/subphonic/activity')
-rw-r--r--subsonic-android/src/github/daneren2005/subphonic/activity/MainActivity.java6
-rw-r--r--subsonic-android/src/github/daneren2005/subphonic/activity/SettingsActivity.java3
2 files changed, 8 insertions, 1 deletions
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();
}