[Android] Fix playlist display for large fonts

Geoffrey Métais git at videolan.org
Fri May 27 18:46:27 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri May 27 18:45:53 2016 +0200| [93e1b6926784bfb966849aa34155900011a2f087] | committer: Geoffrey Métais

Fix playlist display for large fonts

> https://code.videolan.org/videolan/vlc-android/commit/93e1b6926784bfb966849aa34155900011a2f087
---

 vlc-android/res/layout/playlist_item.xml | 66 ++++++++++++++++----------------
 1 file changed, 32 insertions(+), 34 deletions(-)

diff --git a/vlc-android/res/layout/playlist_item.xml b/vlc-android/res/layout/playlist_item.xml
index 935aac6..55f135e 100644
--- a/vlc-android/res/layout/playlist_item.xml
+++ b/vlc-android/res/layout/playlist_item.xml
@@ -22,58 +22,56 @@
     <RelativeLayout
         android:orientation="vertical"
         android:layout_width="match_parent"
-        android:layout_height="40dp"
+        android:layout_height="wrap_content"
+        android:minHeight="40dp"
         android:layout_margin="5dip"
         android:clickable="true"
         android:onClick="@{holder.onClick}" >
-        <TextView
-            android:id="@+id/audio_item_title"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:layout_marginLeft="5dip"
-            android:layout_marginRight="5dip"
-            android:layout_alignParentLeft="true"
-            android:layout_alignParentStart="true"
-            android:layout_alignParentTop="true"
-            android:layout_toLeftOf="@+id/item_more"
-            android:layout_toStartOf="@+id/item_more"
-            android:layout_above="@+id/audio_item_subtitle"
-            android:maxLines="@{TextUtils.isEmpty(subTitle) ? 2 : 1}"
-            android:ellipsize="middle"
-            android:text="@{media.title}"
-            android:textColor="@{titleColor}"
-            android:gravity="center_vertical"
-            android:textSize="16sp" />
-        <TextView
-            android:id="@+id/audio_item_subtitle"
+        <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:text="@{subTitle}"
-            android:layout_marginLeft="5dip"
-            android:layout_marginRight="5dip"
+            android:layout_centerVertical="true"
             android:layout_alignParentLeft="true"
             android:layout_alignParentStart="true"
-            android:layout_alignParentBottom="true"
             android:layout_toLeftOf="@+id/item_more"
             android:layout_toStartOf="@+id/item_more"
-            android:singleLine="true"
-            android:ellipsize="middle"
-            android:textColor="?attr/list_subtitle"
-            android:fontFamily="sans-serif-light"
-            android:textSize="12sp"
-            android:visibility="@{TextUtils.isEmpty(subTitle) ? View.GONE : View.VISIBLE}"/>
+            android:orientation="vertical">
+            <TextView
+                android:id="@+id/audio_item_title"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="5dip"
+                android:layout_marginRight="5dip"
+                android:maxLines="@{TextUtils.isEmpty(subTitle) ? 2 : 1}"
+                android:ellipsize="middle"
+                android:text="@{media.title}"
+                android:textColor="@{titleColor}"
+                android:textSize="16sp" />
+            <TextView
+                android:id="@+id/audio_item_subtitle"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@{subTitle}"
+                android:layout_marginLeft="5dip"
+                android:layout_marginRight="5dip"
+                android:singleLine="true"
+                android:ellipsize="middle"
+                android:textColor="?attr/list_subtitle"
+                android:fontFamily="sans-serif-light"
+                android:textSize="12sp"
+                android:visibility="@{TextUtils.isEmpty(subTitle) ? View.GONE : View.VISIBLE}"/>
+        </LinearLayout>
 
         <ImageView
             android:id="@+id/item_more"
             android:layout_width="wrap_content"
-            android:layout_height="match_parent"
+            android:layout_height="wrap_content"
             android:layout_gravity="center"
             android:paddingRight="10dp"
             android:paddingLeft="10dp"
             android:layout_alignParentRight="true"
             android:layout_alignParentEnd="true"
-            android:layout_alignBottom="@id/audio_item_subtitle"
-            android:layout_alignTop="@id/audio_item_title"
+            android:layout_centerVertical="true"
             android:scaleType="center"
             android:background="@drawable/ic_more"
             android:onClick="@{holder.onMoreClick}"



More information about the Android mailing list