[Android] Center thumbnail in video grid element

Geoffrey Métais git at videolan.org
Fri Apr 29 18:01:07 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Apr 29 18:00:28 2016 +0200| [36833e0a9b4b782633314df4863e48e4e975bbaf] | committer: Geoffrey Métais

Center thumbnail in video grid element

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

 vlc-android/res/layout/video_grid_card.xml | 10 +++++-----
 vlc-android/res/values-sw600dp/dimens.xml  |  2 +-
 vlc-android/res/values/dimens.xml          |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/vlc-android/res/layout/video_grid_card.xml b/vlc-android/res/layout/video_grid_card.xml
index a2e012a..d5a216b 100644
--- a/vlc-android/res/layout/video_grid_card.xml
+++ b/vlc-android/res/layout/video_grid_card.xml
@@ -70,15 +70,16 @@
                 android:layout_height="@dimen/grid_card_thumb_height"
                 android:background="?attr/background_default_darker"
                 android:scaleType="@{scaleType}"
+                android:layout_gravity="center_horizontal"
                 vlc:media="@{media}"
                 vlc:binding="@{holder.binding}"
                 android:src="@{cover}"/>
 
             <LinearLayout
-                android:layout_width="match_parent"
+                android:layout_width="@dimen/grid_card_thumb_width"
                 android:layout_height="wrap_content"
-                android:layout_marginLeft="@dimen/half_default_margin"
                 android:layout_marginTop="4dp"
+                android:layout_gravity="center_horizontal"
                 android:gravity="center_vertical"
                 android:orientation="horizontal">
 
@@ -108,10 +109,9 @@
             </LinearLayout>
 
             <LinearLayout
-                android:layout_width="match_parent"
+                android:layout_width="@dimen/grid_card_thumb_width"
                 android:layout_height="wrap_content"
-                android:layout_marginLeft="@dimen/half_default_margin"
-                android:layout_marginRight="@dimen/half_default_margin"
+                android:layout_gravity="center_horizontal"
                 android:layout_marginTop="4dp"
                 android:orientation="horizontal">
 
diff --git a/vlc-android/res/values-sw600dp/dimens.xml b/vlc-android/res/values-sw600dp/dimens.xml
index e6a0b43..9ce2bd4 100644
--- a/vlc-android/res/values-sw600dp/dimens.xml
+++ b/vlc-android/res/values-sw600dp/dimens.xml
@@ -1,5 +1,5 @@
 <resources>
-    <dimen name="grid_card_width">200dp</dimen>
+    <dimen name="grid_card_width">210dp</dimen>
     <dimen name="grid_card_height">200dp</dimen>
     <dimen name="grid_card_thumb_width">200dp</dimen>
     <dimen name="grid_card_thumb_height">125dp</dimen>
diff --git a/vlc-android/res/values/dimens.xml b/vlc-android/res/values/dimens.xml
index 2be8e33..22a0843 100644
--- a/vlc-android/res/values/dimens.xml
+++ b/vlc-android/res/values/dimens.xml
@@ -5,7 +5,7 @@
     <dimen name="directory_browser_item_size">40dp</dimen>
     <dimen name="listview_bottom_padding">10dp</dimen>
     <dimen name="listview_side_padding">5dp</dimen>
-    <dimen name="grid_card_width">160dp</dimen>
+    <dimen name="grid_card_width">170dp</dimen>
     <dimen name="grid_card_height">160dp</dimen>
     <dimen name="grid_card_thumb_width">160dp</dimen>
     <dimen name="grid_card_thumb_height">100dp</dimen>



More information about the Android mailing list