From 9ecb2b3c49861b68178955bd8d02d04d90dc4508 Mon Sep 17 00:00:00 2001 From: Equip de Desenvolupadors de PBE Date: Sat, 8 Dec 2012 12:03:40 +0000 Subject: [PATCH] Pantalla principal --- gen/com/upc/pbe/upcnews/R.java | 150 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------- res/drawable-hdpi/ic_startbutton.png | Bin 1387 -> 0 bytes res/drawable-ldpi/ic_startbutton.png | Bin 608 -> 0 bytes res/drawable-mdpi/ic_startbutton.png | Bin 848 -> 0 bytes res/drawable-xhdpi/ic_startbutton.png | Bin 1998 -> 0 bytes res/layout/main_activity.xml | 26 +++++++++++++------------- src/com/upc/pbe/upcnews/Directoris.java | 27 ++++++++++++++++++++++----- src/com/upc/pbe/upcnews/MainActivity.java | 3 +-- 8 files changed, 111 insertions(+), 95 deletions(-) diff --git a/gen/com/upc/pbe/upcnews/R.java b/gen/com/upc/pbe/upcnews/R.java index d0392eb..156bc0f 100644 --- a/gen/com/upc/pbe/upcnews/R.java +++ b/gen/com/upc/pbe/upcnews/R.java @@ -1,75 +1,75 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package com.upc.pbe.upcnews; - -public final class R { - public static final class attr { - } - public static final class dimen { - public static final int TitleSize=0x7f050000; - } - public static final class drawable { - public static final int ic_action_search=0x7f020000; - public static final int ic_launcher=0x7f020001; - public static final int ic_menu_name=0x7f020002; - public static final int ic_startbutton=0x7f020003; - } - public static final class id { - public static final int AbsoluteLayout1=0x7f090006; - public static final int LinearLayout1=0x7f090001; - public static final int button=0x7f090007; - public static final int itemhelp=0x7f09000c; - public static final int itemprefs=0x7f09000b; - public static final int listView1=0x7f090003; - public static final int menu_settings=0x7f09000a; - public static final int rowTextView=0x7f090009; - public static final int textView1=0x7f090004; - public static final int textView2=0x7f090005; - public static final int textViewTitle=0x7f090002; - public static final int textViewXml=0x7f090008; - public static final int videoView1=0x7f090000; - } - public static final class layout { - 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 int rowlayout=0x7f030004; - } - public static final class menu { - public static final int activity_main=0x7f080000; - public static final int activity_video=0x7f080001; - public static final int menu=0x7f080002; - } - public static final class string { - public static final int app_name=0x7f060000; - public static final int button=0x7f06000c; - public static final int button1=0x7f06000d; - public static final int desc=0x7f060009; - public static final int descarregar=0x7f060003; - public static final int dir=0x7f06000a; - public static final int directoris=0x7f06000b; - public static final int hello_world=0x7f060010; - public static final int help=0x7f060008; - public static final int hint=0x7f060004; - public static final int menu_settings=0x7f060001; - public static final int prefs=0x7f060007; - public static final int startbuttondescription=0x7f06000f; - public static final int title=0x7f06000e; - public static final int title_activity_main=0x7f060002; - public static final int title_activity_video=0x7f060011; - public static final int url=0x7f060005; - public static final int urlhint=0x7f060006; - } - public static final class style { - public static final int AppTheme=0x7f070000; - } - public static final class xml { - public static final int prefs=0x7f040000; - } -} +/* AUTO-GENERATED FILE. DO NOT MODIFY. + * + * This class was automatically generated by the + * aapt tool from the resource data it found. It + * should not be modified by hand. + */ + +package com.upc.pbe.upcnews; + +public final class R { + public static final class attr { + } + public static final class dimen { + public static final int TitleSize=0x7f050000; + } + public static final class drawable { + public static final int ic_action_search=0x7f020000; + public static final int ic_launcher=0x7f020001; + public static final int ic_menu_name=0x7f020002; + public static final int ic_startbutton=0x7f020003; + } + public static final class id { + public static final int AbsoluteLayout1=0x7f090006; + public static final int LinearLayout1=0x7f090001; + public static final int button=0x7f090008; + public static final int itemhelp=0x7f09000c; + public static final int itemprefs=0x7f09000b; + public static final int listView1=0x7f090003; + public static final int menu_settings=0x7f09000a; + public static final int rowTextView=0x7f090009; + public static final int textView1=0x7f090004; + public static final int textView2=0x7f090005; + public static final int textViewTitle=0x7f090002; + public static final int textViewXml=0x7f090007; + public static final int videoView1=0x7f090000; + } + public static final class layout { + 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 int rowlayout=0x7f030004; + } + public static final class menu { + public static final int activity_main=0x7f080000; + public static final int activity_video=0x7f080001; + public static final int menu=0x7f080002; + } + public static final class string { + public static final int app_name=0x7f060000; + public static final int button=0x7f06000c; + public static final int button1=0x7f06000d; + public static final int desc=0x7f060009; + public static final int descarregar=0x7f060003; + public static final int dir=0x7f06000a; + public static final int directoris=0x7f06000b; + public static final int hello_world=0x7f060010; + public static final int help=0x7f060008; + public static final int hint=0x7f060004; + public static final int menu_settings=0x7f060001; + public static final int prefs=0x7f060007; + public static final int startbuttondescription=0x7f06000f; + public static final int title=0x7f06000e; + public static final int title_activity_main=0x7f060002; + public static final int title_activity_video=0x7f060011; + public static final int url=0x7f060005; + public static final int urlhint=0x7f060006; + } + public static final class style { + public static final int AppTheme=0x7f070000; + } + public static final class xml { + public static final int prefs=0x7f040000; + } +} diff --git a/res/drawable-hdpi/ic_startbutton.png b/res/drawable-hdpi/ic_startbutton.png index f348c6a..ac8b4bc 100644 Binary files a/res/drawable-hdpi/ic_startbutton.png and b/res/drawable-hdpi/ic_startbutton.png differ diff --git a/res/drawable-ldpi/ic_startbutton.png b/res/drawable-ldpi/ic_startbutton.png index 0b346d4..7c807b2 100644 Binary files a/res/drawable-ldpi/ic_startbutton.png and b/res/drawable-ldpi/ic_startbutton.png differ diff --git a/res/drawable-mdpi/ic_startbutton.png b/res/drawable-mdpi/ic_startbutton.png index ae5895e..21310b7 100644 Binary files a/res/drawable-mdpi/ic_startbutton.png and b/res/drawable-mdpi/ic_startbutton.png differ diff --git a/res/drawable-xhdpi/ic_startbutton.png b/res/drawable-xhdpi/ic_startbutton.png index 772f38c..467e203 100644 Binary files a/res/drawable-xhdpi/ic_startbutton.png and b/res/drawable-xhdpi/ic_startbutton.png differ diff --git a/res/layout/main_activity.xml b/res/layout/main_activity.xml index 2cfc901..bef827d 100644 --- a/res/layout/main_activity.xml +++ b/res/layout/main_activity.xml @@ -2,28 +2,28 @@ - - + + \ 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 9ea3a10..99937cb 100644 --- a/src/com/upc/pbe/upcnews/Directoris.java +++ b/src/com/upc/pbe/upcnews/Directoris.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import android.app.Activity; import android.content.Intent; +import android.graphics.Typeface; import android.os.Bundle; import android.util.Log; import android.view.KeyEvent; @@ -66,6 +67,13 @@ public class Directoris extends Activity implements OnItemClickListener } } + public void showResources() + { + ArrayList entries = parser.parse(d.doInBackground(currentFolder)); + this.createEntries(entries); + this.styleEntries(); + } + public void createEntries(ArrayList directories) { String[] entries = directories.toArray(new String[directories.size()]); @@ -75,6 +83,19 @@ public class Directoris extends Activity implements OnItemClickListener listView.setAdapter(adapter); } + public void styleEntries() + { + ListView listView = (ListView) findViewById(R.id.listView1); + for(int i = 0; i < listView.getCount(); i++) + { + TextView text = (TextView) listView.getAdapter().getView(i,null,null); + if(text.getText().toString().endsWith(".m3u8")) + { + text.setTypeface(null,Typeface.BOLD); + } + } + } + public void onItemClick(AdapterView parent, View view, int position, long id) { String path = ((TextView)view).getText().toString(); @@ -122,11 +143,7 @@ public class Directoris extends Activity implements OnItemClickListener } } - public void showResources() - { - ArrayList entries = parser.parse(d.doInBackground(currentFolder)); - this.createEntries(entries); - } + public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) diff --git a/src/com/upc/pbe/upcnews/MainActivity.java b/src/com/upc/pbe/upcnews/MainActivity.java index 992bbc8..454503d 100644 --- a/src/com/upc/pbe/upcnews/MainActivity.java +++ b/src/com/upc/pbe/upcnews/MainActivity.java @@ -24,7 +24,7 @@ public class MainActivity extends Activity implements OnClickListener { ImageButton buttonDescarrega; String file = "ejemplo.xml"; String folder = "Environment.getExternalStorageDirectory.getPath()"; - TextView showText, showRoute; + TextView showText; @Override @@ -68,7 +68,6 @@ public class MainActivity extends Activity implements OnClickListener { public String getUrl() { String u = ((UpcApp) getApplication()).getUrl(); - showRoute.setText("Server: " + u); return u; } -- libgit2 0.22.2