[Android] Fix video card / list length display

Nicolas Pomepuy git at videolan.org
Tue Apr 9 15:09:38 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Tue Apr  9 15:01:14 2019 +0200| [6d27fa61943207b78413429928dac886482f430e] | committer: Nicolas Pomepuy

Fix video card / list length display

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

 vlc-android/res/layout/video_grid_card.xml                  |  1 +
 vlc-android/res/layout/video_list_card.xml                  | 13 ++++++++-----
 .../src/org/videolan/vlc/gui/video/VideoListAdapter.kt      |  2 +-
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/vlc-android/res/layout/video_grid_card.xml b/vlc-android/res/layout/video_grid_card.xml
index 699675080..fb2d3d8eb 100644
--- a/vlc-android/res/layout/video_grid_card.xml
+++ b/vlc-android/res/layout/video_grid_card.xml
@@ -114,6 +114,7 @@
             vlc:layout_constraintEnd_toStartOf="@+id/item_more"
             vlc:layout_constraintStart_toStartOf="@+id/ml_item_title"
             android:layout_marginBottom="2dp"
+            android:ellipsize="end"
             android:gravity="start"
             style="@style/VLC.TextViewDescription"
             android:textColor="@color/grey50"
diff --git a/vlc-android/res/layout/video_list_card.xml b/vlc-android/res/layout/video_list_card.xml
index 80624e07d..3a20e9a83 100644
--- a/vlc-android/res/layout/video_list_card.xml
+++ b/vlc-android/res/layout/video_list_card.xml
@@ -117,15 +117,18 @@
 
         <TextView
             android:id="@+id/ml_item_time"
+            style="@style/VLC.TextViewDescription"
             android:layout_width="0dp"
             android:layout_height="wrap_content"
-            vlc:layout_constraintStart_toEndOf="@+id/ml_item_thumbnail"
-            vlc:layout_constraintBottom_toTopOf="@+id/ml_item_progress"
-            vlc:layout_constraintStart_toStartOf="@+id/ml_item_title"
-            style="@style/VLC.TextViewDescription"
+            android:layout_alignWithParentIfMissing="true"
+            android:layout_marginStart="16dp"
+            android:layout_marginLeft="16dp"
             android:gravity="start"
             android:text="@{time}"
-            android:layout_alignWithParentIfMissing="true"  />
+            vlc:layout_constraintTop_toBottomOf="@+id/ml_item_title"
+            vlc:layout_constraintBottom_toTopOf="@+id/ml_item_progress"
+            vlc:layout_constraintEnd_toStartOf="@+id/item_more"
+            vlc:layout_constraintStart_toEndOf="@+id/ml_item_thumbnail" />
 
         <ProgressBar
             android:id="@+id/ml_item_progress"
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.kt b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.kt
index e89a00e5c..64e870a96 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.kt
@@ -161,7 +161,7 @@ class VideoListAdapter internal constructor(
                 if (TextUtils.isEmpty(resolution))
                     text = Tools.millisToText(media.length)
                 else
-                    text = Tools.millisToText(media.length) + "  |  " + resolution
+                    text = Tools.millisToString(media.length, true, false) + "  |  " + resolution
             } else
                 text = resolution
             seen = if (mIsSeenMediaMarkerVisible) media.seen else 0L



More information about the Android mailing list