From c89d05ed06897505b502dcf51b2ae3a76660e6a7 Mon Sep 17 00:00:00 2001 From: Equip de Desenvolupadors de PBE Date: Wed, 5 Dec 2012 14:14:27 +0000 Subject: [PATCH] Primer intent VideoActivity --- AndroidManifest.xml | 30 ++++++++++++++++++++++-------- gen/com/upc/pbe/upcnews/R.java | 49 +++++++++++++++++++++++++++---------------------- res/layout/activity_video.xml | 13 +++++++++++++ res/menu/activity_video.xml | 5 +++++ res/values/strings.xml | 2 ++ src/com/upc/pbe/upcnews/Directoris.java | 6 +++++- src/com/upc/pbe/upcnews/VideoActivity.java | 34 ++++++++++++++++++++++++++++++++++ 7 files changed, 108 insertions(+), 31 deletions(-) create mode 100644 res/layout/activity_video.xml create mode 100644 res/menu/activity_video.xml create mode 100644 src/com/upc/pbe/upcnews/VideoActivity.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 8cfb9a6..d52356d 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -6,12 +6,13 @@ - + + - - - + + + - - - - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gen/com/upc/pbe/upcnews/R.java b/gen/com/upc/pbe/upcnews/R.java index ba09742..7054edd 100644 --- a/gen/com/upc/pbe/upcnews/R.java +++ b/gen/com/upc/pbe/upcnews/R.java @@ -16,33 +16,36 @@ public final class R { public static final int ic_menu_name=0x7f020002; } public static final class id { - public static final int AbsoluteLayout1=0x7f080009; - public static final int ImageView01=0x7f08000b; - public static final int ImageView1=0x7f08000a; - public static final int LinearLayout1=0x7f080000; - public static final int button=0x7f08000e; - public static final int button1=0x7f080002; - public static final int button2=0x7f080003; - public static final int button3=0x7f080004; - public static final int button4=0x7f080005; - public static final int button5=0x7f080006; - public static final int itemhelp=0x7f080011; - public static final int itemprefs=0x7f080010; - public static final int menu_settings=0x7f08000f; - public static final int textView1=0x7f080007; - public static final int textView2=0x7f080008; - public static final int textViewRoute=0x7f08000c; - public static final int textViewTitle=0x7f080001; - public static final int textViewXml=0x7f08000d; + public static final int AbsoluteLayout1=0x7f08000a; + public static final int ImageView01=0x7f08000c; + public static final int ImageView1=0x7f08000b; + public static final int LinearLayout1=0x7f080001; + public static final int button=0x7f08000f; + public static final int button1=0x7f080003; + public static final int button2=0x7f080004; + public static final int button3=0x7f080005; + public static final int button4=0x7f080006; + public static final int button5=0x7f080007; + public static final int itemhelp=0x7f080012; + public static final int itemprefs=0x7f080011; + public static final int menu_settings=0x7f080010; + public static final int textView1=0x7f080008; + public static final int textView2=0x7f080009; + public static final int textViewRoute=0x7f08000d; + public static final int textViewTitle=0x7f080002; + public static final int textViewXml=0x7f08000e; + public static final int videoView1=0x7f080000; } public static final class layout { - public static final int dirs=0x7f030000; - public static final int help=0x7f030001; - public static final int main_activity=0x7f030002; + public static final int activity_video=0x7f030000; + public static final int dirs=0x7f030001; + public static final int help=0x7f030002; + public static final int main_activity=0x7f030003; } public static final class menu { public static final int activity_main=0x7f070000; - public static final int menu=0x7f070001; + public static final int activity_video=0x7f070001; + public static final int menu=0x7f070002; } public static final class string { public static final int app_name=0x7f050000; @@ -52,6 +55,7 @@ public final class R { public static final int descarregar=0x7f050003; public static final int dir=0x7f05000a; public static final int directoris=0x7f05000b; + public static final int hello_world=0x7f050010; public static final int help=0x7f050008; public static final int hint=0x7f050004; public static final int logodescription=0x7f05000f; @@ -59,6 +63,7 @@ public final class R { public static final int prefs=0x7f050007; public static final int title=0x7f05000e; public static final int title_activity_main=0x7f050002; + public static final int title_activity_video=0x7f050011; public static final int url=0x7f050005; public static final int urlhint=0x7f050006; } diff --git a/res/layout/activity_video.xml b/res/layout/activity_video.xml new file mode 100644 index 0000000..5295250 --- /dev/null +++ b/res/layout/activity_video.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/res/menu/activity_video.xml b/res/menu/activity_video.xml new file mode 100644 index 0000000..44a11e7 --- /dev/null +++ b/res/menu/activity_video.xml @@ -0,0 +1,5 @@ + + + diff --git a/res/values/strings.xml b/res/values/strings.xml index 82fe3de..f68c8b2 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -16,5 +16,7 @@ Play Directories found: Logo Image + Hello world! + VideoActivity \ No newline at end of file diff --git a/src/com/upc/pbe/upcnews/Directoris.java b/src/com/upc/pbe/upcnews/Directoris.java index be612e4..8f31686 100644 --- a/src/com/upc/pbe/upcnews/Directoris.java +++ b/src/com/upc/pbe/upcnews/Directoris.java @@ -134,6 +134,10 @@ public class Directoris extends Activity implements OnClickListener { Log.d(TAG, e.getMessage()); } } - + + //VideoPlayer + String urlvid = null; + ((UpcApp) getApplication()).setDesc(urlvid); + startActivity(new Intent(this, VideoActivity.class)); } } \ No newline at end of file diff --git a/src/com/upc/pbe/upcnews/VideoActivity.java b/src/com/upc/pbe/upcnews/VideoActivity.java new file mode 100644 index 0000000..f5cbe61 --- /dev/null +++ b/src/com/upc/pbe/upcnews/VideoActivity.java @@ -0,0 +1,34 @@ +package com.upc.pbe.upcnews; + +import android.net.Uri; +import android.os.Bundle; +import android.app.Activity; +import android.view.Menu; +import android.widget.MediaController; +import android.widget.VideoView; + +public class VideoActivity extends Activity { + + VideoView video; + String url; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_video); + url = ((UpcApp) getApplication()).getDesc(); + + //Creacio del VideoPlayer associat a una URL + video = (VideoView) findViewById(R.id.videoView1); + video.setVideoURI(Uri.parse(url)); + video.setMediaController(new MediaController(this)); + video.start(); + video.requestFocus(); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.activity_video, menu); + return true; + } +} -- libgit2 0.22.2