[Android] Fix the video player previous/next buttons visibility

Nicolas Pomepuy git at videolan.org
Tue Aug 2 14:26:18 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Aug  1 10:34:14 2022 +0200| [64b58b8521b62ac6ce80e8dc63789d3bae99fde2] | committer: Duncan McNamara

Fix the video player previous/next buttons visibility

Fixes #2622

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

 .../org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt
index 4b5e526ef..6563882e9 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt
@@ -763,11 +763,13 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
                 dataset.observe(player, player.playlistObserver)
             }
         }
-        if (player.service?.hasPlaylist() == true) hudRightBinding.playlistToggle.setVisible() else hudRightBinding.playlistToggle.setGone()
-        if (::hudBinding.isInitialized) {
-            hudBinding.playlistPrevious.setVisible()
-            hudBinding.playlistNext.setVisible()
-        }
+        if (player.service?.hasPlaylist() == true) {
+            hudRightBinding.playlistToggle.setVisible()
+            if (::hudBinding.isInitialized) {
+                hudBinding.playlistPrevious.setVisible()
+                hudBinding.playlistNext.setVisible()
+            }
+        } else hudRightBinding.playlistToggle.setGone()
         hudRightBinding.playlistToggle.setOnClickListener(player)
         closeButton.setOnClickListener { togglePlaylist() }
         hingeArrowLeft?.setOnClickListener {



More information about the Android mailing list