[Android] Display "unknown album" for album sections
Geoffrey Métais
git at videolan.org
Fri Feb 17 10:55:59 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Feb 17 10:55:31 2017 +0100| [d6b67d8bd4c0d3806941f97547f3230505050935] | committer: Geoffrey Métais
Display "unknown album" for album sections
> https://code.videolan.org/videolan/vlc-android/commit/d6b67d8bd4c0d3806941f97547f3230505050935
---
.../src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
index d6e70f8..ab3801a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
@@ -29,6 +29,7 @@ import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
@@ -277,7 +278,10 @@ public class AudioAlbumsSongsFragment extends BaseAudioBrowser implements SwipeR
mAlbumsAdapter.dispatchUpdate(albums);
LinkedList<MediaLibraryItem> songs = new LinkedList<>();
for (Album album : albums) {
- songs.add(new DummyItem(album.getTitle()));
+ String title = album.getTitle();
+ if (TextUtils.isEmpty(title))
+ title = getString(R.string.unknown_album);
+ songs.add(new DummyItem(title));
songs.addAll(Arrays.asList(album.getTracks(mMediaLibrary)));
}
mSongsAdapter.dispatchUpdate(songs.toArray(new MediaLibraryItem[songs.size()]));
More information about the Android
mailing list