[Android] Prevent audio player search overlap when scrolling the play queue

Nicolas Pomepuy git at videolan.org
Mon Nov 7 15:03:26 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Nov  7 14:09:40 2022 +0100| [c7f1e1f3f17d9a27f294ebcb4f45580b598485ef] | committer: Duncan McNamara

Prevent audio player search overlap when scrolling the play queue

Fixes #2750

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

 .../vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerAnimator.kt  | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerAnimator.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerAnimator.kt
index 8763f9ddf..ebd53a98e 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerAnimator.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerAnimator.kt
@@ -57,6 +57,7 @@ import kotlin.math.min
 
 internal class AudioPlayerAnimator : IAudioPlayerAnimator, LifecycleObserver {
 
+    private var inSearch = false
     override var foldingFeature: FoldingFeature? = null
         set(value) {
             field = value
@@ -242,6 +243,7 @@ internal class AudioPlayerAnimator : IAudioPlayerAnimator, LifecycleObserver {
     }
 
     override fun manageSearchVisibilities(filter: Boolean) {
+        inSearch = filter
         binding.playlistSearch.alpha = if (filter) 0f else 1f
         binding.playlistSwitch.alpha = if (filter) 0f else 1f
         binding.advFunction.alpha = if (filter) 0f else 1f
@@ -250,6 +252,7 @@ internal class AudioPlayerAnimator : IAudioPlayerAnimator, LifecycleObserver {
     }
 
     override fun onSlide(slideOffset: Float) {
+        if (inSearch) return
         binding.progressBar.alpha = 1 - slideOffset
         binding.progressBar.layoutParams.height = ((1 - slideOffset) * 4.dp).toInt()
         binding.progressBar.requestLayout()



More information about the Android mailing list