[Android] Show FAB for albums in Artist/Genre view

Geoffrey Métais git at videolan.org
Wed Dec 20 17:10:02 CET 2017


vlc-android | branch: 2.5.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Dec 14 13:50:25 2017 +0100| [e6b1b35032dd243089c2f5a1eeb700e28bbb2108] | committer: Geoffrey Métais

Show FAB for albums in Artist/Genre view

Close #425

(cherry picked from commit 90b354ab62889e91fe49a3e485a38055b249fd1a)

> https://code.videolan.org/videolan/vlc-android/commit/e6b1b35032dd243089c2f5a1eeb700e28bbb2108
---

 .../videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java    | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
index 0460d4cca..fec304c5a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
@@ -380,14 +380,21 @@ public class AudioAlbumsSongsFragment extends BaseAudioBrowser implements SwipeR
 
     @Override
     public void setFabPlayVisibility(boolean enable) {
-        super.setFabPlayVisibility(enable && mViewPager.getCurrentItem() == 1);
+        super.setFabPlayVisibility(enable);
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public void onFabPlayClick(View view) {
         if (mService == null) return;
-        @SuppressWarnings("unchecked")
-        final List<MediaWrapper> list = (List<MediaWrapper>)(List<?>) mSongsAdapter.getMediaItems();
+        final List<MediaWrapper> list ;
+        if (mViewPager.getCurrentItem() == 0) {
+            list = new ArrayList<>();
+            for (MediaLibraryItem item : mAlbumsAdapter.getMediaItems())
+                list.addAll(Util.arrayToArrayList(item.getTracks()));
+        } else {
+            list = (List<MediaWrapper>) (List<?>) mSongsAdapter.getMediaItems();
+        }
         mService.load(list, 0);
     }
 }



More information about the Android mailing list