[Android] Audio player: allow to move an item at the end of the playlist

Adrien Maglo git at videolan.org
Fri Jan 24 14:04:48 CET 2014


vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Fri Jan 24 14:04:41 2014 +0100| [c7c6e644ce0b7f9c411218480f622126ee83b0eb] | committer: Adrien Maglo

Audio player: allow to move an item at the end of the playlist

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=c7c6e644ce0b7f9c411218480f622126ee83b0eb
---

 vlc-android/src/org/videolan/vlc/gui/audio/AudioPlaylistView.java |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlaylistView.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlaylistView.java
index 35262f4..5b341ee 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlaylistView.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlaylistView.java
@@ -173,6 +173,7 @@ public class AudioPlaylistView extends ListView {
 
         // Find the child view that was touched (perform a hit test)
         Rect rect = new Rect();
+        boolean b_foundHitChild =  false;
         for (int i = 0; i < getChildCount(); i++) {
             View child = getChildAt(i);
             child.getHitRect(rect);
@@ -181,9 +182,12 @@ public class AudioPlaylistView extends ListView {
                 AudioListAdapter.ViewHolder holder = (AudioListAdapter.ViewHolder)child.getTag();
                 if (mOnItemDraggedListener != null)
                     mOnItemDraggedListener.OnItemDradded(mPositionDragStart, holder.position);
+                b_foundHitChild = true;
                 break;
             }
         }
+        if (!b_foundHitChild)
+            mOnItemDraggedListener.OnItemDradded(mPositionDragStart, this.getCount());
     }
 
     public void dragAborted() {



More information about the Android mailing list