[Android] Fix the ML progress crashing on sub activities

Nicolas Pomepuy git at videolan.org
Fri Jan 21 11:20:35 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Jan 18 13:56:33 2022 +0100| [30cf152d1f22563e4606409544d3c6d32fe1acaf] | committer: Nicolas Pomepuy

Fix the ML progress crashing on sub activities

Fixes #2296

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

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

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 2a12642b4..87c9d124c 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.kt
@@ -452,9 +452,11 @@ open class AudioPlayerContainerActivity : BaseActivity(), KeycodeListener {
         } else scanProgressLayout?.visibility = View.VISIBLE
         vsc?.let {
             val lp = it.layoutParams as CoordinatorLayout.LayoutParams
-            lp.anchorId = if (isTablet()) R.id.fragment_placeholder else R.id.navigation
-            lp.anchorGravity = if (isTablet()) Gravity.BOTTOM else Gravity.TOP
-            lp.marginStart = if (isTablet()) 72.dp else 0.dp
+            if (this is MainActivity) {
+                lp.anchorId =if (isTablet()) R.id.fragment_placeholder else  R.id.navigation
+                lp.anchorGravity = if (isTablet()) Gravity.BOTTOM else Gravity.TOP
+                lp.marginStart = if (isTablet()) 72.dp else 0.dp
+            }
             it.layoutParams = lp
         }
         scanProgressText?.text = discovery



More information about the Android mailing list