[Android] AudioPlayer: in onResume set scan progress margin

Duncan McNamara git at videolan.org
Fri Nov 5 06:59:33 UTC 2021


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Wed Nov  3 19:13:40 2021 +0100| [c643dbb46afd19613828ed86a6b6af49ffd4a843] | committer: Nicolas Pomepuy

AudioPlayer: in onResume set scan progress margin

There have been some cases where after returning to the app, the player
isn't shown anymore, but the scan progress is still positionned above
the now absent player. This will check for the presence of the player,
and set the scan progress margin accordingly, when resuming the
AudioPlayer.

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

 .../src/org/videolan/vlc/gui/AudioPlayerContainerActivity.kt      | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.kt
index e0b585843..dcac53e44 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.kt
@@ -235,6 +235,14 @@ open class AudioPlayerContainerActivity : BaseActivity() {
         super.onDestroy()
     }
 
+    override fun onResume() {
+        if (playerShown)
+            applyMarginToProgressBar(playerBehavior.peekHeight)
+        else
+            applyMarginToProgressBar(0)
+        super.onResume()
+    }
+
     override fun onBackPressed() {
         if (slideDownAudioPlayer()) return
         super.onBackPressed()



More information about the Android mailing list