From 0ba605e6e26475194551d0aa2d0feb34fba90fce Mon Sep 17 00:00:00 2001 From: Equip de Desenvolupadors de PBE Date: Thu, 29 Nov 2012 14:45:03 +0000 Subject: [PATCH] --- src/com/upc/pbe/upcnews/Directoris.java | 42 ++++++++++++++++++------------------------ src/com/upc/pbe/upcnews/HTMLParser.java | 1 - src/com/upc/pbe/upcnews/MainActivity.java | 5 ----- src/com/upc/pbe/upcnews/UpcApp.java | 1 - 4 files changed, 18 insertions(+), 31 deletions(-) diff --git a/src/com/upc/pbe/upcnews/Directoris.java b/src/com/upc/pbe/upcnews/Directoris.java index 952fd79..ab3de74 100644 --- a/src/com/upc/pbe/upcnews/Directoris.java +++ b/src/com/upc/pbe/upcnews/Directoris.java @@ -43,9 +43,7 @@ public class Directoris extends Activity implements OnClickListener { Log.d(TAG, "Directori " + dirs.get(i).toString()); buttons.get(i).setVisibility(View.VISIBLE); buttons.get(i).setText(dirs.get(i)); - } - } public boolean onCreateOptionsMenu(Menu menu) { @@ -70,37 +68,34 @@ public class Directoris extends Activity implements OnClickListener { } public void onClick(View c) { - switch (c.getId()) { - - case R.id.button1: { - this.buttonClicked(buttons.get(0)); - break; - - } - case R.id.button2: { - this.buttonClicked(buttons.get(1)); - break; - } - case R.id.button3: { - this.buttonClicked(buttons.get(2)); - break; - } - case R.id.button4: { - this.buttonClicked(buttons.get(3)); - break; - } + case R.id.button1: { + this.buttonClicked(buttons.get(0)); + break; + + } + case R.id.button2: { + this.buttonClicked(buttons.get(1)); + break; + } + case R.id.button3: { + this.buttonClicked(buttons.get(2)); + break; + } + case R.id.button4: { + this.buttonClicked(buttons.get(3)); + break; + } } } public void crearButtons() { - buttons.add((Button) findViewById(R.id.button1)); buttons.add((Button) findViewById(R.id.button2)); buttons.add((Button) findViewById(R.id.button3)); buttons.add((Button) findViewById(R.id.button4)); buttons.add((Button) findViewById(R.id.button5)); - + for (int i = 0; i < buttons.size(); i++) { buttons.get(i).setOnClickListener(this); buttons.get(i).setVisibility(View.GONE); @@ -108,7 +103,6 @@ public class Directoris extends Activity implements OnClickListener { } public void buttonClicked(Button b) { - Log.d(TAG, "Click on " + b.getText()); d = new Descarrega(url + "/" + b.getText() + "/", file, folder); String str = d.doInBackground(); diff --git a/src/com/upc/pbe/upcnews/HTMLParser.java b/src/com/upc/pbe/upcnews/HTMLParser.java index dea409f..276c165 100644 --- a/src/com/upc/pbe/upcnews/HTMLParser.java +++ b/src/com/upc/pbe/upcnews/HTMLParser.java @@ -35,5 +35,4 @@ public class HTMLParser { } return "No s'ha trobat"; } - } diff --git a/src/com/upc/pbe/upcnews/MainActivity.java b/src/com/upc/pbe/upcnews/MainActivity.java index 7767cc5..4a68753 100644 --- a/src/com/upc/pbe/upcnews/MainActivity.java +++ b/src/com/upc/pbe/upcnews/MainActivity.java @@ -72,13 +72,9 @@ public class MainActivity extends Activity implements OnClickListener { public void onClick(View v) { Log.d(TAG, "onClicked"); - - - this.descarregar(); ((UpcApp) getApplication()).setDesc(html); startActivity(new Intent(this, Directoris.class)); - } public void descarregar() { @@ -101,5 +97,4 @@ public class MainActivity extends Activity implements OnClickListener { return false; } } - } \ No newline at end of file diff --git a/src/com/upc/pbe/upcnews/UpcApp.java b/src/com/upc/pbe/upcnews/UpcApp.java index 1fd1a6e..6d6ff75 100644 --- a/src/com/upc/pbe/upcnews/UpcApp.java +++ b/src/com/upc/pbe/upcnews/UpcApp.java @@ -52,5 +52,4 @@ public class UpcApp extends Application implements OnSharedPreferenceChangeListe public String getDesc(){ return desc; } - } -- libgit2 0.22.2