[Android] Fix video card / list length display
Nicolas Pomepuy
git at videolan.org
Tue Apr 9 15:20:20 CEST 2019
vlc-android | branch: 3.1.x | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Tue Apr 9 15:01:14 2019 +0200| [034af7a9a5d24656efeca177762421b131b1f584] | committer: Geoffrey Métais
Fix video card / list length display
(cherry picked from commit 6d27fa61943207b78413429928dac886482f430e)
> https://code.videolan.org/videolan/vlc-android/commit/034af7a9a5d24656efeca177762421b131b1f584
---
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.java | 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.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
index 7bac6d426..b5b99f002 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
@@ -174,7 +174,7 @@ public class VideoListAdapter extends DiffUtilAdapter<MediaWrapper, VideoListAda
progress = (int) (lastTime / 1000);
}
if (TextUtils.isEmpty(resolution)) text = Tools.millisToText(media.getLength());
- else text = Tools.millisToText(media.getLength())+" | "+resolution;
+ else text = Tools.millisToString(media.getLength(), true, false)+" | "+resolution;
} else text = resolution;
seen = mIsSeenMediaMarkerVisible ? media.getSeen() : 0L;
}
More information about the Android
mailing list