I have a list of records in a listview that I want the user to be able to re-sort using a drag and drop method. I have seen this implemented in other apps, but I have not found a tutorial for it. It must be something that others need as well. Can anyone point me to some code for doing this?
+7
A:
You're in luck -- I just released some code for this earlier today. It is based off of the drag-and-drop stuff used by the Music app for playlists.
CommonsWare
2010-05-25 23:59:06
@Mark: Thank you very much!
Samuh
2010-05-26 08:54:13
@Commonsware: in which music app is that been used? The standard Android one? I'm looking for the same right now and wanted to see it in action first. But I cannot find anything to drag in the playlist of the default music app as on the Nexus One for example. Long-press only opens the context menu.Thanks!
Mathias Lin
2010-08-15 06:18:10
@Mathias Lin: Yes, that code is from the standard AOSP music app. Search the source code for `TouchDelegate`.
CommonsWare
2010-08-15 06:27:11
@CommonsWare: yes, I found the code already, thanks. But where I can see it in action in the music app? Or is it not in 2.x anymore?
Mathias Lin
2010-08-15 06:34:09
Ok, just found it on my G1 1.6... didn't see it on the N1 for podcast playlists (where I looked into first only), for music playlists it's there.. seeing it now :) thanks
Mathias Lin
2010-08-15 06:44:30
A:
It may also be helpful to reference my simple Drag and Drop list. You can find it here
ericharlow
2010-10-29 20:50:42