[Android] Audio browser: add all the medias of the song panel to the playlist when the function is selected from the context menu

Adrien Maglo git at videolan.org
Thu Jan 16 17:27:57 CET 2014


vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Thu Jan 16 17:27:43 2014 +0100| [965464916dc74100b1f092b28db7c3834639112e] | committer: Adrien Maglo

Audio browser: add all the medias of the song panel to the playlist when the function is selected from the context menu

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

 .../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java   |    8 +++-----
 .../org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java    |    3 ++-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index 58dfef5..2718927 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -167,9 +167,8 @@ public class AudioBrowserFragment extends SherlockFragment {
     OnItemClickListener songListener = new OnItemClickListener() {
         @Override
         public void onItemClick(AdapterView<?> av, View v, int p, long id) {
-            ArrayList<String> songList = new ArrayList<String>();
-            int selectedId = mSongsAdapter.getListWithPosition(songList, p);
-            mAudioController.load(songList, selectedId);
+            ArrayList<String> mediaLocation = mSongsAdapter.getLocations(p);
+            mAudioController.load(mediaLocation, 0);
         }
     };
 
@@ -270,9 +269,8 @@ public class AudioBrowserFragment extends SherlockFragment {
         }
 
         if (useAllItems) {
-            startPosition = groupPosition;
-            medias = mSongsAdapter.getLocations(groupPosition);
             medias = new ArrayList<String>();
+            startPosition = mSongsAdapter.getListWithPosition(medias, groupPosition);
         }
         else {
             startPosition = 0;
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
index 70f9ec7..98c0bb1 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
@@ -22,6 +22,7 @@ package org.videolan.vlc.gui.audio;
 
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.videolan.vlc.BitmapCache;
@@ -333,7 +334,7 @@ public class AudioBrowserListAdapter extends BaseAdapter {
      * @param position Position to retrieve in to _this_ adapter.
      * @return The position of 'position' in the new single list, or 0 if not found.
      */
-    public int getListWithPosition(ArrayList<String> outputList, int position) {
+    public int getListWithPosition(List<String> outputList, int position) {
         int outputPosition = 0;
         outputList.clear();
         for(int i = 0; i < mItems.size(); i++) {



More information about the Android mailing list