[Android] TV: showMediaDetail util method
Geoffrey Métais
git at videolan.org
Mon Apr 18 16:07:04 CEST 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Apr 18 14:51:48 2016 +0200| [5b56fcbc26d867aa91f3a8f2f984f4c4cf916270] | committer: Geoffrey Métais
TV: showMediaDetail util method
> https://code.videolan.org/videolan/vlc-android/commit/5b56fcbc26d867aa91f3a8f2f984f4c4cf916270
---
.../src/org/videolan/vlc/gui/tv/TvUtil.java | 23 ++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.java b/vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.java
index 2f19255..3b0c648 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.java
@@ -21,6 +21,7 @@
package org.videolan.vlc.gui.tv;
import android.app.Activity;
+import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.v17.leanback.widget.Row;
@@ -42,15 +43,10 @@ public class TvUtil {
if (mediaWrapper.getType() == MediaWrapper.TYPE_VIDEO) {
VideoPlayerActivity.start(activity, mediaWrapper.getUri(), MediaUtils.getMediaTitle(mediaWrapper));
} else if (mediaWrapper.getType() == MediaWrapper.TYPE_AUDIO) {
- Intent intent = new Intent(activity,
- DetailsActivity.class);
- // pass the item information
- intent.putExtra("item", new MediaItemDetails(mediaWrapper.getTitle(), mediaWrapper.getArtist(), mediaWrapper.getAlbum(), mediaWrapper.getLocation(), mediaWrapper.getArtworkURL()));
- activity.startActivity(intent);
+ showMediaDetail(activity, mediaWrapper);
} else if (mediaWrapper.getType() == MediaWrapper.TYPE_DIR){
Intent intent = new Intent(activity, VerticalGridActivity.class);
intent.putExtra(MainTvActivity.BROWSER_TYPE, MainTvActivity.HEADER_NETWORK);
-// intent.putExtra(SortedBrowserFragment.KEY_URI, mediaWrapper.getLocation());
intent.setData(mediaWrapper.getUri());
activity.startActivity(intent);
}
@@ -62,11 +58,18 @@ public class TvUtil {
}
}
+ public static void showMediaDetail(Context activity, MediaWrapper mediaWrapper) {
+ Intent intent = new Intent(activity,
+ DetailsActivity.class);
+ intent.putExtra("item", new MediaItemDetails(mediaWrapper.getTitle(), mediaWrapper.getArtist(), mediaWrapper.getAlbum(), mediaWrapper.getLocation(), mediaWrapper.getArtworkURL()));
+ activity.startActivity(intent);
+ }
+
public static void browseFolder(Activity activity, long type, Uri uri) {
- Intent intent = new Intent(activity, VerticalGridActivity.class);
- intent.putExtra(MainTvActivity.BROWSER_TYPE, type);
- intent.setData(uri);
- activity.startActivity(intent);
+ Intent intent = new Intent(activity, VerticalGridActivity.class);
+ intent.putExtra(MainTvActivity.BROWSER_TYPE, type);
+ intent.setData(uri);
+ activity.startActivity(intent);
}
public static void playAudioList(Activity activity, ArrayList<MediaWrapper> list, int position) {
More information about the Android
mailing list