[Android] Improve video folder & group titles

Sébastien Toque git at videolan.org
Wed Nov 27 13:15:23 CET 2019


vlc-android | branch: master | Sébastien Toque <xilasz at gmail.com> | Wed Nov 27 13:15:21 2019 +0100| [6187e9ea7208cef06fb42f38f859840a86522220] | committer: Hugo Beauzée-Luyssen

Improve video folder & group titles

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

 .../org/videolan/medialibrary/interfaces/media/AbstractFolder.java    | 4 ++++
 .../videolan/medialibrary/interfaces/media/AbstractVideoGroup.java    | 4 ++++
 vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt       | 2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/medialibrary/src/org/videolan/medialibrary/interfaces/media/AbstractFolder.java b/medialibrary/src/org/videolan/medialibrary/interfaces/media/AbstractFolder.java
index 317d6319f..f4c1a7be8 100644
--- a/medialibrary/src/org/videolan/medialibrary/interfaces/media/AbstractFolder.java
+++ b/medialibrary/src/org/videolan/medialibrary/interfaces/media/AbstractFolder.java
@@ -27,6 +27,10 @@ public abstract class AbstractFolder extends MediaLibraryItem {
     abstract public AbstractMediaWrapper[] searchTracks(String query, int mediaType, int sort, boolean desc, int nbItems, int offset);
     abstract public int searchTracksCount(String query, int mediaType);
 
+    public String getDisplayTitle() {
+        return super.getTitle();
+    }
+
     @Override
     public AbstractMediaWrapper[] getTracks() {
         return new AbstractMediaWrapper[0];
diff --git a/medialibrary/src/org/videolan/medialibrary/interfaces/media/AbstractVideoGroup.java b/medialibrary/src/org/videolan/medialibrary/interfaces/media/AbstractVideoGroup.java
index 5bf8c5bc6..7571175d0 100644
--- a/medialibrary/src/org/videolan/medialibrary/interfaces/media/AbstractVideoGroup.java
+++ b/medialibrary/src/org/videolan/medialibrary/interfaces/media/AbstractVideoGroup.java
@@ -21,6 +21,10 @@ public abstract class AbstractVideoGroup extends MediaLibraryItem {
     abstract public AbstractMediaWrapper[] searchTracks(String query, int sort, boolean desc, int nbItems, int offset);
     abstract public int searchTracksCount(String query);
 
+    public String getDisplayTitle() {
+        return super.getTitle() + "…";
+    }
+
     public int mediaCount() {
         return mCount;
     }
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
index f282685f7..a1661a007 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
@@ -257,7 +257,7 @@ class VideoGridFragment : MediaBrowserFragment<VideosViewModel>(), SwipeRefreshL
     }
 
     override fun getTitle() = when(viewModel.groupingType) {
-        VideoGroupingType.NONE -> viewModel.folder?.title ?: viewModel.group?.title ?: getString(R.string.videos)
+        VideoGroupingType.NONE -> viewModel.folder?.displayTitle ?: viewModel.group?.displayTitle ?: getString(R.string.videos)
         VideoGroupingType.FOLDER -> getString(R.string.videos_folders_title)
         VideoGroupingType.NAME -> getString(R.string.videos_groups_title)
     }



More information about the Android mailing list