www

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

commit 2327e221dc3b3551313746b5be53edefc1ad27f0
parent 9a5d3d9cb9f18846618c20e8f54ad3ea58e86cb5
Author: Bertrand BRUN <bertrand0brun@gmail.com>
Date:   Wed,  2 Feb 2011 10:09:23 +0100

Merge branch 'master' of https://github.com/jsmaniac/2011-m1s2-ter

Diffstat:
Mcode/PtiClic/res/layout/game.xml | 38++++++++++++++++++++++----------------
Mcode/PtiClic/src/org/pticlic/games/BaseGame.java | 5++++-
2 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/code/PtiClic/res/layout/game.xml b/code/PtiClic/res/layout/game.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout android:id="@+id/widget29" - android:layout_width="fill_parent" android:layout_height="fill_parent" - android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"> +<LinearLayout android:layout_width="fill_parent" + android:layout_height="fill_parent" android:orientation="vertical" + xmlns:android="http://schemas.android.com/apk/res/android"> <LinearLayout android:id="@+id/widget40" android:layout_width="fill_parent" android:layout_height="fill_parent" @@ -15,27 +15,33 @@ android:layout_height="wrap_content" android:text="currentWord" android:textStyle="bold" android:gravity="center"> </TextView> - + </LinearLayout> - <LinearLayout android:id="@+id/widget44" - android:orientation="horizontal" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="9"> + <LinearLayout android:orientation="horizontal" + android:layout_height="fill_parent" android:layout_width="fill_parent" + android:layout_weight="9"> - <Button android:id="@+id/relation1" - android:text="relation1" android:layout_height="wrap_content" android:layout_weight="1" android:layout_width="fill_parent" android:layout_gravity="bottom"> + <Button android:id="@+id/relation1" android:text="relation1" + android:layout_height="wrap_content" android:layout_weight="1" + android:layout_width="fill_parent" android:layout_gravity="bottom"> </Button> - <Button android:id="@+id/relation2" - android:text="relation2" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="1" android:layout_gravity="bottom"> + <Button android:id="@+id/relation2" android:text="relation2" + android:layout_height="wrap_content" android:layout_width="fill_parent" + android:layout_weight="1" android:layout_gravity="bottom"> </Button> - <Button android:id="@+id/poubelle" - android:text="poubelle" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="1" android:layout_gravity="bottom"> + <Button android:id="@+id/trash" android:text="trash" + android:layout_height="wrap_content" android:layout_width="fill_parent" + android:layout_weight="1" android:layout_gravity="bottom"> </Button> - <Button android:id="@+id/relation3" - android:text="relation3" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="1" android:layout_gravity="bottom"> + <Button android:id="@+id/relation3" android:text="relation3" + android:layout_height="wrap_content" android:layout_width="fill_parent" + android:layout_weight="1" android:layout_gravity="bottom"> </Button> - <Button android:id="@+id/relation4" - android:text="relation4" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="1" android:layout_gravity="bottom"> + <Button android:id="@+id/relation4" android:text="relation4" + android:layout_height="wrap_content" android:layout_width="fill_parent" + android:layout_weight="1" android:layout_gravity="bottom"> </Button> </LinearLayout> diff --git a/code/PtiClic/src/org/pticlic/games/BaseGame.java b/code/PtiClic/src/org/pticlic/games/BaseGame.java @@ -74,7 +74,9 @@ public class BaseGame extends Activity implements OnClickListener { Button r4 = ((Button)findViewById(R.id.relation4)); // TODO : Pour l'instant la poubelle ne fait rien. Il faudra certainement la ranger dans un categorie dans GamePlayed pour calculer le score. - ((Button)findViewById(R.id.poubelle)).setText("Poubelle"); + Button trash = ((Button)findViewById(R.id.trash)); + trash.setOnClickListener(this); + trash.setText("poubelle"); // Écoute des clics sur les relations if (nbrel > 0) { r1.setOnClickListener(this); r1.setText(r.getRelationName(game.getCat1())); } else { r1.setVisibility(View.GONE); } @@ -167,6 +169,7 @@ public class BaseGame extends Activity implements OnClickListener { case (R.id.relation2) : gamePlayed.add(2, currentWord); next(); break; case (R.id.relation3) : gamePlayed.add(3, currentWord); next(); break; case (R.id.relation4) : gamePlayed.add(4, currentWord); next(); break; + case (R.id.trash) : gamePlayed.add(0, currentWord); next(); break; } } } \ No newline at end of file