[Android] History video items in 16:10

Nicolas Pomepuy git at videolan.org
Wed Jul 24 15:18:14 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Mon Jul 22 08:38:03 2019 +0200| [8e709e2af532cbade72e63fe35cc4ec710d32cf6] | committer: Geoffrey Métais

History video items in 16:10

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

 vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.kt        | 2 ++
 vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.kt | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.kt b/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.kt
index fa66b2452..8016f4f14 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.kt
@@ -22,6 +22,7 @@ package org.videolan.vlc.gui
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
+import androidx.constraintlayout.widget.ConstraintLayout
 import kotlinx.coroutines.ExperimentalCoroutinesApi
 import kotlinx.coroutines.ObsoleteCoroutinesApi
 import org.videolan.medialibrary.interfaces.media.AbstractMediaWrapper
@@ -78,6 +79,7 @@ class HistoryAdapter(private val mEventsHandler: IEventsHandler) : DiffUtilAdapt
         val media = getItem(position)
         holder.binding.media = media
         holder.binding.cover = getMediaIconDrawable(holder.itemView.context, media.type)
+        (holder.binding.icon.layoutParams as ConstraintLayout.LayoutParams).dimensionRatio = if (media.type == AbstractMediaWrapper.TYPE_VIDEO) "16:10" else "1"
         holder.selectView(multiSelectHelper.isSelected(position))
     }
 
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.kt b/vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.kt
index 2866798db..5e762af0f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/PlaylistAdapter.kt
@@ -120,10 +120,12 @@ class PlaylistAdapter(private val player: IPlayer) : DiffUtilAdapter<AbstractMed
         }
 
         if (media.type == AbstractMediaWrapper.TYPE_VIDEO) {
-            (holder.binding.coverImage.layoutParams as ConstraintLayout.LayoutParams).dimensionRatio = "16:9"
+            (holder.binding.coverImage.layoutParams as ConstraintLayout.LayoutParams).dimensionRatio = "16:10"
             holder.binding.cover = defaultCoverVideo
-        } else
+        } else {
+            (holder.binding.coverImage.layoutParams as ConstraintLayout.LayoutParams).dimensionRatio = "1"
             holder.binding.cover = defaultCoverAudio
+        }
 
         holder.binding.executePendingBindings()
     }



More information about the Android mailing list