[Android] Foldables: fix 90 degres fold that removes video

Duncan McNamara git at videolan.org
Mon Nov 7 12:28:44 UTC 2022


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Fri Nov  4 08:30:31 2022 +0100| [a65c1fc0139e023516fd2f73fc5477771a67631e] | committer: Nicolas Pomepuy

Foldables: fix 90 degres fold that removes video

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerOverlayDelegate.kt       | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 8bb38d95d..d8f620a6e 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
@@ -161,7 +161,8 @@ class VideoPlayerOverlayDelegate (private val player: VideoPlayerActivity) {
             showHingeSnackIfNeeded()
         } else {
             //device is separated and half opened. We display the controls on the bottom half and the video on the top half
-            if (foldingFeature.state == FoldingFeature.State.HALF_OPENED) {
+            if (foldingFeature.state == FoldingFeature.State.HALF_OPENED &&
+                !(foldingFeature.occlusionType == FoldingFeature.OcclusionType.NONE && foldingFeature.orientation == FoldingFeature.Orientation.VERTICAL)) {
                 val videoLayoutLP = (player.videoLayout!!.layoutParams as ViewGroup.LayoutParams)
                 val halfScreenSize = foldingFeature.bounds.top
                 videoLayoutLP.height = halfScreenSize



More information about the Android mailing list