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

This commit is contained in:
Georges Dupéron 2011-02-04 12:56:18 +01:00
commit 8efa03512e
7 changed files with 139 additions and 66 deletions

View File

@ -10,11 +10,11 @@
</intent-filter>
</activity>
<activity android:name=".Preference" android:label="Préférence"></activity>
<activity android:name=".games.BaseGame"></activity>
<activity android:label="Information" android:name=".Information"></activity>
<activity android:name=".Score" android:label="Score"></activity>
<activity android:name=".FrontPage"></activity>
<activity android:name=".Preference" android:label="Préférence" android:screenOrientation="portrait"></activity>
<activity android:name=".games.BaseGame" android:screenOrientation="portrait"></activity>
<activity android:label="Information" android:name=".Information" android:screenOrientation="portrait"></activity>
<activity android:name=".Score" android:label="Score" android:screenOrientation="portrait"></activity>
<activity android:name=".FrontPage" android:screenOrientation="portrait"></activity>
</application>

View File

@ -13,30 +13,28 @@
<ImageView android:layout_height="wrap_content"
android:text="@string/play_label" android:layout_width="wrap_content"
android:id="@+id/play" android:clickable="true" android:padding="30dip" android:src="@drawable/mode_normal"/>
android:id="@+id/play" android:clickable="true" android:padding="30dip"
android:src="@drawable/mode_normal"/>
<ImageView android:src="@drawable/config" android:layout_height="wrap_content" android:id="@+id/prefs"
<ImageView android:src="@drawable/config"
android:layout_height="wrap_content" android:id="@+id/prefs"
android:layout_width="wrap_content" android:layout_below="@+id/play"
android:layout_alignLeft="@+id/play" android:layout_alignRight="@+id/play" android:padding="30dip"></ImageView>
android:layout_alignLeft="@+id/play" android:layout_alignRight="@+id/play"
android:padding="30dip"></ImageView>
</RelativeLayout>
</RelativeLayout>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="vertical" android:layout_weight="1">
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:orientation="vertical" android:layout_weight="1">
<TextView android:layout_height="wrap_content"
android:layout_width="fill_parent" android:textStyle="bold"
android:gravity="center_horizontal" android:text="@+id/login"
android:id="@+id/login"></TextView>
<ImageView android:layout_height="wrap_content" android:id="@+id/infoButton"
android:layout_width="wrap_content" android:layout_gravity="right" android:layout_weight="5"
android:clickable="true" android:src="@drawable/aide"/>
android:layout_width="wrap_content" android:layout_gravity="right"
android:layout_weight="5" android:clickable="true" android:src="@drawable/aide" />
</LinearLayout>

View File

@ -4,37 +4,69 @@
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical" android:layout_weight="2">
android:layout_height="fill_parent" android:orientation="vertical"
android:layout_weight="2">
<AbsoluteLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:paddingTop="10px">
<TextView android:id="@+id/mainWord" android:text="mainWord"
android:textStyle="bold" android:textSize="30dip"
android:layout_weight="1" android:gravity="center"
android:paddingTop="10px" android:layout_height="fill_parent"
android:layout_width="fill_parent">
</TextView>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" android:gravity="right">
<ImageView android:src="@drawable/aide"
android:id="@+id/aideBaseGame" android:paddingRight="10px"
android:layout_width="wrap_content" android:layout_height="wrap_content"></ImageView>
</LinearLayout>
</AbsoluteLayout>
<TextView android:id="@+id/mainWord" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="mainWord"
android:textStyle="bold" android:gravity="center" android:textSize="30dip">
</TextView>
<TextView android:id="@+id/currentWord" android:layout_width="fill_parent"
android:text="currentWord"
android:textStyle="bold" android:textSize="20dip" android:layout_height="fill_parent" android:gravity="top|center">
android:text="currentWord" android:textStyle="bold" android:textSize="20dip"
android:layout_height="fill_parent" android:gravity="top|center">
</TextView>
</LinearLayout>
</LinearLayout>
<LinearLayout android:orientation="horizontal"
android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="10">
android:layout_height="fill_parent" android:layout_width="fill_parent"
android:layout_weight="10">
<ImageView android:id="@+id/relation1"
android:src="@drawable/contenant" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center">
<ImageView android:id="@+id/relation1" android:src="@drawable/contenant"
android:layout_weight="1" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_gravity="center">
</ImageView>
<ImageView android:id="@+id/relation2"
android:src="@drawable/contenu" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center">
<ImageView android:id="@+id/relation2" android:src="@drawable/contenu"
android:layout_weight="1" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_gravity="center">
</ImageView>
<ImageView android:id="@+id/trash"
android:src="@android:drawable/ic_menu_delete" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center">
<ImageView android:id="@+id/relation3" android:src="@drawable/contraire"
android:layout_weight="1" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_gravity="center">
</ImageView>
<ImageView android:id="@+id/relation3"
android:src="@drawable/contraire" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center">
<ImageView android:id="@+id/relation4" android:src="@drawable/synonyme"
android:layout_weight="1" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_gravity="center">
</ImageView>
<ImageView android:id="@+id/relation4"
android:src="@drawable/synonyme" android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center">
<ImageView android:id="@+id/trash" android:src="@android:drawable/ic_menu_delete"
android:layout_weight="1" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_gravity="center">
</ImageView>
</LinearLayout>

