[Android] Set playlist and audio list to singleline

Geoffrey Métais git at videolan.org
Fri Jun 24 18:26:49 CEST 2016


vlc-android | branch: 2.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jun 24 18:18:13 2016 +0200| [d79ad9762aefa5991e8751c7ce32db109b754097] | committer: Geoffrey Métais

Set playlist and audio list to singleline

Workaround for bug https://code.google.com/p/android/issues/detail?id=33868

(cherry picked from commit 37de510f99171cf4d6340c4bfde268ec2994bb43)

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

 vlc-android/res/layout/audio_browser_item.xml | 6 +++---
 vlc-android/res/layout/playlist_item.xml      | 4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/vlc-android/res/layout/audio_browser_item.xml b/vlc-android/res/layout/audio_browser_item.xml
index 9d9976b..7b36096 100644
--- a/vlc-android/res/layout/audio_browser_item.xml
+++ b/vlc-android/res/layout/audio_browser_item.xml
@@ -63,14 +63,15 @@
                 android:layout_centerVertical="true"
                 android:orientation="vertical" >
 
+                <!-- TextView must be set to singleLine
+                    see https://code.google.com/p/android/issues/detail?id=33868 -->
                 <TextView
                     android:id="@+id/title"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:singleLine="false"
+                    android:singleLine="true"
                     android:ellipsize="end"
                     vlc:alignMode="@{alignMode}"
-                    android:maxLines="2"
                     android:text="@{media.title ?? item.mTitle}"
                     android:fontFamily="sans-serif-light"
                     android:textColor="?attr/list_title"
@@ -82,7 +83,6 @@
                     android:layout_height="wrap_content"
                     android:singleLine="true"
                     android:ellipsize="middle"
-                    android:maxLines="1"
                     android:text="@{media.artist ?? item.mSubTitle}"
                     android:visibility="@{TextUtils.isEmpty(item.mSubTitle) && TextUtils.isEmpty(media.artist)  ? View.GONE : View.VISIBLE}"
                     android:fontFamily="sans-serif-light"
diff --git a/vlc-android/res/layout/playlist_item.xml b/vlc-android/res/layout/playlist_item.xml
index 219e828..ce043d2 100644
--- a/vlc-android/res/layout/playlist_item.xml
+++ b/vlc-android/res/layout/playlist_item.xml
@@ -36,13 +36,15 @@
             android:layout_toLeftOf="@+id/item_more"
             android:layout_toStartOf="@+id/item_more"
             android:orientation="vertical">
+            <!-- TextView must be set to singleLine
+                    see https://code.google.com/p/android/issues/detail?id=33868 -->
             <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:singleLine="true"
                 android:ellipsize="middle"
                 android:text="@{media.title}"
                 android:textColor="@{titleColor}"



More information about the Android mailing list