[Android] Move list events to CustomMediaListItem*
Edward Wang
git at videolan.org
Tue Dec 3 21:50:14 CET 2013
vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Tue Dec 3 15:49:59 2013 -0500| [01d952c2b67421071487dc1f28b895cbb1429562] | committer: Edward Wang
Move list events to CustomMediaListItem*
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=01d952c2b67421071487dc1f28b895cbb1429562
---
vlc-android/src/org/videolan/libvlc/EventHandler.java | 6 ++++--
vlc-android/src/org/videolan/libvlc/MediaList.java | 8 ++++----
vlc-android/src/org/videolan/vlc/AudioService.java | 8 ++++----
vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java | 4 ++--
4 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/vlc-android/src/org/videolan/libvlc/EventHandler.java b/vlc-android/src/org/videolan/libvlc/EventHandler.java
index 82d8e7a..6abc4b8 100644
--- a/vlc-android/src/org/videolan/libvlc/EventHandler.java
+++ b/vlc-android/src/org/videolan/libvlc/EventHandler.java
@@ -59,9 +59,9 @@ public class EventHandler {
//public static final int MediaPlayerLengthChanged = 0x111;
public static final int MediaPlayerVout = 0x112;
- public static final int MediaListItemAdded = 0x200;
+ //public static final int MediaListItemAdded = 0x200;
//public static final int MediaListWillAddItem = 0x201;
- public static final int MediaListItemDeleted = 0x202;
+ //public static final int MediaListItemDeleted = 0x202;
//public static final int MediaListWillDeleteItem = 0x203;
//public static final int MediaListViewItemAdded = 0x300;
@@ -90,6 +90,8 @@ public class EventHandler {
public static final int CustomMediaListExpanding = 0x2000;
public static final int CustomMediaListExpandingEnd = 0x2001;
+ public static final int CustomMediaListItemAdded = 0x2002;
+ public static final int CustomMediaListItemDeleted = 0x2003;
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 43f00b9..32e97a3 100644
--- a/vlc-android/src/org/videolan/libvlc/MediaList.java
+++ b/vlc-android/src/org/videolan/libvlc/MediaList.java
@@ -76,7 +76,7 @@ public class MediaList {
}
public void add(Media media, boolean noVideo, boolean noOmx) {
mInternalList.add(new MediaHolder(media, noVideo, noOmx));
- signal_list_event(EventHandler.MediaListItemAdded, mInternalList.size() - 1, media.getLocation());
+ signal_list_event(EventHandler.CustomMediaListItemAdded, mInternalList.size() - 1, media.getLocation());
}
/**
@@ -85,7 +85,7 @@ public class MediaList {
public void clear() {
// Signal to observers of media being deleted.
for(int i = 0; i < mInternalList.size(); i++) {
- signal_list_event(EventHandler.MediaListItemDeleted, i, mInternalList.get(i).m.getLocation());
+ signal_list_event(EventHandler.CustomMediaListItemDeleted, i, mInternalList.get(i).m.getLocation());
}
mInternalList.clear();
}
@@ -132,7 +132,7 @@ public class MediaList {
}
public void insert(int position, Media media) {
mInternalList.add(position, new MediaHolder(media));
- signal_list_event(EventHandler.MediaListItemAdded, position, media.getLocation());
+ signal_list_event(EventHandler.CustomMediaListItemAdded, position, media.getLocation());
}
public void remove(int position) {
@@ -140,7 +140,7 @@ public class MediaList {
return;
String uri = mInternalList.get(position).m.getLocation();
mInternalList.remove(position);
- signal_list_event(EventHandler.MediaListItemDeleted, position, uri);
+ signal_list_event(EventHandler.CustomMediaListItemDeleted, position, uri);
}
public int size() {
diff --git a/vlc-android/src/org/videolan/vlc/AudioService.java b/vlc-android/src/org/videolan/vlc/AudioService.java
index 1775fd7..b6677c3 100644
--- a/vlc-android/src/org/videolan/vlc/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/AudioService.java
@@ -472,14 +472,14 @@ public class AudioService extends Service {
int index;
switch (msg.getData().getInt("event")) {
- case EventHandler.MediaListItemAdded:
- Log.i(TAG, "MediaListItemAdded");
+ case EventHandler.CustomMediaListItemAdded:
+ Log.i(TAG, "CustomMediaListItemAdded");
index = msg.getData().getInt("item_index");
if(service.mCurrentIndex >= index && !expanding)
service.mCurrentIndex++;
break;
- case EventHandler.MediaListItemDeleted:
- Log.i(TAG, "MediaListItemDeleted");
+ case EventHandler.CustomMediaListItemDeleted:
+ Log.i(TAG, "CustomMediaListItemDeleted");
index = msg.getData().getInt("item_index");
if(service.mCurrentIndex >= index && !expanding)
service.mCurrentIndex--;
diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java b/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
index e0a9b5b..5e388ba 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
@@ -143,10 +143,10 @@ public class HistoryAdapter extends BaseAdapter {
String item_uri = msg.getData().getString("item_uri");
int item_index = msg.getData().getInt("item_index");
switch (msg.getData().getInt("event")) {
- case EventHandler.MediaListItemAdded:
+ case EventHandler.CustomMediaListItemAdded:
adapater.updateEvent(true, item_uri, item_index);
break;
- case EventHandler.MediaListItemDeleted:
+ case EventHandler.CustomMediaListItemDeleted:
adapater.updateEvent(false, item_uri, item_index);
break;
}
More information about the Android
mailing list