[Android] Improve video grid card display

Geoffrey Métais git at videolan.org
Fri Aug 3 15:02:11 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Aug  3 15:01:08 2018 +0200| [1f227d89bb5eb47578190fe438a3d515b3d8eecd] | committer: Geoffrey Métais

Improve video grid card display

Set overlay in a separate ImageView, to make the cover center-cropped to
not stretch it.

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

 vlc-android/res/layout/video_grid_card.xml | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/vlc-android/res/layout/video_grid_card.xml b/vlc-android/res/layout/video_grid_card.xml
index 0929edbac..4c575a805 100644
--- a/vlc-android/res/layout/video_grid_card.xml
+++ b/vlc-android/res/layout/video_grid_card.xml
@@ -64,14 +64,23 @@
             android:id="@+id/ml_item_thumbnail"
             android:layout_width="0dp"
             android:layout_height="0dp"
-            android:background="@{cover}"
-            android:scaleType="fitXY"
-            android:src="@drawable/black_gradient"
+            android:scaleType="centerCrop"
+            android:src="@{cover}"
             vlc:media="@{media}"
             vlc:layout_constraintTop_toTopOf="parent"
             vlc:layout_constraintBottom_toBottomOf="parent"
             vlc:layout_constraintStart_toStartOf="parent"
             vlc:layout_constraintEnd_toEndOf="parent"/>
+        <ImageView
+            android:id="@+id/ml_item_overlay"
+            android:layout_width="0dp"
+            android:layout_height="0dp"
+            android:scaleType="fitXY"
+            android:src="@drawable/black_gradient"
+            vlc:layout_constraintTop_toTopOf="@+id/ml_item_thumbnail"
+            vlc:layout_constraintBottom_toBottomOf="@+id/ml_item_thumbnail"
+            vlc:layout_constraintStart_toStartOf="@+id/ml_item_thumbnail"
+            vlc:layout_constraintEnd_toEndOf="@+id/ml_item_thumbnail"/>
 
         <ImageView
             android:id="@+id/ml_item_seen"



More information about the Android mailing list