diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-04-14 18:24:35 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-04-14 18:24:35 -0700 |
commit | 7c29438f0ab44d1d7bad478334635758b93b0d3c (patch) | |
tree | 57e8c8a863d45fda9bdcbc7ffa190a8dfa00ee46 | |
parent | fc20c13e81a7194c372a9f3bc598840776bcbbf3 (diff) | |
download | dsub-7c29438f0ab44d1d7bad478334635758b93b0d3c.tar.gz dsub-7c29438f0ab44d1d7bad478334635758b93b0d3c.tar.bz2 dsub-7c29438f0ab44d1d7bad478334635758b93b0d3c.zip |
#310 Add option to have play now play everything after that spot
-rw-r--r-- | res/values/strings.xml | 3 | ||||
-rw-r--r-- | res/xml/settings.xml | 12 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 16 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/util/Constants.java | 1 |
4 files changed, 31 insertions, 1 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index dbb08ee0..d0df0d24 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -399,6 +399,9 @@ <string name="settings.browse_by_tags_summary">Browse by tags instead of by folder structure. Requires Subsonic 4.7+</string>
<string name="settings.override_system_language">Override System Language</string>
<string name="settings.override_system_language_summary">Display app in english even if the system language is something DSub has a translation for. May need to clear the app from memory for changes to take affect.</string>
+ <string name="settings.drawer_items_title">Drawer Items</string>
+ <string name="settings.play_now_after">Play Now - After</string>
+ <string name="settings.play_now_after_summary">Play Now context menu for a song plays everything after selected item (like the Subsonic web GUI)</string>
<string name="shuffle.title">Shuffle By</string>
<string name="shuffle.startYear">Start Year:</string>
diff --git a/res/xml/settings.xml b/res/xml/settings.xml index 55f06598..734621b5 100644 --- a/res/xml/settings.xml +++ b/res/xml/settings.xml @@ -115,7 +115,7 @@ </PreferenceCategory> <PreferenceCategory - android:title="@string/settings.other_title"> + android:title="@string/settings.drawer_items_title"> <CheckBoxPreference android:title="@string/settings.podcasts_enabled" @@ -135,6 +135,16 @@ android:key="sharedEnabled" android:defaultValue="true"/> </PreferenceCategory> + + <PreferenceCategory + android:title="@string/settings.other_title"> + + <CheckBoxPreference + android:title="@string/settings.play_now_after" + android:summary="@string/settings.play_now_after_summary" + android:key="playNowAfter" + android:defaultValue="false"/> + </PreferenceCategory> </PreferenceScreen> <PreferenceScreen diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index edfff31e..c8937ea7 100644 --- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -20,11 +20,13 @@ import android.widget.ListView; import android.widget.TextView;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.domain.MusicDirectory;
+import github.daneren2005.dsub.domain.MusicFolder;
import github.daneren2005.dsub.domain.Share;
import github.daneren2005.dsub.util.ImageLoader;
import github.daneren2005.dsub.view.EntryAdapter;
import java.io.Serializable;
+import java.util.Iterator;
import java.util.List;
import com.mobeta.android.dslv.*;
import github.daneren2005.dsub.activity.DownloadActivity;
@@ -297,6 +299,20 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuItem.getMenuInfo();
Object selectedItem = entries.get(showHeader ? (info.position - 1) : info.position);
+
+ if(Util.getPreferences(context).getBoolean(Constants.PREFERENCES_KEY_PLAY_NOW_AFTER, false) && menuItem.getItemId() == R.id.song_menu_play_now) {
+ List<MusicDirectory.Entry> songs = new ArrayList<MusicDirectory.Entry>();
+ Iterator it = entries.listIterator(info.position - 1);
+ while(it.hasNext()) {
+ songs.add((MusicDirectory.Entry) it.next());
+ }
+
+ getDownloadService().clear();
+ getDownloadService().download(songs, false, true, true, false);
+ Util.startActivityWithoutTransition(context, DownloadActivity.class);
+
+ return true;
+ }
if(onContextItemSelected(menuItem, selectedItem)) {
return true;
diff --git a/src/github/daneren2005/dsub/util/Constants.java b/src/github/daneren2005/dsub/util/Constants.java index 0eef1c94..874579a5 100644 --- a/src/github/daneren2005/dsub/util/Constants.java +++ b/src/github/daneren2005/dsub/util/Constants.java @@ -138,6 +138,7 @@ public final class Constants { public static final String PREFERENCES_KEY_BROWSE_TAGS = "browseTags"; public static final String PREFERENCES_KEY_OPEN_TO_LIBRARY = "openToLibrary"; public static final String PREFERENCES_KEY_OVERRIDE_SYSTEM_LANGUAGE = "overrideSystemLanguage"; + public static final String PREFERENCES_KEY_PLAY_NOW_AFTER = "playNowAfter"; public static final String OFFLINE_SCROBBLE_COUNT = "scrobbleCount"; public static final String OFFLINE_SCROBBLE_ID = "scrobbleID"; |