[Android] Audioplayer: Fix shuffle button update

Geoffrey Métais git at videolan.org
Fri Feb 15 10:23:12 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Feb 15 10:14:54 2019 +0100| [794da7b0e5802942bf0d4865444766c7e7c1344d] | committer: Geoffrey Métais

Audioplayer: Fix shuffle button update

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

 vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
index 220ea29e7..7e0e98fdf 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
@@ -210,11 +210,11 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher {
 
     private var wasShuffling = false
     private fun updateShuffleMode() {
+        binding.shuffle.visibility = if (playlistModel.canShuffle) View.VISIBLE else View.INVISIBLE
         val shuffling = playlistModel.shuffling
         if (wasShuffling == shuffling) return
         binding.shuffle.setImageResource(UiTools.getResourceFromAttribute(activity, if (shuffling) R.attr.ic_shuffle_on else R.attr.ic_shuffle))
         binding.shuffle.contentDescription = resources.getString(if (shuffling) R.string.shuffle_on else R.string.shuffle)
-        binding.shuffle.visibility = if (shuffling) View.VISIBLE else View.INVISIBLE
         wasShuffling = shuffling
     }
 



More information about the Android mailing list