[Android] MediaList: signal events
Edward Wang
git at videolan.org
Thu Jan 23 21:09:07 CET 2014
vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Thu Jan 23 15:09:01 2014 -0500| [d8391ce90038093fc33c406de6ba2cbe05c196d9] | committer: Edward Wang
MediaList: signal events
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=d8391ce90038093fc33c406de6ba2cbe05c196d9
---
vlc-android/src/org/videolan/libvlc/MediaList.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/vlc-android/src/org/videolan/libvlc/MediaList.java b/vlc-android/src/org/videolan/libvlc/MediaList.java
index f6b86b5..83162c8 100644
--- a/vlc-android/src/org/videolan/libvlc/MediaList.java
+++ b/vlc-android/src/org/videolan/libvlc/MediaList.java
@@ -146,11 +146,16 @@ public class MediaList {
throw new IndexOutOfBoundsException("Indexes out of range");
MediaHolder toMove = mInternalList.get(startPosition);
+ String l = toMove.m.getLocation();
mInternalList.remove(startPosition);
- if (startPosition >= endPosition)
+ signal_list_event(EventHandler.CustomMediaListItemDeleted, startPosition, l);
+ if(startPosition >= endPosition) {
mInternalList.add(endPosition, toMove);
- else
+ signal_list_event(EventHandler.CustomMediaListItemAdded, endPosition, l);
+ } else {
mInternalList.add(endPosition - 1, toMove);
+ signal_list_event(EventHandler.CustomMediaListItemAdded, endPosition - 1, l);
+ }
}
public void remove(int position) {
More information about the Android
mailing list