[Android] 'Play' option fpr folders

Geoffrey Métais git at videolan.org
Wed May 6 18:38:50 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed May  6 18:30:02 2015 +0200| [949a0eb0b75c5941d3d368375f2632a0fa3c7db6] | committer: Geoffrey Métais

'Play' option fpr folders

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

 vlc-android/res/menu/directory_view_dir.xml                 |    3 +++
 .../org/videolan/vlc/gui/browser/BaseBrowserFragment.java   |   11 +++++++++++
 2 files changed, 14 insertions(+)

diff --git a/vlc-android/res/menu/directory_view_dir.xml b/vlc-android/res/menu/directory_view_dir.xml
index 5faae96..9dca7ba 100644
--- a/vlc-android/res/menu/directory_view_dir.xml
+++ b/vlc-android/res/menu/directory_view_dir.xml
@@ -1,6 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <menu xmlns:android="http://schemas.android.com/apk/res/android" >
     <item
+        android:id="@+id/directory_view_play_folder"
+        android:title="@string/play" />
+    <item
         android:id="@+id/directory_view_hide_media"
         android:title="@string/directory_hide_medialib" />
     <item
diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
index f56e2e5..3495d25 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.java
@@ -34,6 +34,7 @@ import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.PopupMenu;
 import android.support.v7.widget.RecyclerView;
 import android.text.TextUtils;
+import android.util.Log;
 import android.util.SparseArray;
 import android.view.ContextMenu;
 import android.view.LayoutInflater;
@@ -57,6 +58,7 @@ import org.videolan.vlc.gui.CommonDialogs;
 import org.videolan.vlc.gui.DividerItemDecoration;
 import org.videolan.vlc.gui.MainActivity;
 import org.videolan.vlc.gui.SidebarAdapter;
+import org.videolan.vlc.gui.audio.MediaComparators;
 import org.videolan.vlc.gui.video.VideoPlayerActivity;
 import org.videolan.vlc.interfaces.IRefreshable;
 import org.videolan.vlc.util.Util;
@@ -69,6 +71,7 @@ import org.videolan.vlc.widget.SwipeRefreshLayout;
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collections;
 
 
 public abstract class BaseBrowserFragment extends MediaBrowserFragment implements IRefreshable, MediaBrowser.EventListener, SwipeRefreshLayout.OnRefreshListener {
@@ -409,6 +412,14 @@ public abstract class BaseBrowserFragment extends MediaBrowserFragment implement
             case  R.id.directory_view_play_video:
                 VideoPlayerActivity.start(getActivity(), mw.getLocation());
                 return true;
+            case R.id.directory_view_play_folder:
+                ArrayList<MediaWrapper> mediaList = new ArrayList<>();
+                for (MediaWrapper mediaItem : mMediaLists.get(position)){
+                    if (mediaItem.getType() == MediaWrapper.TYPE_AUDIO || mediaItem.getType() == MediaWrapper.TYPE_VIDEO)
+                        mediaList.add(mediaItem);
+                }
+                Util.openList(getActivity(), mediaList, 0);
+                return true;
             case R.id.directory_view_hide_media:
                 try {
                     new File(mw.getLocation()+"/.nomedia").createNewFile();



More information about the Android mailing list