Commit 0ba605e6e26475194551d0aa2d0feb34fba90fce
1 parent
a3a97c8f
--no commit message
Showing
4 changed files
with
18 additions
and
31 deletions
src/com/upc/pbe/upcnews/Directoris.java
... | ... | @@ -43,9 +43,7 @@ public class Directoris extends Activity implements OnClickListener { |
43 | 43 | Log.d(TAG, "Directori " + dirs.get(i).toString()); |
44 | 44 | buttons.get(i).setVisibility(View.VISIBLE); |
45 | 45 | buttons.get(i).setText(dirs.get(i)); |
46 | - | |
47 | 46 | } |
48 | - | |
49 | 47 | } |
50 | 48 | |
51 | 49 | public boolean onCreateOptionsMenu(Menu menu) { |
... | ... | @@ -70,37 +68,34 @@ public class Directoris extends Activity implements OnClickListener { |
70 | 68 | } |
71 | 69 | |
72 | 70 | public void onClick(View c) { |
73 | - | |
74 | 71 | switch (c.getId()) { |
75 | - | |
76 | - case R.id.button1: { | |
77 | - this.buttonClicked(buttons.get(0)); | |
78 | - break; | |
79 | - | |
80 | - } | |
81 | - case R.id.button2: { | |
82 | - this.buttonClicked(buttons.get(1)); | |
83 | - break; | |
84 | - } | |
85 | - case R.id.button3: { | |
86 | - this.buttonClicked(buttons.get(2)); | |
87 | - break; | |
88 | - } | |
89 | - case R.id.button4: { | |
90 | - this.buttonClicked(buttons.get(3)); | |
91 | - break; | |
92 | - } | |
72 | + case R.id.button1: { | |
73 | + this.buttonClicked(buttons.get(0)); | |
74 | + break; | |
75 | + | |
76 | + } | |
77 | + case R.id.button2: { | |
78 | + this.buttonClicked(buttons.get(1)); | |
79 | + break; | |
80 | + } | |
81 | + case R.id.button3: { | |
82 | + this.buttonClicked(buttons.get(2)); | |
83 | + break; | |
84 | + } | |
85 | + case R.id.button4: { | |
86 | + this.buttonClicked(buttons.get(3)); | |
87 | + break; | |
88 | + } | |
93 | 89 | } |
94 | 90 | } |
95 | 91 | |
96 | 92 | public void crearButtons() { |
97 | - | |
98 | 93 | buttons.add((Button) findViewById(R.id.button1)); |
99 | 94 | buttons.add((Button) findViewById(R.id.button2)); |
100 | 95 | buttons.add((Button) findViewById(R.id.button3)); |
101 | 96 | buttons.add((Button) findViewById(R.id.button4)); |
102 | 97 | buttons.add((Button) findViewById(R.id.button5)); |
103 | - | |
98 | + | |
104 | 99 | for (int i = 0; i < buttons.size(); i++) { |
105 | 100 | buttons.get(i).setOnClickListener(this); |
106 | 101 | buttons.get(i).setVisibility(View.GONE); |
... | ... | @@ -108,7 +103,6 @@ public class Directoris extends Activity implements OnClickListener { |
108 | 103 | } |
109 | 104 | |
110 | 105 | public void buttonClicked(Button b) { |
111 | - | |
112 | 106 | Log.d(TAG, "Click on " + b.getText()); |
113 | 107 | d = new Descarrega(url + "/" + b.getText() + "/", file, folder); |
114 | 108 | String str = d.doInBackground(); | ... | ... |
src/com/upc/pbe/upcnews/HTMLParser.java
src/com/upc/pbe/upcnews/MainActivity.java
... | ... | @@ -72,13 +72,9 @@ public class MainActivity extends Activity implements OnClickListener { |
72 | 72 | |
73 | 73 | public void onClick(View v) { |
74 | 74 | Log.d(TAG, "onClicked"); |
75 | - | |
76 | - | |
77 | - | |
78 | 75 | this.descarregar(); |
79 | 76 | ((UpcApp) getApplication()).setDesc(html); |
80 | 77 | startActivity(new Intent(this, Directoris.class)); |
81 | - | |
82 | 78 | } |
83 | 79 | |
84 | 80 | public void descarregar() { |
... | ... | @@ -101,5 +97,4 @@ public class MainActivity extends Activity implements OnClickListener { |
101 | 97 | return false; |
102 | 98 | } |
103 | 99 | } |
104 | - | |
105 | 100 | } |
106 | 101 | \ No newline at end of file | ... | ... |