View File

@ -1,9 +1,15 @@
package org.pticlic;
import org.pticlic.model.Constant;
import org.pticlic.model.Network;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.widget.Toast;
public class Preference extends PreferenceActivity {
public class Preference extends PreferenceActivity implements OnSharedPreferenceChangeListener {
/* (non-Javadoc)
* @see android.preference.PreferenceActivity#onCreate(android.os.Bundle)
@ -12,6 +18,43 @@ public class Preference extends PreferenceActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.prefs);
SharedPreferences prefs = getPreferenceManager().getSharedPreferences();
prefs.registerOnSharedPreferenceChangeListener(this);
}
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (key.equals("passwd")) {
if (Network.isConnected(this)) {
String id = sharedPreferences.getString("login", "");
String passwd = sharedPreferences.getString("passwd", "");
if (Network.isLoginCorrect(this, id, passwd)) {
Toast.makeText(this,
"Couple login/mdp valide.",
Toast.LENGTH_LONG).show();
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean(Constant.SERVER_AUTH, true);
editor.commit();
} else {
Toast.makeText(this,
"Couple login/mdp non valide.",
Toast.LENGTH_LONG).show();
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean(Constant.SERVER_AUTH, false);
editor.commit();
}
} else {
Toast.makeText(this,
"Pas connecter au reseau, verification du login/mdp impossible",
Toast.LENGTH_LONG).show();
}
}
}
}

View File

@ -9,13 +9,11 @@ import org.pticlic.model.Network;
import org.pticlic.model.Network.Mode;
import org.pticlic.model.Relation;
import android.R.anim;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Display;

View File

@ -3,6 +3,8 @@ package org.pticlic.model;
public class Constant {
public static final String SERVER_URL = "SERVER_URL";
public static final String SERVER_AUTH = "SERVER_AUTH";
// Constant pour les information de l'utilisateur.
public static final String USER_ID = "login";
public static final String USER_PASSWD = "passwd";

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="PticClic" company="" webLink="pticlic.org" view-date="2011-01-10" view-index="0" gantt-divider-location="425" resource-divider-location="302" version="2.0">
<project name="PticClic" company="" webLink="pticlic.org" view-date="2011-01-17" view-index="0" gantt-divider-location="425" resource-divider-location="302" version="2.0">
<description/>
<view zooming-state="default:3" id="gantt-chart"/>
<view id="resource-table">
@ -36,11 +36,11 @@
<depend id="6" type="2" difference="0" hardness="Rubber"/>
</task>
<task id="1" name="Recherche de beta-testeurs" meeting="false" start="2011-01-15" duration="28" complete="10" priority="1" expand="true"/>
<task id="2" name="Iteration 1" meeting="false" start="2011-01-17" duration="27" complete="36" priority="1" expand="true">
<task id="2" name="Iteration 1" meeting="false" start="2011-01-17" duration="27" complete="63" priority="1" expand="true">
<depend id="16" type="2" difference="0" hardness="Rubber"/>
<depend id="17" type="2" difference="0" hardness="Rubber"/>
<depend id="18" type="2" difference="0" hardness="Rubber"/>
<task id="5" name="Serveur &amp; SQL" meeting="false" start="2011-01-17" duration="7" complete="80" priority="1" expand="true">
<task id="5" name="Serveur &amp; SQL" meeting="false" start="2011-01-17" duration="7" complete="95" priority="1" expand="true">
<depend id="7" type="2" difference="0" hardness="Strong"/>
<depend id="8" type="2" difference="0" hardness="Strong"/>
<depend id="9" type="2" difference="0" hardness="Strong"/>
@ -50,19 +50,19 @@
<depend id="8" type="2" difference="0" hardness="Strong"/>
<depend id="9" type="2" difference="0" hardness="Strong"/>
</task>
<task id="7" name="Fenetre de score" meeting="false" start="2011-01-24" duration="7" complete="20" priority="1" expand="true">
<task id="7" name="Fenetre de score" meeting="false" start="2011-01-24" duration="7" complete="50" priority="1" expand="true">
<depend id="10" type="2" difference="0" hardness="Strong"/>
</task>
<task id="8" name="Reseau client Android" meeting="false" start="2011-01-24" duration="7" complete="30" priority="1" expand="true">
<task id="8" name="Reseau client Android" meeting="false" start="2011-01-24" duration="7" complete="90" priority="1" expand="true">
<depend id="10" type="2" difference="0" hardness="Strong"/>
</task>
<task id="9" name="Fenetre de jeu" meeting="false" start="2011-01-24" duration="7" complete="20" priority="1" expand="true">
<task id="9" name="Fenetre de jeu" meeting="false" start="2011-01-24" duration="7" complete="85" priority="1" expand="true">
<depend id="10" type="2" difference="0" hardness="Strong"/>
</task>
<task id="10" name="Intégration client &amp; serveur" meeting="false" start="2011-01-31" duration="1" complete="0" priority="1" expand="true">
<depend id="11" type="2" difference="0" hardness="Strong"/>
</task>
<task id="11" name="Amelioration" meeting="false" start="2011-02-01" duration="6" complete="0" priority="1" expand="true">
<task id="11" name="Amelioration" meeting="false" start="2011-02-01" duration="6" complete="20" priority="1" expand="true">
<depend id="12" type="2" difference="0" hardness="Strong"/>
</task>
<task id="12" name="Test et debogage" meeting="false" start="2011-02-07" duration="5" complete="0" priority="1" expand="true">
@ -172,51 +172,51 @@
</resources>
<allocations>
<allocation task-id="0" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="0" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="0" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="0" resource-id="0" function="Default:1" responsible="false" load="100.0"/>
<allocation task-id="0" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="1" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
<allocation task-id="1" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
<allocation task-id="1" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
<allocation task-id="1" resource-id="0" function="Default:1" responsible="false" load="25.0"/>
<allocation task-id="5" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="1" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
<allocation task-id="5" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="5" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="6" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="6" resource-id="0" function="Default:1" responsible="false" load="75.0"/>
<allocation task-id="7" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="8" resource-id="0" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="9" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="9" resource-id="0" function="Default:1" responsible="false" load="25.0"/>
<allocation task-id="9" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="10" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="10" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="10" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="10" resource-id="0" function="Default:1" responsible="false" load="75.0"/>
<allocation task-id="10" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="11" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="11" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="11" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="11" resource-id="0" function="Default:1" responsible="false" load="75.0"/>
<allocation task-id="11" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="12" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="12" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="12" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="12" resource-id="0" function="Default:1" responsible="false" load="75.0"/>
<allocation task-id="12" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="14" resource-id="4" function="SoftwareDevelopment:4" responsible="false" load="100.0"/>
<allocation task-id="16" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
<allocation task-id="17" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="17" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="18" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="18" resource-id="0" function="Default:1" responsible="false" load="100.0"/>
<allocation task-id="18" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="19" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="19" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="19" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="19" resource-id="0" function="Default:1" responsible="false" load="50.0"/>
<allocation task-id="19" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="20" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="20" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="20" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="20" resource-id="0" function="Default:1" responsible="false" load="50.0"/>
<allocation task-id="20" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="21" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="21" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="21" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="21" resource-id="0" function="Default:1" responsible="false" load="100.0"/>
<allocation task-id="21" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="23" resource-id="4" function="SoftwareDevelopment:4" responsible="false" load="100.0"/>
<allocation task-id="25" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="25" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
@ -225,21 +225,21 @@
<allocation task-id="27" resource-id="0" function="Default:1" responsible="false" load="100.0"/>
<allocation task-id="28" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="29" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="29" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="29" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="29" resource-id="0" function="Default:1" responsible="false" load="50.0"/>
<allocation task-id="29" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="30" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="30" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="30" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="30" resource-id="0" function="Default:1" responsible="false" load="50.0"/>
<allocation task-id="30" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="31" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="31" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="31" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="31" resource-id="0" function="Default:1" responsible="false" load="100.0"/>
<allocation task-id="31" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="32" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
<allocation task-id="32" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
<allocation task-id="32" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
<allocation task-id="32" resource-id="0" function="Default:1" responsible="true" load="25.0"/>
<allocation task-id="32" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
<allocation task-id="33" resource-id="4" function="SoftwareDevelopment:4" responsible="false" load="100.0"/>
<allocation task-id="35" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="36" resource-id="0" function="Default:1" responsible="false" load="100.0"/>
@ -248,17 +248,17 @@
<allocation task-id="38" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="38" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="39" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="39" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="39" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="39" resource-id="0" function="Default:1" responsible="false" load="50.0"/>
<allocation task-id="39" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="40" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="40" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="40" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="40" resource-id="0" function="Default:1" responsible="false" load="50.0"/>
<allocation task-id="40" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="41" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="41" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="41" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="41" resource-id="0" function="Default:1" responsible="false" load="100.0"/>
<allocation task-id="41" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
</allocations>
<vacations/>
<taskdisplaycolumns>