commit 2f4b5b09986fd5e8549a7df75502c7703f7e64b4 parent 3ab6fe92ddfe6d5c0d8a2982779216acd9ca03cf Author: Bertrand BRUN <bertrand0brun@gmail.com> Date: Sat, 26 Feb 2011 23:02:08 +0100 Changement dans la frontpage (on dit si on est connecter ou non) Diffstat:
| M | code/PtiClic/res/values/strings.xml | | | 2 | ++ |
| M | code/PtiClic/src/org/pticlic/FrontPage.java | | | 9 | ++++++--- |
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/code/PtiClic/res/values/strings.xml b/code/PtiClic/res/values/strings.xml @@ -15,4 +15,6 @@ <string name="frontpage_preference_button">Preferences</string> <string name="frontpage_inscription_button">Inscription</string> <string name="frontpage_no_connection">Problème de connexion au serveur. Vérifiez que vous êtes connecté au réseau.</string> +<string name="frontpage_user_connected">Vous ete connectez</string> +<string name="frontpage_user_notconnected">Vous n\'ete pas connectez</string> </resources> diff --git a/code/PtiClic/src/org/pticlic/FrontPage.java b/code/PtiClic/src/org/pticlic/FrontPage.java @@ -43,9 +43,12 @@ public class FrontPage extends Activity implements OnClickListener{ // On récupère le nom du joueur des préférences. SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); - String loginPref = sp.getString("login", "joueur"); - // On l'ajoute dans le TextView prévu à cet effet - ((TextView)findViewById(R.id.login)).setText("Login : " + loginPref); + Boolean connected = sp.getBoolean(Constant.SERVER_AUTH, false); + if (connected) { + ((TextView)findViewById(R.id.login)).setText(R.string.frontpage_user_connected); + } else { + ((TextView)findViewById(R.id.login)).setText(R.string.frontpage_user_notconnected); + } } /* (non-Javadoc)