[Android] Fix regression preventing the video player to be displayed correctly on foldables
Nicolas Pomepuy
git at videolan.org
Tue Jun 14 14:15:40 UTC 2022
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Jun 8 07:01:05 2022 +0200| [08bb275b0c7ff3aeb9a6a4bb808f7c1c71416f4f] | committer: Duncan McNamara
Fix regression preventing the video player to be displayed correctly on foldables
> https://code.videolan.org/videolan/vlc-android/commit/08bb275b0c7ff3aeb9a6a4bb808f7c1c71416f4f
---
.../src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt | 7 ++++---
1 file changed, 4 insertions(+), 3 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 4985ec86a..6d26c18e6 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
@@ -154,8 +154,9 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
it?.let { view ->
val lp = (view.layoutParams as FrameLayout.LayoutParams)
lp.width = halfScreenSize
- lp.gravity = lp.gravity or (if (onRight) Gravity.END else Gravity.START)
- lp.gravity = lp.gravity and (if (onRight) Gravity.END else Gravity.START).inv()
+ //get vertical flags to keep them
+ val newGravity = lp.gravity and Gravity.VERTICAL_GRAVITY_MASK
+ lp.gravity = newGravity or (if (onRight) Gravity.END else Gravity.START)
view.layoutParams = lp
}
}
@@ -172,7 +173,7 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
arrayOf(playerUiContainer, playlistContainer).forEach {
val lp = (it.layoutParams as FrameLayout.LayoutParams)
lp.height = halfScreenSize
- lp.gravity = lp.gravity or Gravity.BOTTOM
+ lp.gravity = Gravity.BOTTOM
it.layoutParams = lp
}
arrayOf(hudBackground, hudRightBackground).forEach {
More information about the Android
mailing list