[Android] Fix media scanning view position on tablets

Nicolas Pomepuy git at videolan.org
Thu Dec 23 09:45:07 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Dec  6 08:48:45 2021 +0100| [6832f6136bd9d7ccbbf9919937c4d9634582b582] | committer: Nicolas Pomepuy

Fix media scanning view position on tablets

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

 .../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 105261d90..2a12642b4 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.kt
@@ -63,6 +63,7 @@ import org.videolan.vlc.gui.helpers.PlayerBehavior
 import org.videolan.vlc.gui.helpers.UiTools
 import org.videolan.vlc.gui.audio.EqualizerFragment
 import org.videolan.vlc.gui.helpers.*
+import org.videolan.vlc.gui.helpers.UiTools.isTablet
 import org.videolan.vlc.interfaces.IRefreshable
 import org.videolan.vlc.media.PlaylistManager
 import kotlin.math.max
@@ -449,6 +450,13 @@ open class AudioPlayerContainerActivity : BaseActivity(), KeycodeListener {
             scanProgressText = findViewById(R.id.scan_progress_text)
             scanProgressBar = findViewById(R.id.scan_progress_bar)
         } 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
+            it.layoutParams = lp
+        }
         scanProgressText?.text = discovery
     }
 



More information about the Android mailing list