[Android] Force player hud to be 800dp

Geoffrey Métais git at videolan.org
Tue Jun 18 09:30:33 CEST 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jun 18 09:26:18 2019 +0200| [6d8206f373b1e5e45485788f0a5da2ebe0dcfadc] | committer: Geoffrey Métais

Force player hud to be 800dp

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

 vlc-android/res/layout/player.xml                  |  2 +-
 .../videolan/vlc/gui/video/VideoPlayerActivity.kt  | 23 ++--------------------
 2 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/vlc-android/res/layout/player.xml b/vlc-android/res/layout/player.xml
index 3753ccf90..f9e862e28 100644
--- a/vlc-android/res/layout/player.xml
+++ b/vlc-android/res/layout/player.xml
@@ -63,7 +63,7 @@
 
         <androidx.appcompat.widget.ViewStubCompat
             android:id="@+id/player_hud_stub"
-            android:layout_width="match_parent"
+            android:layout_width="800dp"
             android:layout_height="wrap_content"
             android:layout="@layout/player_hud"
             android:layout_marginBottom="@dimen/overlay_margin"
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index 3d17470cb..12c8f53df 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -2151,8 +2151,6 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
     @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
     private fun initOverlay() {
         service?.let { service ->
-
-
             val vscRight = findViewById<ViewStubCompat>(R.id.player_hud_right_stub)
             vscRight?.let {
                 it.inflate()
@@ -2165,8 +2163,6 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
                 if (!isBenchmark && enableCloneMode && !settings.contains("enable_clone_mode")) {
                     UiTools.snackerConfirm(hudRightBinding.videoSecondaryDisplay, getString(R.string.video_save_clone_mode), Runnable { settings.edit().putBoolean("enable_clone_mode", true).apply() })
                 }
-
-
             }
 
             val vsc = findViewById<ViewStubCompat>(R.id.player_hud_stub)
@@ -2207,7 +2203,6 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
                 controlsConstraintSetPortrait.setMargin(R.id.player_overlay_time_container, ConstraintSet.START, resources.getDimensionPixelSize(R.dimen.time_margin_sides))
                 controlsConstraintSetPortrait.setMargin(R.id.player_overlay_length_container, ConstraintSet.END, resources.getDimensionPixelSize(R.dimen.time_margin_sides))
 
-
                 val chainIds = arrayOf(R.id.lock_overlay_button, R.id.playlist_previous, R.id.player_overlay_rewind, R.id.player_overlay_play, R.id.player_overlay_forward, R.id.playlist_next, R.id.player_overlay_tracks)
 
                 chainIds.forEach {
@@ -2220,9 +2215,6 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
 
                 controlsConstraintSetPortrait.createHorizontalChain(ConstraintSet.PARENT_ID, ConstraintSet.LEFT, ConstraintSet.PARENT_ID, ConstraintSet.RIGHT, chainIds.toIntArray(), null, ConstraintSet.CHAIN_SPREAD_INSIDE)
 
-
-
-
                 resetHudLayout()
                 updateOverlayPausePlay(true)
                 updateSeekable(service.isSeekable)
@@ -2230,11 +2222,7 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
                 updateNavStatus()
                 setListeners(true)
                 initPlaylistUi()
-                if (!displayManager.isPrimary) {
-                    hudBinding.lockOverlayButton.setGone()
-                }
-
-
+                if (!displayManager.isPrimary) hudBinding.lockOverlayButton.setGone()
             } else if (::hudBinding.isInitialized) {
                 hudBinding.progress = service.playlistManager.player.progress
                 hudBinding.lifecycleOwner = this
@@ -2242,7 +2230,6 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
         }
     }
 
-
     /**
      * hider overlay
      */
@@ -2319,18 +2306,12 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
                     else
                         R.drawable.ic_play_player)
                 } else {
-
                     val drawable = if (service.isPlaying) playToPause else pauseToPlay
                     hudBinding.playerOverlayPlay.setImageDrawable(drawable)
-                    if (service.isPlaying != wasPlaying) {
-                        drawable.start()
-
-                    }
+                    if (service.isPlaying != wasPlaying) drawable.start()
                 }
 
                 wasPlaying = service.isPlaying
-
-
             }
             hudBinding.playerOverlayPlay.requestFocus()
         }



More information about the Android mailing list