[Android] [PATCH 02/11] Extended browsing for videos

Geoffrey Métais geoffrey.metais at gmail.com
Mon Nov 17 17:53:39 CET 2014


Only videos for now, will be adapted to other media soon
Need to find a batter 'grid launcher' too.
---
 vlc-android/AndroidManifest.xml                    |   4 +
 vlc-android/res/layout/tv_vertical_grid            |   6 +
 .../vlc/gui/tv/DetailsDescriptionPresenter.java    |  19 ++
 .../src/org/videolan/vlc/gui/tv/GridFragment.java  | 208 +++++++++++++++++++++
 .../src/org/videolan/vlc/gui/tv/MainFragment.java  |  11 --
 .../org/videolan/vlc/gui/tv/MainTvActivity.java    |  56 ++++--
 .../org/videolan/vlc/gui/tv/MediaItemDetails.java  |  19 ++
 .../vlc/gui/tv/MediaItemDetailsFragment.java       |  23 ++-
 .../org/videolan/vlc/gui/tv/StringPresenter.java   |  19 ++
 .../src/org/videolan/vlc/gui/tv/TvMedia.java       |  19 ++
 .../videolan/vlc/gui/tv/VerticalGridActivity.java  |  36 ++++
 11 files changed, 394 insertions(+), 26 deletions(-)
 create mode 100644 vlc-android/res/layout/tv_vertical_grid
 create mode 100644 vlc-android/src/org/videolan/vlc/gui/tv/GridFragment.java
 delete mode 100644 vlc-android/src/org/videolan/vlc/gui/tv/MainFragment.java
 create mode 100644 vlc-android/src/org/videolan/vlc/gui/tv/VerticalGridActivity.java

diff --git a/vlc-android/AndroidManifest.xml b/vlc-android/AndroidManifest.xml
index c5a2c60..ca10980 100644
--- a/vlc-android/AndroidManifest.xml
+++ b/vlc-android/AndroidManifest.xml
@@ -54,6 +54,10 @@
         android:exported="true"
         android:theme="@style/Theme.Leanback"/>
 
+      <activity android:name="org.videolan.vlc.gui.tv.VerticalGridActivity"
+        android:exported="true"
+        android:theme="@style/Theme.Leanback"/>
+
         <activity android:name=".gui.CompatErrorActivity" />
         <activity android:name=".gui.PreferencesActivity" />
         <activity
