www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 0fd2c47703fc0a0b19683f4d56a237c75cbcf599
parent 6b32c6e72f0481fa2e06db3f690eda35dfa63969
Author: John Charron <rm_rf_windows@yahoo.fr>
Date:   Sat, 29 Jan 2011 23:40:37 +0100

Oops! J'avais oublier Score.java... Dsl (jc)

Diffstat:
Acode/PtiClic/src/org/pticlic/Score.java | 56++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+), 0 deletions(-)

diff --git a/code/PtiClic/src/org/pticlic/Score.java 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)); + } + + } +}