Commit 949a0eb0 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

'Play' option fpr folders

parent eb77f4aa
<?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" />
......
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment