Commit 5be0737a authored by Geoffrey Métais's avatar Geoffrey Métais

Action mode integration

parent 4fb2b14d
......@@ -49,7 +49,7 @@
android:longClickable="true"
android:clickable="true"
android:focusable="true"
android:onClick="@{holder::onClick}">
android:onClick="@{(view) -> holder.onClick(view, media)}" >
<!-- Image loading is handled by org.videolan.vlc.gui.helpers.AsyncImageLoader.loadPicture() -->
<ImageView
android:id="@+id/ml_item_thumbnail"
......
......@@ -44,7 +44,7 @@
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:onClick="@{holder::onClick}"
android:onClick="@{(view) -> holder.onClick(view, media)}"
android:longClickable="true" >
<!-- Image loading is handled by org.videolan.vlc.gui.helpers.AsyncImageLoader.loadPicture() -->
<ImageView
......
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_mode_audio_play"
android:title="@string/play"
android:icon="@drawable/ic_play_w"/>
<item
android:id="@+id/action_mode_audio_append"
android:title="@string/append"
android:icon="@drawable/ic_next_w"/>
<item
android:id="@+id/action_mode_audio_info"
android:title="@string/info"
android:icon="@drawable/ic_info_outline_white"/>
<item
android:id="@+id/action_mode_audio_add_playlist"
android:title="@string/add_to_playlist"
android:icon="@drawable/ic_playlist_add_white"/>
<item
android:id="@+id/action_mode_audio_delete"
android:title="@string/delete"
android:icon="@drawable/ic_trash_normal_w"
android:visible="false" />
<group android:id="@+id/phone_only" >
<item
android:id="@+id/action_mode_audio_set_song"
android:title="@string/set_song"
android:icon="@drawable/ic_music_note_white"
android:visible="false" />
</group>
</menu>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_mode_file_play"
android:title="@string/play_all"
android:icon="@drawable/ic_play_w"/>
<item
android:id="@+id/action_mode_file_append"
android:title="@string/append"
android:icon="@drawable/ic_next_w"/>
<item
android:id="@+id/action_mode_file_delete"
android:title="@string/delete"
android:visible="false"
android:icon="@drawable/ic_trash_normal_w"/>
<item
android:id="@+id/action_mode_file_info"
android:title="@string/info"
android:visible="false"
android:icon="@drawable/ic_info_outline_white"/>
<item
android:id="@+id/action_mode_file_add_playlist"
android:title="@string/add_to_playlist"
android:icon="@drawable/ic_playlist_add_white"/>
<item
android:id="@+id/action_mode_file_subtitles_download"
android:title="@string/download_subtitles"
android:visible="false"
android:icon="@drawable/ic_subtitledelay_normal_w"/>
</menu>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_video_play"
android:title="@string/play"
android:icon="@drawable/ic_play_w" />
<item
android:id="@+id/action_video_append"
android:title="@string/append"
android:icon="@drawable/ic_next_w" />
<item
android:id="@+id/action_video_play_audio"
android:title="@string/play_as_audio"
android:icon="@drawable/ic_playasaudio_on_normal_w"/>
<item
android:id="@+id/action_video_info"
android:visible="false"
android:title="@string/info"
android:icon="@drawable/ic_info_outline_white"/>
<item
android:id="@+id/action_video_delete"
android:title="@string/delete"
android:icon="@drawable/ic_trash_normal_w"/>
<item
android:id="@+id/action_video_download_subtitles"
android:title="@string/download_subtitles"
android:icon="@drawable/ic_subtitledelay_normal_w"/>
</menu>
\ No newline at end of file
......@@ -20,6 +20,8 @@
<item name="colorPrimary">@color/orange800</item>
<item name="colorPrimaryDark">@color/orange700</item>
<item name="colorAccent">@color/orange500</item>
<item name="windowActionModeOverlay">true</item>
<item name="actionModeBackground">@color/orange500</item>
<item name="item_footer">@color/grey300</item>
<item name="background_default">@color/grey50</item>
<item name="background_default_darker">@color/grey100</item>
......
......@@ -24,9 +24,12 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v7.view.ActionMode;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
......@@ -151,4 +154,19 @@ public class HistoryFragment extends MediaBrowserFragment implements IRefreshabl
mHistoryAdapter.clear();
updateEmptyView();
}
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
return false;
}
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
return false;
}
@Override
public void onDestroyActionMode(ActionMode mode) {
}
}
......@@ -39,6 +39,7 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.internal.NavigationMenuView;
import android.support.design.widget.NavigationView;
import android.support.v4.app.Fragment;
......@@ -47,6 +48,7 @@ import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.GravityCompat;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.view.ActionMode;
import android.support.v7.widget.SearchView;
import android.text.TextUtils;
import android.view.KeyEvent;
......@@ -513,6 +515,13 @@ public class MainActivity extends AudioPlayerContainerActivity implements Device
slideDownAudioPlayer();
}
@Nullable
@Override
public ActionMode startSupportActionMode(@NonNull ActionMode.Callback callback) {
mAppBarLayout.setExpanded(true);
return super.startSupportActionMode(callback);
}
/** Create menu from XML
*/
@Override
......
......@@ -26,7 +26,6 @@ package org.videolan.vlc.gui.audio;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.BottomSheetDialogFragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
......@@ -44,8 +43,6 @@ import org.videolan.medialibrary.media.MediaLibraryItem;
import org.videolan.medialibrary.media.MediaWrapper;
import org.videolan.vlc.R;
import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.gui.MediaInfoDialog;
import org.videolan.vlc.gui.browser.MediaBrowserFragment;
import org.videolan.vlc.gui.dialogs.SavePlaylistDialog;
import org.videolan.vlc.gui.helpers.AudioUtil;
import org.videolan.vlc.gui.helpers.UiTools;
......@@ -55,7 +52,7 @@ import org.videolan.vlc.util.FileUtils;
import java.util.ArrayList;
public class AudioAlbumFragment extends MediaBrowserFragment implements View.OnClickListener, AudioBrowserAdapter.ClickHandler {
public class AudioAlbumFragment extends BaseAudioBrowser implements View.OnClickListener, AudioBrowserAdapter.EventsHandler {
public final static String TAG = "VLC/AudioAlbumFragment";
......@@ -76,19 +73,11 @@ public class AudioAlbumFragment extends MediaBrowserFragment implements View.OnC
mAdapter = new AudioBrowserAdapter(getActivity(), this, false);
}
@Override
protected void inflate(Menu menu, int position) {
getActivity().getMenuInflater().inflate(R.menu.audio_list_browser, menu);
}
@Override
protected String getTitle() {
return mAlbum.getTitle();
}
@Override
public void onRefresh() {}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
......@@ -169,11 +158,7 @@ public class AudioAlbumFragment extends MediaBrowserFragment implements View.OnC
});
return true;
} else if (id == R.id.audio_view_info) {
BottomSheetDialogFragment bottomSheetDialogFragment = new MediaInfoDialog();
Bundle args = new Bundle();
args.putParcelable(MediaInfoDialog.ITEM_KEY, media);
bottomSheetDialogFragment.setArguments(args);
bottomSheetDialogFragment.show(getFragmentManager(), bottomSheetDialogFragment.getTag());
showInfoDialog(media);
return true;
} else if (id == R.id.audio_view_add_playlist) {
ArrayList<MediaWrapper> medias = new ArrayList<>();
......@@ -217,4 +202,9 @@ public class AudioAlbumFragment extends MediaBrowserFragment implements View.OnC
public void onCtxClick(View anchor, final int position, final MediaLibraryItem mediaItem) {
((ContextMenuRecyclerView) getView().findViewById(R.id.songs)).openContextMenu(position);
}
@Override
protected AudioBrowserAdapter getCurrentAdapter() {
return mAdapter;
}
}
......@@ -24,7 +24,6 @@ import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.support.design.widget.BottomSheetDialogFragment;
import android.support.design.widget.TabLayout;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewPager;
......@@ -45,9 +44,7 @@ import org.videolan.medialibrary.media.MediaLibraryItem;
import org.videolan.medialibrary.media.MediaWrapper;
import org.videolan.vlc.R;
import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.gui.MediaInfoDialog;
import org.videolan.vlc.gui.SecondaryActivity;
import org.videolan.vlc.gui.browser.MediaBrowserFragment;
import org.videolan.vlc.gui.dialogs.SavePlaylistDialog;
import org.videolan.vlc.gui.helpers.AudioUtil;
import org.videolan.vlc.gui.helpers.UiTools;
......@@ -62,7 +59,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class AudioAlbumsSongsFragment extends MediaBrowserFragment implements SwipeRefreshLayout.OnRefreshListener, AudioBrowserAdapter.ClickHandler, TabLayout.OnTabSelectedListener {
public class AudioAlbumsSongsFragment extends BaseAudioBrowser implements SwipeRefreshLayout.OnRefreshListener, AudioBrowserAdapter.EventsHandler, TabLayout.OnTabSelectedListener {
private final static String TAG = "VLC/AudioAlbumsSongsFragment";
......@@ -79,9 +76,9 @@ public class AudioAlbumsSongsFragment extends MediaBrowserFragment implements Sw
private AudioBrowserAdapter mAlbumsAdapter;
private FastScroller mFastScroller;
public final static int MODE_ALBUM = 0;
public final static int MODE_SONG = 1;
public final static int MODE_TOTAL = 2; // Number of audio browser modes
private final static int MODE_ALBUM = 0;
private final static int MODE_SONG = 1;
private final static int MODE_TOTAL = 2; // Number of audio browser modes
private MediaLibraryItem mItem;
......@@ -212,11 +209,7 @@ public class AudioAlbumsSongsFragment extends MediaBrowserFragment implements Sw
}
if (id == R.id.audio_view_info) {
BottomSheetDialogFragment bottomSheetDialogFragment = new MediaInfoDialog();
Bundle args = new Bundle();
args.putParcelable(MediaInfoDialog.ITEM_KEY, mediaItem);
bottomSheetDialogFragment.setArguments(args);
bottomSheetDialogFragment.show(getFragmentManager(), bottomSheetDialogFragment.getTag());
showInfoDialog((MediaWrapper) mediaItem);
return true;
}
......@@ -320,22 +313,30 @@ public class AudioAlbumsSongsFragment extends MediaBrowserFragment implements Sw
((ContextMenuRecyclerView)mLists.get(mViewPager.getCurrentItem())).openContextMenu(position);
}
protected void inflate(Menu menu, int position) {
if (getActivity() == null)
return;
getActivity().getMenuInflater().inflate(R.menu.audio_list_browser, menu);
}
@Override
public void onTabSelected(TabLayout.Tab tab) {
mFastScroller.setRecyclerView((RecyclerView) mLists.get(tab.getPosition()));
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {}
public void onTabUnselected(TabLayout.Tab tab) {
stopActionMode();
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
((RecyclerView)mLists.get(tab.getPosition())).smoothScrollToPosition(0);
}
protected AudioBrowserAdapter getCurrentAdapter() {
return (AudioBrowserAdapter) (getCurrentRV()).getAdapter();
}
private ContextMenuRecyclerView getCurrentRV() {
return (ContextMenuRecyclerView)mLists.get(mViewPager.getCurrentItem());
}
protected boolean songModeSelected() {
return mViewPager.getCurrentItem() == MODE_SONG;
}
}
......@@ -23,28 +23,32 @@ import org.videolan.vlc.util.MediaItemFilter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
public class AudioBrowserAdapter extends RecyclerView.Adapter<AudioBrowserAdapter.ViewHolder> implements FastScroller.SeparatedAdapter, Filterable {
private static final String TAG = "VLC/AudioBrowserAdapter";
private boolean mMakeSections = true;
private boolean mMakeSections = true, mActionMode;
public interface ClickHandler {
public interface EventsHandler {
void onClick(View v, int position, MediaLibraryItem item);
void onCtxClick(View v, int position, MediaLibraryItem item);
void startActionMode();
void invalidateActionMode();
}
private ArrayList<MediaLibraryItem> mDataList = new ArrayList<>();
private ArrayList<MediaLibraryItem> mOriginalDataSet = null;
private List<Integer> mSelectedItems = new LinkedList<>();
private ItemFilter mFilter = new ItemFilter();
private Activity mContext;
private ClickHandler mClickHandler;
private EventsHandler mEventsHandler;
public AudioBrowserAdapter(Activity context, ClickHandler clickHandler, boolean sections) {
public AudioBrowserAdapter(Activity context, EventsHandler eventsHandler, boolean sections) {
mContext = context;
mClickHandler = clickHandler;
mEventsHandler = eventsHandler;
mMakeSections = sections;
}
......@@ -65,8 +69,11 @@ public class AudioBrowserAdapter extends RecyclerView.Adapter<AudioBrowserAdapte
if (position >= mDataList.size())
return;
holder.vdb.setVariable(BR.item, mDataList.get(position));
if (holder.getType() == MediaLibraryItem.TYPE_MEDIA)
if (holder.getType() == MediaLibraryItem.TYPE_MEDIA) {
holder.vdb.setVariable(BR.cover, AsyncImageLoader.DEFAULT_COVER_AUDIO_DRAWABLE);
boolean isSelected = mActionMode && mSelectedItems.contains(position);
((MediaItemViewHolder)holder).setViewBackground(((MediaItemViewHolder) holder).itemView.hasFocus() || isSelected);
}
}
@Override
......@@ -212,6 +219,29 @@ public class AudioBrowserAdapter extends RecyclerView.Adapter<AudioBrowserAdapte
}
}
void setActionMode(boolean actionMode) {
mActionMode = actionMode;
if (!actionMode) {
LinkedList<Integer> positions = new LinkedList<>(mSelectedItems);
mSelectedItems.clear();
for (Integer position : positions)
notifyItemChanged(position);
}
}
List<Integer> getSelectedPositions() {
return mSelectedItems;
}
List<MediaLibraryItem> getSelection() {
List<MediaLibraryItem> selection = new LinkedList<>();
for (Integer selected : mSelectedItems) {
MediaLibraryItem media = mDataList.get(selected);
selection.add(media);
}
return selection;
}
public class ViewHolder extends RecyclerView.ViewHolder {
public ViewDataBinding vdb;
......@@ -224,6 +254,7 @@ public class AudioBrowserAdapter extends RecyclerView.Adapter<AudioBrowserAdapte
return MediaLibraryItem.TYPE_DUMMY;
}
}
public class MediaItemViewHolder extends ViewHolder implements View.OnLongClickListener, View.OnFocusChangeListener {
MediaItemViewHolder(AudioBrowserItemBinding binding) {
......@@ -234,28 +265,51 @@ public class AudioBrowserAdapter extends RecyclerView.Adapter<AudioBrowserAdapte
}
public void onClick(View v) {
if (mClickHandler != null)
mClickHandler.onClick(v, getLayoutPosition(), ((AudioBrowserItemBinding)vdb).getItem());
if (mActionMode) {
setSelected();
if (mEventsHandler != null)
mEventsHandler.invalidateActionMode();
return;
}
if (mEventsHandler != null)
mEventsHandler.onClick(v, getLayoutPosition(), ((AudioBrowserItemBinding)vdb).getItem());
}
public void onMoreClick(View v) {
if (mClickHandler != null)
mClickHandler.onCtxClick(v, getLayoutPosition(), ((AudioBrowserItemBinding)vdb).getItem());
if (mEventsHandler != null)
mEventsHandler.onCtxClick(v, getLayoutPosition(), ((AudioBrowserItemBinding)vdb).getItem());
}
@Override
public boolean onLongClick(View view) {
onMoreClick(view);
if (mActionMode)
return false;
setSelected();
mEventsHandler.startActionMode();
return true;
}
private void setSelected() {
Integer position = getLayoutPosition();
boolean selected = !mSelectedItems.contains(position);
if (selected)
mSelectedItems.add(position);
else
mSelectedItems.remove(position);
setViewBackground(itemView.hasFocus() || mSelectedItems.contains(position));
}
public int getType() {
return MediaLibraryItem.TYPE_MEDIA;
}
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus)
setViewBackground(hasFocus || mSelectedItems.contains(getLayoutPosition()));
}
private void setViewBackground(boolean highlight) {
if (highlight)
itemView.setBackgroundColor(UiTools.ITEM_FOCUS_ON);
else
itemView.setBackgroundColor(UiTools.ITEM_FOCUS_OFF);
......
......@@ -29,16 +29,13 @@ import android.os.Handler;
import android.os.Message;
import android.support.annotation.MainThread;
import android.support.annotation.Nullable;
import android.support.design.widget.BottomSheetDialogFragment;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.TabLayout;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
......@@ -58,10 +55,7 @@ import org.videolan.medialibrary.media.Playlist;
import org.videolan.vlc.R;
import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.gui.MainActivity;
import org.videolan.vlc.gui.MediaInfoDialog;
import org.videolan.vlc.gui.SecondaryActivity;
import org.videolan.vlc.gui.browser.MediaBrowserFragment;
import org.videolan.vlc.gui.dialogs.SavePlaylistDialog;
import org.videolan.vlc.gui.helpers.AudioUtil;
import org.videolan.vlc.gui.helpers.UiTools;
import org.videolan.vlc.gui.view.ContextMenuRecyclerView;
......@@ -81,7 +75,7 @@ import java.util.List;
import java.util.Random;
import java.util.concurrent.ConcurrentLinkedQueue;
public class AudioBrowserFragment extends MediaBrowserFragment implements DevicesDiscoveryCb, SwipeRefreshLayout.OnRefreshListener, MediaBrowser.EventListener, IBrowser, ViewPager.OnPageChangeListener, AudioBrowserAdapter.ClickHandler, Medialibrary.ArtistsAddedCb, Medialibrary.ArtistsModifiedCb, Medialibrary.AlbumsAddedCb, Medialibrary.AlbumsModifiedCb, MediaAddedCb, MediaUpdatedCb, TabLayout.OnTabSelectedListener, Filterable {
public class AudioBrowserFragment extends BaseAudioBrowser implements DevicesDiscoveryCb, SwipeRefreshLayout.OnRefreshListener, MediaBrowser.EventListener, IBrowser, ViewPager.OnPageChangeListener, AudioBrowserAdapter.EventsHandler, Medialibrary.ArtistsAddedCb, Medialibrary.ArtistsModifiedCb, Medialibrary.AlbumsAddedCb, Medialibrary.AlbumsModifiedCb, MediaAddedCb, MediaUpdatedCb, TabLayout.OnTabSelectedListener, Filterable {
public final static String TAG = "VLC/AudioBrowserFragment";
private MediaBrowser mMediaBrowser;
......@@ -106,12 +100,12 @@ public class AudioBrowserFragment extends MediaBrowserFragment implements Device
public static final int UPDATE_LIST = 102;
public static final int SET_REFRESHING = 103;
public static final int UNSET_REFRESHING = 104;
public final static int MODE_ARTIST = 0;
public final static int MODE_ALBUM = 1;
public final static int MODE_SONG = 2;
public final static int MODE_GENRE = 3;
public final static int MODE_PLAYLIST = 4;
public final static int MODE_TOTAL = 5; // Number of audio browser modes
private final static int MODE_ARTIST = 0;
private final static int MODE_ALBUM = 1;
private final static int MODE_SONG = 2;
private final static int MODE_GENRE = 3;
private final static int MODE_PLAYLIST = 4;
private final static int MODE_TOTAL = 5; // Number of audio browser modes
public final static int MSG_LOADING = 0;
private volatile boolean mDisplaying = false;
......@@ -179,7 +173,7 @@ public class AudioBrowserFragment extends MediaBrowserFragment implements Device
}
mViewPager.setOnTouchListener(mSwipeFilter);
mFastScroller.setRecyclerView((RecyclerView) mLists.get(mViewPager.getCurrentItem()));
mFastScroller.setRecyclerView(getCurrentRV());
}
public void onStart() {
......@@ -243,21 +237,13 @@ public class AudioBrowserFragment extends MediaBrowserFragment implements Device
updateEmptyView(mViewPager.getCurrentItem());
updatePlaylists();
}
final View current = mLists.get(mViewPager.getCurrentItem());
if (current instanceof RecyclerView) {
current.post(new Runnable() {
final RecyclerView current = getCurrentRV();
current.post(new Runnable() {
@Override
public void run() {
mSwipeRefreshLayout.setEnabled(((LinearLayoutManager)((RecyclerView)current).getLayoutManager()).findFirstVisibleItemPosition() == 0);
mSwipeRefreshLayout.setEnabled(((LinearLayoutManager)current.getLayoutManager()).findFirstVisibleItemPosition() == 0);
}
});
}
}
@Override
protected void inflate(Menu menu, int position) {
MenuInflater inflater = getActivity().getMenuInflater();
inflater.inflate(R.menu.audio_list_browser, menu);
}
protected void setContextMenuItems(Menu menu, int position) {
......@@ -362,22 +348,12 @@ public class AudioBrowserFragment extends MediaBrowserFragment implements Device
}
if (id == R.id.audio_view_info) {
BottomSheetDialogFragment bottomSheetDialogFragment = new MediaInfoDialog();
Bundle args = new Bundle();
args.putParcelable(MediaInfoDialog.ITEM_KEY, mSongsAdapter.getItem(position));
bottomSheetDialogFragment.setArguments(args);
bottomSheetDialogFragment.show(getFragmentManager(), bottomSheetDialogFragment.getTag());
showInfoDialog((MediaWrapper) mSongsAdapter.getItem(position));
return true;
}
if (id == R.id.audio_view_add_playlist) {
FragmentManager fm = getActivity().getSupportFragmentManager();
SavePlaylistDialog savePlaylistDialog = new SavePlaylistDialog();
Bundle args = new Bundle();
args.putParcelableArrayList(SavePlaylistDialog.KEY_NEW_TRACKS, (ArrayList<MediaWrapper>) new ArrayList<>(Arrays.asList(mediaItem.getTracks(mMediaLibrary))));
savePlaylistDialog.setArguments(args);
savePlaylistDialog.setCallBack(updatePlaylists);
savePlaylistDialog.show(fm, "fragment_add_to_playlist");
UiTools.addToPlaylist(getActivity(), new ArrayList<>(Arrays.asList(mediaItem.getTracks(mMediaLibrary))));
return true;
}
......@@ -466,7 +442,7 @@ public class AudioBrowserFragment extends MediaBrowserFragment implements Device
mSwipeRefreshLayout.setRefreshing(false);
mDisplaying = false;
updateEmptyView(mViewPager.getCurrentItem());
mFastScroller.setRecyclerView((RecyclerView) mLists.get(mViewPager.getCurrentItem()));
mFastScroller.setRecyclerView(getCurrentRV());
}
});
}
......@@ -482,11 +458,11 @@ public class AudioBrowserFragment extends MediaBrowserFragment implements Device
}