[Android] Hide shuffle FAB when there is not enough tracks

Geoffrey Métais git at videolan.org
Fri Jul 6 09:13:42 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jul  6 09:12:52 2018 +0200| [12badafd0e47893e1c06ba04adae65862df10b97] | committer: Geoffrey Métais

Hide shuffle FAB when there is not enough tracks

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

 vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index a289b0227..bf3360e55 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -244,7 +244,7 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
     }
 
     public void setFabPlayShuffleAllVisibility() {
-        setFabPlayVisibility(mViewPager.getCurrentItem() == MODE_SONG);
+        setFabPlayVisibility(mViewPager.getCurrentItem() == MODE_SONG && mSongsAdapter.getItemCount() > 2);
     }
 
     /**
@@ -271,6 +271,7 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
     private void updateEmptyView(int position) {
         mEmptyView.setVisibility(getCurrentAdapter().isEmpty() ? View.VISIBLE : View.GONE);
         mEmptyView.setText(position == MODE_PLAYLIST ? R.string.noplaylist : R.string.nomedia);
+        setFabPlayShuffleAllVisibility();
     }
 
     private final TabLayout.TabLayoutOnPageChangeListener tcl = new TabLayout.TabLayoutOnPageChangeListener(mTabLayout);



More information about the Android mailing list