[Android] Fix video groups
Sébastien Toque
git at videolan.org
Mon Sep 7 22:30:22 CEST 2015
vlc-ports/android | branch: master | Sébastien Toque <xilasz at gmail.com> | Mon Sep 7 22:30:18 2015 +0200| [5035505b33007a478f99a6cc219c475e537030b0] | committer: Sébastien Toque
Fix video groups
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=5035505b33007a478f99a6cc219c475e537030b0
---
vlc-android/res/layout/video_grid_card.xml | 2 +-
vlc-android/res/layout/video_list_card.xml | 2 +-
vlc-android/src/org/videolan/vlc/MediaGroup.java | 3 +++
vlc-android/src/org/videolan/vlc/MediaWrapper.java | 4 ++++
vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java | 2 +-
vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java | 1 -
6 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/vlc-android/res/layout/video_grid_card.xml b/vlc-android/res/layout/video_grid_card.xml
index 140a582..5e39555 100644
--- a/vlc-android/res/layout/video_grid_card.xml
+++ b/vlc-android/res/layout/video_grid_card.xml
@@ -68,7 +68,7 @@
android:layout_above="@+id/ml_item_time"
android:layout_toLeftOf="@+id/item_more"
android:layout_marginTop="5dp"
- android:text="@{media.title}"
+ android:text="@{media.displayTitle}"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:ellipsize="end"
diff --git a/vlc-android/res/layout/video_list_card.xml b/vlc-android/res/layout/video_list_card.xml
index d4aeed6..e1f0090 100644
--- a/vlc-android/res/layout/video_list_card.xml
+++ b/vlc-android/res/layout/video_list_card.xml
@@ -63,7 +63,7 @@
android:layout_toLeftOf="@+id/item_more"
android:layout_above="@+id/ml_item_time"
android:layout_alignParentTop="true"
- android:text="@{media.title}"
+ android:text="@{media.displayTitle}"
android:gravity="center_vertical"
android:ellipsize="end"
android:maxLines="2"
diff --git a/vlc-android/src/org/videolan/vlc/MediaGroup.java b/vlc-android/src/org/videolan/vlc/MediaGroup.java
index c9597c2..3453402 100644
--- a/vlc-android/src/org/videolan/vlc/MediaGroup.java
+++ b/vlc-android/src/org/videolan/vlc/MediaGroup.java
@@ -57,6 +57,9 @@ public class MediaGroup extends MediaWrapper {
mMedias.add(media);
}
+ public String getDisplayTitle() {
+ return getTitle() + "\u2026";
+ }
public void add(MediaWrapper media) {
mMedias.add(media);
}
diff --git a/vlc-android/src/org/videolan/vlc/MediaWrapper.java b/vlc-android/src/org/videolan/vlc/MediaWrapper.java
index b9a5f6b..c14975f 100644
--- a/vlc-android/src/org/videolan/vlc/MediaWrapper.java
+++ b/vlc-android/src/org/videolan/vlc/MediaWrapper.java
@@ -338,6 +338,10 @@ public class MediaWrapper implements Parcelable {
}
}
+ public String getDisplayTitle() {
+ return getTitle();
+ }
+
public String getReferenceArtist() {
return mAlbumArtist == null ? mArtist : mAlbumArtist;
}
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index 52aeb74..65af88d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -234,7 +234,7 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
if (mGroup == null)
return getString(R.string.video);
else
- return mGroup;
+ return mGroup + "\u2026";
}
private void updateViewMode() {
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 5046023..b85aaa8 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
@@ -218,7 +218,6 @@ public class VideoListAdapter extends ArrayAdapter<MediaWrapper>
MediaGroup mediaGroup = (MediaGroup) media;
int size = mediaGroup.size();
String text = getContext().getResources().getQuantityString(R.plurals.videos_quantity, size, size);
- mediaGroup.setTitle(media.getTitle() + "\u2026");
holder.binding.setVariable(BR.resolution, text);
}
More information about the Android
mailing list