diff options
author | owner <owner@DeeDee-Laptop> | 2012-07-12 13:47:03 -0700 |
---|---|---|
committer | owner <owner@DeeDee-Laptop> | 2012-07-12 13:47:03 -0700 |
commit | f78f88c0ba42c8ebe5e0db1c22dc43b2a872e66d (patch) | |
tree | 5fa949d5b2e0a08bd1e3eff4ffa230b06483839f | |
parent | 816c969bb7201810f9271633a1752fcfbddd4cce (diff) | |
download | dsub-f78f88c0ba42c8ebe5e0db1c22dc43b2a872e66d.tar.gz dsub-f78f88c0ba42c8ebe5e0db1c22dc43b2a872e66d.tar.bz2 dsub-f78f88c0ba42c8ebe5e0db1c22dc43b2a872e66d.zip |
Delete Song option under Now Playing long press menu (removes from cache)
3 files changed, 14 insertions, 0 deletions
diff --git a/subsonic-android/res/menu/nowplaying_context.xml b/subsonic-android/res/menu/nowplaying_context.xml index 16fb47d7..04e56e1a 100644 --- a/subsonic-android/res/menu/nowplaying_context.xml +++ b/subsonic-android/res/menu/nowplaying_context.xml @@ -15,6 +15,11 @@ android:id="@+id/menu_remove" android:title="@string/download.menu_remove" /> + + <item + android:id="@+id/menu_delete" + android:title="@string/download.menu_delete" + /> <item android:id="@+id/menu_remove_all" diff --git a/subsonic-android/res/values/strings.xml b/subsonic-android/res/values/strings.xml index 2431bb34..9a10b0ec 100644 --- a/subsonic-android/res/values/strings.xml +++ b/subsonic-android/res/values/strings.xml @@ -86,6 +86,7 @@ <string name="download.menu_show_album">Show album</string>
<string name="download.menu_lyrics">Lyrics</string>
<string name="download.menu_remove">Remove song</string>
+ <string name="download.menu_delete">Delete song</string>
<string name="download.menu_remove_all">Remove all</string>
<string name="download.menu_screen_on">Screen on</string>
<string name="download.menu_screen_off">Screen off</string>
diff --git a/subsonic-android/src/github/daneren2005/subphonic/activity/DownloadActivity.java b/subsonic-android/src/github/daneren2005/subphonic/activity/DownloadActivity.java index 3c2d7b04..80c264f5 100644 --- a/subsonic-android/src/github/daneren2005/subphonic/activity/DownloadActivity.java +++ b/subsonic-android/src/github/daneren2005/subphonic/activity/DownloadActivity.java @@ -74,6 +74,7 @@ import github.daneren2005.subphonic.util.Util; import github.daneren2005.subphonic.view.VisualizerView; import static github.daneren2005.subphonic.domain.PlayerState.*; +import java.util.ArrayList; public class DownloadActivity extends SubsonicTabActivity implements OnGestureListener { @@ -556,6 +557,13 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi getDownloadService().remove(song); onDownloadListChanged(); return true; + case R.id.menu_delete: + getDownloadService().remove(song); + List<MusicDirectory.Entry> songs = new ArrayList<MusicDirectory.Entry>(1); + songs.add(song.getSong()); + getDownloadService().delete(songs); + onDownloadListChanged(); + return true; case R.id.menu_remove_all: getDownloadService().setShufflePlayEnabled(false); getDownloadService().clear(); |