[Android] Handle remote files
Geoffrey Métais
git at videolan.org
Mon Feb 9 11:30:49 CET 2015
vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Feb 4 12:37:26 2015 +0100| [570f496ebfa532fc12686dbe8bcbf312a7fb5803] | committer: Geoffrey Métais
Handle remote files
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=570f496ebfa532fc12686dbe8bcbf312a7fb5803
---
.../org/videolan/vlc/gui/tv/audioplayer/PlaylistAdapter.java | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/vlc-android/tv/src/org/videolan/vlc/gui/tv/audioplayer/PlaylistAdapter.java b/vlc-android/tv/src/org/videolan/vlc/gui/tv/audioplayer/PlaylistAdapter.java
index 028704a..b2670bd 100644
--- a/vlc-android/tv/src/org/videolan/vlc/gui/tv/audioplayer/PlaylistAdapter.java
+++ b/vlc-android/tv/src/org/videolan/vlc/gui/tv/audioplayer/PlaylistAdapter.java
@@ -27,6 +27,8 @@ import android.widget.TextView;
import org.videolan.vlc.MediaLibrary;
import org.videolan.vlc.MediaWrapper;
+import org.videolan.vlc.util.Strings;
+import org.videolan.vlc.util.Util;
import java.util.ArrayList;
@@ -70,9 +72,11 @@ public class PlaylistAdapter extends RecyclerView.Adapter<PlaylistAdapter.ViewHo
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
- MediaWrapper MediaWrapper = sMediaLibrary.getMediaItem(mDataset.get(position));
- holder.mTitleTv.setText(MediaWrapper.getTitle());
- holder.mArtistTv.setText(MediaWrapper.getArtist());
+ MediaWrapper mediaWrapper = sMediaLibrary.getMediaItem(mDataset.get(position));
+ if (mediaWrapper == null)
+ mediaWrapper = new MediaWrapper(mDataset.get(position));
+ holder.mTitleTv.setText(Strings.getMediaTitle(mediaWrapper));
+ holder.mArtistTv.setText(Util.getMediaArtist(holder.itemView.getContext(), mediaWrapper));
holder.itemView.setActivated(position == mSelectedItem);
holder.itemView.setOnClickListener(this);
}
More information about the Android
mailing list