Commit 9ecb2b3c49861b68178955bd8d02d04d90dc4508
1 parent
44dc9d20
Pantalla principal
Showing
8 changed files
with
111 additions
and
95 deletions
gen/com/upc/pbe/upcnews/R.java
1 | -/* AUTO-GENERATED FILE. DO NOT MODIFY. | ||
2 | - * | ||
3 | - * This class was automatically generated by the | ||
4 | - * aapt tool from the resource data it found. It | ||
5 | - * should not be modified by hand. | ||
6 | - */ | ||
7 | - | ||
8 | -package com.upc.pbe.upcnews; | ||
9 | - | ||
10 | -public final class R { | ||
11 | - public static final class attr { | ||
12 | - } | ||
13 | - public static final class dimen { | ||
14 | - public static final int TitleSize=0x7f050000; | ||
15 | - } | ||
16 | - public static final class drawable { | ||
17 | - public static final int ic_action_search=0x7f020000; | ||
18 | - public static final int ic_launcher=0x7f020001; | ||
19 | - public static final int ic_menu_name=0x7f020002; | ||
20 | - public static final int ic_startbutton=0x7f020003; | ||
21 | - } | ||
22 | - public static final class id { | ||
23 | - public static final int AbsoluteLayout1=0x7f090006; | ||
24 | - public static final int LinearLayout1=0x7f090001; | ||
25 | - public static final int button=0x7f090007; | ||
26 | - public static final int itemhelp=0x7f09000c; | ||
27 | - public static final int itemprefs=0x7f09000b; | ||
28 | - public static final int listView1=0x7f090003; | ||
29 | - public static final int menu_settings=0x7f09000a; | ||
30 | - public static final int rowTextView=0x7f090009; | ||
31 | - public static final int textView1=0x7f090004; | ||
32 | - public static final int textView2=0x7f090005; | ||
33 | - public static final int textViewTitle=0x7f090002; | ||
34 | - public static final int textViewXml=0x7f090008; | ||
35 | - public static final int videoView1=0x7f090000; | ||
36 | - } | ||
37 | - public static final class layout { | ||
38 | - public static final int activity_video=0x7f030000; | ||
39 | - public static final int dirs=0x7f030001; | ||
40 | - public static final int help=0x7f030002; | ||
41 | - public static final int main_activity=0x7f030003; | ||
42 | - public static final int rowlayout=0x7f030004; | ||
43 | - } | ||
44 | - public static final class menu { | ||
45 | - public static final int activity_main=0x7f080000; | ||
46 | - public static final int activity_video=0x7f080001; | ||
47 | - public static final int menu=0x7f080002; | ||
48 | - } | ||
49 | - public static final class string { | ||
50 | - public static final int app_name=0x7f060000; | ||
51 | - public static final int button=0x7f06000c; | ||
52 | - public static final int button1=0x7f06000d; | ||
53 | - public static final int desc=0x7f060009; | ||
54 | - public static final int descarregar=0x7f060003; | ||
55 | - public static final int dir=0x7f06000a; | ||
56 | - public static final int directoris=0x7f06000b; | ||
57 | - public static final int hello_world=0x7f060010; | ||
58 | - public static final int help=0x7f060008; | ||
59 | - public static final int hint=0x7f060004; | ||
60 | - public static final int menu_settings=0x7f060001; | ||
61 | - public static final int prefs=0x7f060007; | ||
62 | - public static final int startbuttondescription=0x7f06000f; | ||
63 | - public static final int title=0x7f06000e; | ||
64 | - public static final int title_activity_main=0x7f060002; | ||
65 | - public static final int title_activity_video=0x7f060011; | ||
66 | - public static final int url=0x7f060005; | ||
67 | - public static final int urlhint=0x7f060006; | ||
68 | - } | ||
69 | - public static final class style { | ||
70 | - public static final int AppTheme=0x7f070000; | ||
71 | - } | ||
72 | - public static final class xml { | ||
73 | - public static final int prefs=0x7f040000; | ||
74 | - } | ||
75 | -} | 1 | +/* AUTO-GENERATED FILE. DO NOT MODIFY. |
2 | + * | ||
3 | + * This class was automatically generated by the | ||
4 | + * aapt tool from the resource data it found. It | ||
5 | + * should not be modified by hand. | ||
6 | + */ | ||
7 | + | ||
8 | +package com.upc.pbe.upcnews; | ||
9 | + | ||
10 | +public final class R { | ||
11 | + public static final class attr { | ||
12 | + } | ||
13 | + public static final class dimen { | ||
14 | + public static final int TitleSize=0x7f050000; | ||
15 | + } | ||
16 | + public static final class drawable { | ||
17 | + public static final int ic_action_search=0x7f020000; | ||
18 | + public static final int ic_launcher=0x7f020001; | ||
19 | + public static final int ic_menu_name=0x7f020002; | ||
20 | + public static final int ic_startbutton=0x7f020003; | ||
21 | + } | ||
22 | + public static final class id { | ||
23 | + public static final int AbsoluteLayout1=0x7f090006; | ||
24 | + public static final int LinearLayout1=0x7f090001; | ||
25 | + public static final int button=0x7f090008; | ||
26 | + public static final int itemhelp=0x7f09000c; | ||
27 | + public static final int itemprefs=0x7f09000b; | ||
28 | + public static final int listView1=0x7f090003; | ||
29 | + public static final int menu_settings=0x7f09000a; | ||
30 | + public static final int rowTextView=0x7f090009; | ||
31 | + public static final int textView1=0x7f090004; | ||
32 | + public static final int textView2=0x7f090005; | ||
33 | + public static final int textViewTitle=0x7f090002; | ||
34 | + public static final int textViewXml=0x7f090007; | ||
35 | + public static final int videoView1=0x7f090000; | ||
36 | + } | ||
37 | + public static final class layout { | ||
38 | + public static final int activity_video=0x7f030000; | ||
39 | + public static final int dirs=0x7f030001; | ||
40 | + public static final int help=0x7f030002; | ||
41 | + public static final int main_activity=0x7f030003; | ||
42 | + public static final int rowlayout=0x7f030004; | ||
43 | + } | ||
44 | + public static final class menu { | ||
45 | + public static final int activity_main=0x7f080000; | ||
46 | + public static final int activity_video=0x7f080001; | ||
47 | + public static final int menu=0x7f080002; | ||
48 | + } | ||
49 | + public static final class string { | ||
50 | + public static final int app_name=0x7f060000; | ||
51 | + public static final int button=0x7f06000c; | ||
52 | + public static final int button1=0x7f06000d; | ||
53 | + public static final int desc=0x7f060009; | ||
54 | + public static final int descarregar=0x7f060003; | ||
55 | + public static final int dir=0x7f06000a; | ||
56 | + public static final int directoris=0x7f06000b; | ||
57 | + public static final int hello_world=0x7f060010; | ||
58 | + public static final int help=0x7f060008; | ||
59 | + public static final int hint=0x7f060004; | ||
60 | + public static final int menu_settings=0x7f060001; | ||
61 | + public static final int prefs=0x7f060007; | ||
62 | + public static final int startbuttondescription=0x7f06000f; | ||
63 | + public static final int title=0x7f06000e; | ||
64 | + public static final int title_activity_main=0x7f060002; | ||
65 | + public static final int title_activity_video=0x7f060011; | ||
66 | + public static final int url=0x7f060005; | ||
67 | + public static final int urlhint=0x7f060006; | ||
68 | + } | ||
69 | + public static final class style { | ||
70 | + public static final int AppTheme=0x7f070000; | ||
71 | + } | ||
72 | + public static final class xml { | ||
73 | + public static final int prefs=0x7f040000; | ||
74 | + } | ||
75 | +} |
res/drawable-hdpi/ic_startbutton.png
res/drawable-ldpi/ic_startbutton.png
res/drawable-mdpi/ic_startbutton.png
res/drawable-xhdpi/ic_startbutton.png
res/layout/main_activity.xml
@@ -2,28 +2,28 @@ | @@ -2,28 +2,28 @@ | ||
2 | <AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:tools="http://schemas.android.com/tools" | 3 | xmlns:tools="http://schemas.android.com/tools" |
4 | android:id="@+id/AbsoluteLayout1" | 4 | android:id="@+id/AbsoluteLayout1" |
5 | - android:layout_width="wrap_content" | ||
6 | - android:layout_height="match_parent" | 5 | + android:layout_width="fill_parent" |
6 | + android:layout_height="fill_parent" | ||
7 | tools:ignore="Deprecated" > | 7 | tools:ignore="Deprecated" > |
8 | - | ||
9 | - <ImageButton | ||
10 | - android:id="@+id/button" | ||
11 | - android:layout_width="171dp" | ||
12 | - android:layout_height="161dp" | ||
13 | - android:layout_x="78dp" | ||
14 | - android:layout_y="88dp" | ||
15 | - android:background="@drawable/ic_startbutton" | ||
16 | - android:contentDescription="@string/startbuttondescription" /> | ||
17 | 8 | ||
18 | <TextView | 9 | <TextView |
19 | android:id="@+id/textViewXml" | 10 | android:id="@+id/textViewXml" |
20 | android:layout_width="wrap_content" | 11 | android:layout_width="wrap_content" |
21 | android:layout_height="wrap_content" | 12 | android:layout_height="wrap_content" |
22 | - android:layout_x="43dp" | ||
23 | - android:layout_y="276dp" | 13 | + android:layout_x="38dp" |
14 | + android:layout_y="423dp" | ||
24 | android:gravity="clip_vertical" | 15 | android:gravity="clip_vertical" |
25 | android:hint="@string/hint" | 16 | android:hint="@string/hint" |
26 | android:scrollbarStyle="insideInset" | 17 | android:scrollbarStyle="insideInset" |
27 | android:scrollbars="vertical" /> | 18 | android:scrollbars="vertical" /> |
28 | 19 | ||
20 | + <ImageButton | ||
21 | + android:id="@+id/button" | ||
22 | + android:layout_width="256dp" | ||
23 | + android:layout_height="256dp" | ||
24 | + android:layout_x="32dp" | ||
25 | + android:layout_y="84dp" | ||
26 | + android:background="@drawable/ic_startbutton" | ||
27 | + android:contentDescription="@string/startbuttondescription" /> | ||
28 | + | ||
29 | </AbsoluteLayout> | 29 | </AbsoluteLayout> |
30 | \ No newline at end of file | 30 | \ No newline at end of file |
src/com/upc/pbe/upcnews/Directoris.java
@@ -4,6 +4,7 @@ import java.util.ArrayList; | @@ -4,6 +4,7 @@ import java.util.ArrayList; | ||
4 | 4 | ||
5 | import android.app.Activity; | 5 | import android.app.Activity; |
6 | import android.content.Intent; | 6 | import android.content.Intent; |
7 | +import android.graphics.Typeface; | ||
7 | import android.os.Bundle; | 8 | import android.os.Bundle; |
8 | import android.util.Log; | 9 | import android.util.Log; |
9 | import android.view.KeyEvent; | 10 | import android.view.KeyEvent; |
@@ -66,6 +67,13 @@ public class Directoris extends Activity implements OnItemClickListener | @@ -66,6 +67,13 @@ public class Directoris extends Activity implements OnItemClickListener | ||
66 | } | 67 | } |
67 | } | 68 | } |
68 | 69 | ||
70 | + public void showResources() | ||
71 | + { | ||
72 | + ArrayList<String> entries = parser.parse(d.doInBackground(currentFolder)); | ||
73 | + this.createEntries(entries); | ||
74 | + this.styleEntries(); | ||
75 | + } | ||
76 | + | ||
69 | public void createEntries(ArrayList<String> directories) | 77 | public void createEntries(ArrayList<String> directories) |
70 | { | 78 | { |
71 | String[] entries = directories.toArray(new String[directories.size()]); | 79 | String[] entries = directories.toArray(new String[directories.size()]); |
@@ -75,6 +83,19 @@ public class Directoris extends Activity implements OnItemClickListener | @@ -75,6 +83,19 @@ public class Directoris extends Activity implements OnItemClickListener | ||
75 | listView.setAdapter(adapter); | 83 | listView.setAdapter(adapter); |
76 | } | 84 | } |
77 | 85 | ||
86 | + public void styleEntries() | ||
87 | + { | ||
88 | + ListView listView = (ListView) findViewById(R.id.listView1); | ||
89 | + for(int i = 0; i < listView.getCount(); i++) | ||
90 | + { | ||
91 | + TextView text = (TextView) listView.getAdapter().getView(i,null,null); | ||
92 | + if(text.getText().toString().endsWith(".m3u8")) | ||
93 | + { | ||
94 | + text.setTypeface(null,Typeface.BOLD); | ||
95 | + } | ||
96 | + } | ||
97 | + } | ||
98 | + | ||
78 | public void onItemClick(AdapterView<?> parent, View view, int position, long id) | 99 | public void onItemClick(AdapterView<?> parent, View view, int position, long id) |
79 | { | 100 | { |
80 | String path = ((TextView)view).getText().toString(); | 101 | String path = ((TextView)view).getText().toString(); |
@@ -122,11 +143,7 @@ public class Directoris extends Activity implements OnItemClickListener | @@ -122,11 +143,7 @@ public class Directoris extends Activity implements OnItemClickListener | ||
122 | } | 143 | } |
123 | } | 144 | } |
124 | 145 | ||
125 | - public void showResources() | ||
126 | - { | ||
127 | - ArrayList<String> entries = parser.parse(d.doInBackground(currentFolder)); | ||
128 | - this.createEntries(entries); | ||
129 | - } | 146 | + |
130 | 147 | ||
131 | public boolean onKeyDown(int keyCode, KeyEvent event) { | 148 | public boolean onKeyDown(int keyCode, KeyEvent event) { |
132 | if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) | 149 | if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) |
src/com/upc/pbe/upcnews/MainActivity.java
@@ -24,7 +24,7 @@ public class MainActivity extends Activity implements OnClickListener { | @@ -24,7 +24,7 @@ public class MainActivity extends Activity implements OnClickListener { | ||
24 | ImageButton buttonDescarrega; | 24 | ImageButton buttonDescarrega; |
25 | String file = "ejemplo.xml"; | 25 | String file = "ejemplo.xml"; |
26 | String folder = "Environment.getExternalStorageDirectory.getPath()"; | 26 | String folder = "Environment.getExternalStorageDirectory.getPath()"; |
27 | - TextView showText, showRoute; | 27 | + TextView showText; |
28 | 28 | ||
29 | 29 | ||
30 | @Override | 30 | @Override |
@@ -68,7 +68,6 @@ public class MainActivity extends Activity implements OnClickListener { | @@ -68,7 +68,6 @@ public class MainActivity extends Activity implements OnClickListener { | ||
68 | 68 | ||
69 | public String getUrl() { | 69 | public String getUrl() { |
70 | String u = ((UpcApp) getApplication()).getUrl(); | 70 | String u = ((UpcApp) getApplication()).getUrl(); |
71 | - showRoute.setText("Server: " + u); | ||
72 | return u; | 71 | return u; |
73 | } | 72 | } |
74 | 73 |