aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-02-17 21:31:42 -0800
committerScott Jackson <daneren2005@gmail.com>2013-02-17 21:31:42 -0800
commit309926d441c4879eb1bcc6f50abce652a0466415 (patch)
tree7bcca4518d7f0e3b55b96a285e6013592e573981
parentfa9e77b8e90fa684e0374c8ac3237baadd38f7b6 (diff)
downloaddsub-309926d441c4879eb1bcc6f50abce652a0466415.tar.gz
dsub-309926d441c4879eb1bcc6f50abce652a0466415.tar.bz2
dsub-309926d441c4879eb1bcc6f50abce652a0466415.zip
Added fling remove option
-rw-r--r--subsonic-android/res/layout/download_playlist.xml3
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java7
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/DownloadService.java2
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java7
4 files changed, 17 insertions, 2 deletions
diff --git a/subsonic-android/res/layout/download_playlist.xml b/subsonic-android/res/layout/download_playlist.xml
index 8bd54877..d0602e8a 100644
--- a/subsonic-android/res/layout/download_playlist.xml
+++ b/subsonic-android/res/layout/download_playlist.xml
@@ -36,7 +36,8 @@
dslv:use_default_controller="true"
dslv:drag_handle_id="@id/drag_handle"
dslv:sort_enabled="true"
- dslv:remove_enabled="false"
+ dslv:remove_enabled="true"
+ dslv:remove_mode="flingRemove"
dslv:drag_start_mode="onDown"/>
</LinearLayout> \ No newline at end of file
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java
index e4578db1..195d6001 100644
--- a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java
+++ b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java
@@ -352,6 +352,13 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi
onDownloadListChanged();
}
});
+ playlistView.setRemoveListener(new DragSortListView.RemoveListener() {
+ @Override
+ public void remove(int which) {
+ getDownloadService().remove(which);
+ onDownloadListChanged();
+ }
+ });
registerForContextMenu(playlistView);
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadService.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadService.java
index c086c258..889d7d2b 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadService.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadService.java
@@ -60,6 +60,8 @@ public interface DownloadService {
void clearIncomplete();
int size();
+
+ void remove(int which);
void remove(DownloadFile downloadFile);
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
index 349252e0..2ac55f66 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
@@ -420,6 +420,11 @@ public class DownloadServiceImpl extends Service implements DownloadService {
}
updateJukeboxPlaylist();
}
+
+ @Override
+ public synchronized void remove(int which) {
+ downloadList.remove(which);
+ }
@Override
public synchronized void remove(DownloadFile downloadFile) {
@@ -983,7 +988,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
}
@Override
- public void swap(int from, int to) {
+ public synchronized void swap(int from, int to) {
int max = size();
if(to >= max) {
to = max - 1;