[Android] EventHandler: add CustomMediaListItemMoved

Edward Wang git at videolan.org
Thu Jan 23 23:00:59 CET 2014


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Thu Jan 23 16:59:13 2014 -0500| [b6f950442cfbaf70db2fe2d06185d13def92da54] | committer: Edward Wang

EventHandler: add CustomMediaListItemMoved

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

 vlc-android/src/org/videolan/libvlc/EventHandler.java |    3 ++-
 vlc-android/src/org/videolan/libvlc/MediaList.java    |    4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/libvlc/EventHandler.java b/vlc-android/src/org/videolan/libvlc/EventHandler.java
index 6abc4b8..b68caa2 100644
--- a/vlc-android/src/org/videolan/libvlc/EventHandler.java
+++ b/vlc-android/src/org/videolan/libvlc/EventHandler.java
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * EventHandler.java
  *****************************************************************************
- * Copyright © 2011-2012 VLC authors and VideoLAN
+ * Copyright © 2011-2014 VLC authors and VideoLAN
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published by
@@ -92,6 +92,7 @@ public class EventHandler {
     public static final int CustomMediaListExpandingEnd       = 0x2001;
     public static final int CustomMediaListItemAdded          = 0x2002;
     public static final int CustomMediaListItemDeleted        = 0x2003;
+    public static final int CustomMediaListItemMoved          = 0x2004;
 
     private ArrayList<Handler> mEventHandler;
     private static EventHandler mInstance;
diff --git a/vlc-android/src/org/videolan/libvlc/MediaList.java b/vlc-android/src/org/videolan/libvlc/MediaList.java
index f6b86b5..20b47b3 100644
--- a/vlc-android/src/org/videolan/libvlc/MediaList.java
+++ b/vlc-android/src/org/videolan/libvlc/MediaList.java
@@ -151,6 +151,10 @@ public class MediaList {
             mInternalList.add(endPosition, toMove);
         else
             mInternalList.add(endPosition - 1, toMove);
+        Bundle b = new Bundle();
+        b.putInt("index_before", startPosition);
+        b.putInt("index_after", endPosition);
+        mEventHandler.callback(EventHandler.CustomMediaListItemMoved, b);
     }
 
     public void remove(int position) {



More information about the Android mailing list