[Android] Fix video player title placement

Nicolas Pomepuy git at videolan.org
Wed Jul 1 14:21:05 CEST 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Jul  1 09:43:12 2020 +0200| [057c10345d42f2ef7b1bc6b8b356a261c023ce95] | committer: Nicolas Pomepuy

Fix video player title placement

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

 application/vlc-android/res/layout/player_hud_right.xml          | 9 +++++++++
 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt        | 8 ++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/application/vlc-android/res/layout/player_hud_right.xml b/application/vlc-android/res/layout/player_hud_right.xml
index df00d7d55..4ffd8c57f 100644
--- a/application/vlc-android/res/layout/player_hud_right.xml
+++ b/application/vlc-android/res/layout/player_hud_right.xml
@@ -106,6 +106,15 @@
                 app:srcCompat="@drawable/ic_player_renderer"
                 tools:visibility="visible" />
 
+        <androidx.constraintlayout.widget.Barrier
+                android:id="@+id/icon_barrier"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                app:barrierDirection="bottom"
+                app:constraint_referenced_ids="playlist_toggle,video_renderer,player_overlay_navmenu,video_secondary_display"
+                tools:layout_editor_absoluteX="411dp"
+                tools:layout_editor_absoluteY="48dp" />
+
     </androidx.constraintlayout.widget.ConstraintLayout>
 
     <!-- Media control buttons -->
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index c278eb590..3363bd869 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -2084,11 +2084,11 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
     private val titleConstraintSetLandscape = ConstraintSet()
     private val titleConstraintSetPortrait = ConstraintSet()
     private fun manageTitleConstraints() {
-       titleConstraintSetLandscape.clone(hudRightBinding.hudRightOverlay)
-       titleConstraintSetPortrait.clone(hudRightBinding.hudRightOverlay)
+        titleConstraintSetLandscape.clone(hudRightBinding.hudRightOverlay)
+        titleConstraintSetPortrait.clone(hudRightBinding.hudRightOverlay)
         titleConstraintSetPortrait.setMargin(hudRightBinding.playerOverlayTitle.id, ConstraintSet.START, 16.dp)
         titleConstraintSetPortrait.setMargin(hudRightBinding.playerOverlayTitle.id, ConstraintSet.END, 16.dp)
-        titleConstraintSetPortrait.connect(hudRightBinding.playerOverlayTitle.id, ConstraintSet.TOP, hudRightBinding.playerOverlayNavmenu.id, ConstraintSet.BOTTOM, 0.dp)
+        titleConstraintSetPortrait.connect(hudRightBinding.playerOverlayTitle.id, ConstraintSet.TOP, hudRightBinding.iconBarrier.id, ConstraintSet.BOTTOM, 0.dp)
     }
 
     private fun updateTitleConstraints() {
@@ -2697,7 +2697,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
                 hideOverlay(false)
             } else if (menuIdx != -1) setESTracks()
 
-            navMenu.setVisibility(if (menuIdx >= 0 && navMenu != null) View.VISIBLE else View.INVISIBLE)
+            navMenu.setVisibility(if (menuIdx >= 0 && navMenu != null) View.VISIBLE else View.GONE)
             supportInvalidateOptionsMenu()
         }
     }



More information about the Android mailing list