From 0fd2c47703fc0a0b19683f4d56a237c75cbcf599 Mon Sep 17 00:00:00 2001 From: John Charron Date: Sat, 29 Jan 2011 23:40:37 +0100 Subject: [PATCH 1/3] Oops! J'avais oublier Score.java... Dsl (jc) --- code/PtiClic/src/org/pticlic/Score.java | 56 +++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 code/PtiClic/src/org/pticlic/Score.java diff --git a/code/PtiClic/src/org/pticlic/Score.java b/code/PtiClic/src/org/pticlic/Score.java new file mode 100644 index 0000000..f5ad491 --- /dev/null +++ b/code/PtiClic/src/org/pticlic/Score.java @@ -0,0 +1,56 @@ +package org.pticlic; + +import model.GamePlayed; +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.view.View.OnClickListener; +import android.widget.Button; +import android.widget.TextView; + +public class Score extends Activity implements OnClickListener{ + + private double corrects; + private double manquants; + private double mauvais; + private double total; + private GamePlayed gamePlayed; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.score); + + if (getIntent().getExtras() != null) { + this.corrects = getIntent().getExtras().getDouble("corrects"); + this.manquants = getIntent().getExtras().getDouble("manquants"); + this.mauvais = getIntent().getExtras().getDouble("mauvais"); + this.total = this.calculateTotal(); + } + ((TextView)findViewById(R.id.corrects)).setText("Mots corrects : " + + this.corrects); + ((TextView)findViewById(R.id.manquants)).setText("Mots manquants : " + + this.manquants); + ((TextView)findViewById(R.id.mauvais)).setText("Mots mauvais : " + + this.mauvais); + ((TextView)findViewById(R.id.total)).setText("Total de " + total + + "point(s)"); + ((Button)findViewById(R.id.jaivu)).setOnClickListener(this); + } + + + + protected double calculateTotal(){ + return this.corrects - this.manquants - this.mauvais; + } + + @Override + public void onClick(View v) { + if (v.getId()==R.id.jaivu) { + startActivity(new Intent(this, Main.class)); + } + + } +} From d46b97ca428997c6492fbef916b2773a739fa6e3 Mon Sep 17 00:00:00 2001 From: John Charron Date: Sat, 29 Jan 2011 23:43:10 +0100 Subject: [PATCH 2/3] =?UTF-8?q?Aurais-je=20oubil=C3=A9=20string.xml=20auss?= =?UTF-8?q?i=20=3F=20(jc)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/PtiClic/res/values/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/PtiClic/res/values/strings.xml b/code/PtiClic/res/values/strings.xml index 5f5a518..c35f1da 100644 --- a/code/PtiClic/res/values/strings.xml +++ b/code/PtiClic/res/values/strings.xml @@ -4,4 +4,6 @@ PtiClic Préférences Jouer +Ce projet a été réalisé l +#FF0000 From 97e18f69efe860977e9fa149bffc7cc3265d57c2 Mon Sep 17 00:00:00 2001 From: Bertrand BRUN Date: Mon, 31 Jan 2011 21:15:55 +0100 Subject: [PATCH 3/3] Correction de quelque bug --- code/PtiClic/res/values/strings.xml | 2 +- code/PtiClic/src/org/pticlic/Score.java | 40 +------------------------ 2 files changed, 2 insertions(+), 40 deletions(-) diff --git a/code/PtiClic/res/values/strings.xml b/code/PtiClic/res/values/strings.xml index 41f2664..b5023f8 100644 --- a/code/PtiClic/res/values/strings.xml +++ b/code/PtiClic/res/values/strings.xml @@ -2,7 +2,7 @@ PtiClic Préférences - Jouer + Jouer Ce projet a été réalisé l #FF0000 diff --git a/code/PtiClic/src/org/pticlic/Score.java b/code/PtiClic/src/org/pticlic/Score.java index 60d1404..920d383 100644 --- a/code/PtiClic/src/org/pticlic/Score.java +++ b/code/PtiClic/src/org/pticlic/Score.java @@ -1,32 +1,15 @@ package org.pticlic; -<<<<<<< HEAD -import model.GamePlayed; -======= import org.pticlic.model.Constant; import org.pticlic.model.GamePlayed; ->>>>>>> f74dc5006757fe52d362cf1a0d642d01dda7cf43 import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; -<<<<<<< HEAD -import android.widget.Button; -import android.widget.TextView; public class Score extends Activity implements OnClickListener{ - - private double corrects; - private double manquants; - private double mauvais; - private double total; -======= - -public class Score extends Activity implements OnClickListener{ - ->>>>>>> f74dc5006757fe52d362cf1a0d642d01dda7cf43 private GamePlayed gamePlayed; @@ -36,22 +19,6 @@ public class Score extends Activity implements OnClickListener{ setContentView(R.layout.score); if (getIntent().getExtras() != null) { -<<<<<<< HEAD - this.corrects = getIntent().getExtras().getDouble("corrects"); - this.manquants = getIntent().getExtras().getDouble("manquants"); - this.mauvais = getIntent().getExtras().getDouble("mauvais"); - this.total = this.calculateTotal(); - } - ((TextView)findViewById(R.id.corrects)).setText("Mots corrects : " - + this.corrects); - ((TextView)findViewById(R.id.manquants)).setText("Mots manquants : " - + this.manquants); - ((TextView)findViewById(R.id.mauvais)).setText("Mots mauvais : " - + this.mauvais); - ((TextView)findViewById(R.id.total)).setText("Total de " + total - + "point(s)"); - ((Button)findViewById(R.id.jaivu)).setOnClickListener(this); -======= // Pour JC : GamePlayed contient toutes les infos sur la partie jouee this.gamePlayed = (GamePlayed) getIntent().getExtras().get(Constant.SCORE_INTENT); } @@ -64,18 +31,13 @@ public class Score extends Activity implements OnClickListener{ // ((TextView)findViewById(R.id.total)).setText("Total de " + total // + "point(s)"); // ((Button)findViewById(R.id.jaivu)).setOnClickListener(this); ->>>>>>> f74dc5006757fe52d362cf1a0d642d01dda7cf43 } protected double calculateTotal(){ -<<<<<<< HEAD - return this.corrects - this.manquants - this.mauvais; -======= throw new UnsupportedOperationException(); - //return this.corrects - this.manquants - this.mauvais; ->>>>>>> f74dc5006757fe52d362cf1a0d642d01dda7cf43 + //return this.corrects - this.manquants - this.mauvais; } @Override