diff --git a/vlc-android/res/layout/tv_vertical_grid b/vlc-android/res/layout/tv_vertical_grid
new file mode 100644
index 0000000..7d58289
--- /dev/null
+++ b/vlc-android/res/layout/tv_vertical_grid
@@ -0,0 +1,6 @@
+<fragment xmlns:android="http://schemas.android.com/apk/res/android"
+    android:name="org.videolan.vlc.gui.tv.GridFragment"
+    android:id="@+id/vertical_grid_fragment"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+/>
\ No newline at end of file
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/DetailsDescriptionPresenter.java b/vlc-android/src/org/videolan/vlc/gui/tv/DetailsDescriptionPresenter.java
index 22f456a..4300f77 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/DetailsDescriptionPresenter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/DetailsDescriptionPresenter.java
@@ -1,3 +1,22 @@
+/*****************************************************************************
+ * DetailsDescriptionPresenter.java
+ *****************************************************************************
+ * Copyright © 2012-2014 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
 package org.videolan.vlc.gui.tv;
 
 import android.support.v17.leanback.widget.AbstractDetailsDescriptionPresenter;
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/GridFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/GridFragment.java
new file mode 100644
index 0000000..f02fa05
--- /dev/null
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/GridFragment.java
@@ -0,0 +1,208 @@
+/*****************************************************************************
+ * GridFragment.java
+ *****************************************************************************
+ * Copyright © 2012-2014 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+package org.videolan.vlc.gui.tv;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+
+import org.videolan.libvlc.Media;
+import org.videolan.vlc.MediaDatabase;
+import org.videolan.vlc.MediaLibrary;
+import org.videolan.vlc.R;
+import org.videolan.vlc.Thumbnailer;
+import org.videolan.vlc.VLCApplication;
+import org.videolan.vlc.gui.video.VideoBrowserInterface;
+import org.videolan.vlc.gui.video.VideoPlayerActivity;
+import org.videolan.vlc.util.WeakHandler;
+
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.support.v17.leanback.app.VerticalGridFragment;
+import android.support.v17.leanback.widget.ArrayObjectAdapter;
+import android.support.v17.leanback.widget.OnItemClickedListener;
+import android.support.v17.leanback.widget.OnItemSelectedListener;
+import android.support.v17.leanback.widget.Row;
+import android.support.v17.leanback.widget.VerticalGridPresenter;
+import android.util.Log;
+
+public class GridFragment extends VerticalGridFragment implements VideoBrowserInterface {
+	private static final String TAG = "VerticalGridFragment";
+
+	private static final int NUM_COLUMNS = 5;
+
+	protected final CyclicBarrier mBarrier = new CyclicBarrier(2);
+	protected Media mItemToUpdate;
+	private ArrayObjectAdapter mAdapter;
+	private MediaLibrary mMediaLibrary;
+	private Thumbnailer mThumbnailer;
+	HashMap<String, Integer> mVideoIndex;
+	Context mContext;
+
+	@Override
+	public void onCreate(Bundle savedInstanceState) {
+		Log.i(TAG, "onCreate");
+		super.onCreate(savedInstanceState);
+		mContext = getActivity();
+
+		setTitle(getString(R.string.app_name_full));
+
+		mMediaLibrary = MediaLibrary.getInstance();
+		mThumbnailer = new Thumbnailer(mContext, getActivity().getWindowManager().getDefaultDisplay());
+		setupFragment();
+	}
+
+	public void onResume() {
+		super.onResume();
+		if (mMediaLibrary.isWorking()) {
+			actionScanStart();
+		}
+
+		/* Start the thumbnailer */
+		if (mThumbnailer != null)
+			mThumbnailer.start(this);
+	}
+
+	public void onPause() {
+		super.onPause();
+		mMediaLibrary.removeUpdateHandler(mHandler);
+
+		/* Stop the thumbnailer */
+		if (mThumbnailer != null)
+			mThumbnailer.stop();
+	}
+
+	@Override
+	public void onDestroy() {
+		super.onDestroy();
+		if (mThumbnailer != null)
+			mThumbnailer.clearJobs();
+		mBarrier.reset();
+	}
+
+	private void setupFragment() {
+		int size;
+		Media media;
+		Bitmap picture;
+
+		MediaDatabase mediaDatabase = MediaDatabase.getInstance();
+		VerticalGridPresenter gridPresenter = new VerticalGridPresenter();
+		mAdapter = new ArrayObjectAdapter(new CardPresenter());
+
+		gridPresenter.setNumberOfColumns(NUM_COLUMNS);
+		setGridPresenter(gridPresenter);
+
+
+		ArrayList<Media> videoList = mMediaLibrary.getVideoItems();
+		size = videoList.size();
+		mVideoIndex = new HashMap<String, Integer>(size);
+		
+		for (int i = 0 ; i < size ; ++i){
+			media = videoList.get(i);
+			picture = mediaDatabase.getPicture(mContext, media.getLocation());
+			mAdapter.add(media);
+			mVideoIndex.put(media.getLocation(), i);
+			if (mThumbnailer != null){
+				if (picture== null) {
+					mThumbnailer.addJob(media);
+				} else {
+					MediaDatabase.setPicture(media, picture);
+					picture = null;
+				}
+			}
+		}
+
+		setAdapter(mAdapter);
+
+		/*setOnItemSelectedListener(new OnItemSelectedListener() {
+			@Override
+			public void onItemSelected(Object item, Row row) {
+			}
+		});*/
+
+		setOnItemClickedListener(new OnItemClickedListener() {
+			@Override
+			public void onItemClicked(Object item, Row row) {
+				Media media = (Media)item;
+				if (media.getType() == Media.TYPE_VIDEO){
+					VideoPlayerActivity.start(getActivity(), media.getLocation(), false);
+				}
+			}
+		});
+	}
+
+	public void await() throws InterruptedException, BrokenBarrierException {
+		mBarrier.await();
+	}
+
+	public void resetBarrier() {
+		mBarrier.reset();
+	}
+	@Override
+	public void setItemToUpdate(Media item) {
+		mItemToUpdate = item;
+		mHandler.sendEmptyMessage(UPDATE_ITEM);
+	}
+
+	private void updateItem() {
+		mAdapter.notifyArrayItemRangeChanged(mVideoIndex.get(mItemToUpdate.getLocation()), 1);
+		try {
+			mBarrier.await();
+		} catch (InterruptedException e) {
+		} catch (BrokenBarrierException e) {}
+	}
+
+	public static void actionScanStart() {
+		Intent intent = new Intent();
+		intent.setAction(ACTION_SCAN_START);
+		VLCApplication.getAppContext().sendBroadcast(intent);
+	}
+
+	public static void actionScanStop() {
+		Intent intent = new Intent();
+		intent.setAction(ACTION_SCAN_STOP);
+		VLCApplication.getAppContext().sendBroadcast(intent);
+	}
+
+	private Handler mHandler = new VideoListHandler(this);
+
+	private static class VideoListHandler extends WeakHandler<GridFragment> {
+		public VideoListHandler(GridFragment owner) {
+			super(owner);
+		}
+
+		@Override
+		public void handleMessage(Message msg) {
+			GridFragment owner = getOwner();
+			if(owner == null) return;
+
+			switch (msg.what) {
+			case UPDATE_ITEM:
+				owner.updateItem();
+				break;
+			}
+		}
+	};
+}
\ No newline at end of file
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/MainFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/MainFragment.java
deleted file mode 100644
index ae5cc55..0000000
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MainFragment.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.videolan.vlc.gui.tv;
-
-import android.annotation.TargetApi;
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-
- at TargetApi(20)
-public class MainFragment extends Fragment {
-
-	
-}
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
index 7650cf1..cce4186 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MainTvActivity.java
@@ -1,3 +1,22 @@
+/*****************************************************************************
+ * MainTvActivity.java
+ *****************************************************************************
+ * Copyright © 2012-2014 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
 package org.videolan.vlc.gui.tv;
 
 import java.util.ArrayList;
@@ -17,15 +36,13 @@ import org.videolan.vlc.util.WeakHandler;
 
 import android.app.Activity;
 import android.app.FragmentManager;
-import android.content.ContentResolver;
 import android.content.Intent;
-import android.content.res.Resources;
 import android.graphics.Bitmap;
 import android.graphics.drawable.Drawable;
-import android.net.Uri;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
+import android.os.Parcelable;
 import android.support.v17.leanback.app.BackgroundManager;
 import android.support.v17.leanback.app.BrowseFragment;
 import android.support.v17.leanback.widget.ArrayObjectAdapter;
@@ -34,9 +51,10 @@ import android.support.v17.leanback.widget.ListRow;
 import android.support.v17.leanback.widget.ListRowPresenter;
 import android.support.v17.leanback.widget.OnItemClickedListener;
 import android.support.v17.leanback.widget.Row;
-import android.support.v4.app.FragmentActivity;
 
-public class MainTvActivity extends FragmentActivity implements VideoBrowserInterface {
+public class MainTvActivity extends Activity implements VideoBrowserInterface {
+
+	private static final int NUM_VIDEOS_PREVIEW = 5;
 
 	public static final String TAG = "BrowseActivity";
 
@@ -55,14 +73,21 @@ public class MainTvActivity extends FragmentActivity implements VideoBrowserInte
 	OnItemClickedListener mItemClickListener = new OnItemClickedListener() {
 		@Override
 		public void onItemClicked(Object item, Row row) {
-			VideoPlayerActivity.start(mContext, ((Media)item).getLocation(), false);
-			//code to launch a DetailActivity
-			//                    Intent intent = new Intent(MainTvActivity.this,
-			//                            DetailsActivity.class);
-			//                    // pass the item information
-			//                    intent.putExtra("id", row.getId());
-			//                    intent.putExtra("item", (Parcelable)item);
-			//                    startActivity(intent);
+			Media media = (Media)item;
+			if (media.getType() == Media.TYPE_VIDEO){
+				VideoPlayerActivity.start(mContext, media.getLocation(), false);
+			} else if (media.getType() == Media.TYPE_AUDIO){
+
+				Intent intent = new Intent(MainTvActivity.this,
+						DetailsActivity.class);
+				// pass the item information
+				intent.putExtra("id", row.getId());
+				intent.putExtra("item", (Parcelable)new TvMedia(0, media.getTitle(), media.getDescription(), media.getArtworkURL(), media.getArtworkURL(), media.getLocation()));
+				startActivity(intent);
+			} else if (media.getType() == Media.TYPE_GROUP){
+				Intent intent = new Intent(mContext, VerticalGridActivity.class);
+				startActivity(intent);
+			}
 		}
 	};
 
@@ -163,7 +188,7 @@ public class MainTvActivity extends FragmentActivity implements VideoBrowserInte
 			mVideoIndex = new HashMap<String, Integer>(size);
 			videoAdapter = new ArrayObjectAdapter(
 					new CardPresenter());
-			for (int i = 0 ; i < videoList.size() ; ++i) {
+			for (int i = 0 ; i < NUM_VIDEOS_PREVIEW ; ++i) {
 				item = videoList.get(i);
 				picture = mediaDatabase.getPicture(this, item.getLocation());
 
@@ -178,6 +203,9 @@ public class MainTvActivity extends FragmentActivity implements VideoBrowserInte
 					}
 				}
 			}
+			// Empty item to launch grid activity
+			videoAdapter.add(new Media(null, 0, 0, Media.TYPE_GROUP, null, "Browse more", null, null, null, 0, 0, null, 0, 0));
+
 			HeaderItem header = new HeaderItem(0, "Videos", null);
 			mRowsAdapter.add(new ListRow(header, videoAdapter));
 		}
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetails.java b/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetails.java
index a3eb779..343b31e 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetails.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetails.java
@@ -1,3 +1,22 @@
+/*****************************************************************************
+ * MediaItemDetails.java
+ *****************************************************************************
+ * Copyright © 2012-2014 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
 package org.videolan.vlc.gui.tv;
 
 public class MediaItemDetails {
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java
index d02025a..1ccbc5e 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java
@@ -1,5 +1,26 @@
+/*****************************************************************************
+ * MediaItemDetailsFragment.java
+ *****************************************************************************
+ * Copyright © 2012-2014 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
 package org.videolan.vlc.gui.tv;
 
+import org.videolan.vlc.R;
+
 import android.content.res.Resources;
 import android.os.Bundle;
 import android.support.v17.leanback.app.DetailsFragment;
@@ -43,7 +64,7 @@ public class MediaItemDetailsFragment extends DetailsFragment {
 		DetailsOverviewRow detailsOverview = new DetailsOverviewRow(new MediaItemDetails(media.getTitle(), media.getDescription(), "Big body"));
 
 		// Add images and action buttons to the details view
-		detailsOverview.setImageDrawable(res.getDrawable(media.getCardImageId()));
+		detailsOverview.setImageDrawable(res.getDrawable(R.drawable.cone));
 		detailsOverview.addAction(new Action(1, "Play"));
 		detailsOverview.addAction(new Action(2, "Delete"));
 		mRowsAdapter.add(detailsOverview);
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/StringPresenter.java b/vlc-android/src/org/videolan/vlc/gui/tv/StringPresenter.java
index 4eff8bc..34941e0 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/StringPresenter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/StringPresenter.java
@@ -1,3 +1,22 @@
+/*****************************************************************************
+ * StringPresenter.java
+ *****************************************************************************
+ * Copyright © 2012-2014 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
 package org.videolan.vlc.gui.tv;
 
 import org.videolan.vlc.R;
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/TvMedia.java b/vlc-android/src/org/videolan/vlc/gui/tv/TvMedia.java
index cc7381b..3e39875 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/TvMedia.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/TvMedia.java
@@ -1,3 +1,22 @@
+/*****************************************************************************
+ * TvMedia.java
+ *****************************************************************************
+ * Copyright © 2012-2014 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
 package org.videolan.vlc.gui.tv;
 
 import android.os.Parcel;
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/VerticalGridActivity.java b/vlc-android/src/org/videolan/vlc/gui/tv/VerticalGridActivity.java
new file mode 100644
index 0000000..8f60f5e
--- /dev/null
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/VerticalGridActivity.java
@@ -0,0 +1,36 @@
+/*****************************************************************************
+ * VerticalGridActivity.java
+ *****************************************************************************
+ * Copyright © 2012-2014 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+package org.videolan.vlc.gui.tv;
+
+import org.videolan.vlc.R;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+public class VerticalGridActivity extends Activity {
+
+    @Override
+    public void onCreate(Bundle savedInstanceState)
+    {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.tv_vertical_grid);
+        getWindow().setBackgroundDrawableResource(R.drawable.background);
+    }
+}
-- 
1.9.1



More information about the Android mailing list