[Android] Fix selection content in videos view
Geoffrey Métais
git at videolan.org
Thu Oct 18 17:27:33 CEST 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Oct 18 17:27:16 2018 +0200| [733e2e453a697cbddd5376d49db34a95ae4f37f1] | committer: Geoffrey Métais
Fix selection content in videos view
> https://code.videolan.org/videolan/vlc-android/commit/733e2e453a697cbddd5376d49db34a95ae4f37f1
---
.../videolan/vlc/gui/video/VideoGridFragment.java | 28 +++++++++++-----------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index f434dd05e..2d74b03a9 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -22,8 +22,6 @@ package org.videolan.vlc.gui.video;
import android.annotation.TargetApi;
import android.app.Activity;
-import androidx.lifecycle.Observer;
-import androidx.lifecycle.ViewModelProviders;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -31,11 +29,6 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
-import androidx.annotation.MainThread;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.appcompat.view.ActionMode;
-import androidx.recyclerview.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
@@ -68,6 +61,14 @@ import org.videolan.vlc.viewmodels.VideosModel;
import java.util.ArrayList;
import java.util.List;
+import androidx.annotation.MainThread;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.appcompat.view.ActionMode;
+import androidx.lifecycle.Observer;
+import androidx.lifecycle.ViewModelProviders;
+import androidx.recyclerview.widget.RecyclerView;
+
public class VideoGridFragment extends MediaBrowserFragment<VideosModel> implements SwipeRefreshLayout.OnRefreshListener, IEventsHandler, Observer<List<MediaWrapper>>, CtxActionReceiver {
private final static String TAG = "VLC/VideoListFragment";
@@ -257,16 +258,15 @@ public class VideoGridFragment extends MediaBrowserFragment<VideosModel> impleme
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
- final List<MediaWrapper> list = multiSelectHelper.getSelection();
+ final List<MediaWrapper> list = new ArrayList();
+ for (MediaWrapper mw : multiSelectHelper.getSelection()) {
+ if (mw.getType() == MediaWrapper.TYPE_GROUP) list.addAll(((MediaGroup)mw).getAll());
+ else list.add(mw);
+ }
if (!list.isEmpty()) {
switch (item.getItemId()) {
case R.id.action_video_play:
- final List<MediaWrapper> videos = new ArrayList();
- for (MediaWrapper mw : list) {
- if (mw.getType() == MediaWrapper.TYPE_GROUP) videos.addAll(((MediaGroup)mw).getAll());
- else videos.add(mw);
- }
- MediaUtils.INSTANCE.openList(getActivity(), videos, 0);
+ MediaUtils.INSTANCE.openList(getActivity(), list, 0);
break;
case R.id.action_video_append:
MediaUtils.INSTANCE.appendMedia(getActivity(), list);
More information about the Android
mailing list