Explorar el Código

Resolution de bug divers
ajout menu
selection de difficulté
Interface revue (bouton retour)

François Gautrais hace 7 años
padre
commit
59a08dee88
Se han modificado 43 ficheros con 1698 adiciones y 358 borrados
  1. 13 9
      app/src/main/AndroidManifest.xml
  2. 417 0
      app/src/main/assets/game_easy
  3. 417 0
      app/src/main/assets/game_hard
  4. 39 36
      app/src/main/assets/game_medium
  5. 11 10
      app/src/main/assets/ressources.res
  6. 14 0
      app/src/main/java/macampcorp/macamp/activities/BombActivity.java
  7. 2 0
      app/src/main/java/macampcorp/macamp/activities/CreditsActivity.java
  8. 0 63
      app/src/main/java/macampcorp/macamp/activities/ErrorActivity.java
  9. 4 4
      app/src/main/java/macampcorp/macamp/activities/HostActivity.java
  10. 81 0
      app/src/main/java/macampcorp/macamp/activities/MenuActivity.java
  11. 8 34
      app/src/main/java/macampcorp/macamp/activities/PermissionActivity.java
  12. 50 0
      app/src/main/java/macampcorp/macamp/activities/SelectDifficultActivity.java
  13. 0 1
      app/src/main/java/macampcorp/macamp/activities/TutoActivity.java
  14. 14 2
      app/src/main/java/macampcorp/macamp/activities/fragments/ChallengeFragment.java
  15. 4 1
      app/src/main/java/macampcorp/macamp/activities/fragments/QCMFragment.java
  16. 4 1
      app/src/main/java/macampcorp/macamp/activities/fragments/QRCodeFragment.java
  17. 6 1
      app/src/main/java/macampcorp/macamp/activities/fragments/QuestionFragment.java
  18. 1 0
      app/src/main/java/macampcorp/macamp/activities/viewers/ImageViewerActivity.java
  19. 9 1
      app/src/main/java/macampcorp/macamp/activities/viewers/MediaViewerAcitvity.java
  20. 2 0
      app/src/main/java/macampcorp/macamp/activities/viewers/ResourceListActivity.java
  21. 13 4
      app/src/main/java/macampcorp/macamp/game/Resource.java
  22. 13 8
      app/src/main/java/macampcorp/macamp/ui/MediaView.java
  23. 49 15
      app/src/main/java/macampcorp/macamp/ui/Sound.java
  24. 1 1
      app/src/main/res/anim/trans_out.xml
  25. BIN
      app/src/main/res/drawable/back.png
  26. 66 31
      app/src/main/res/layout/activity_bomb.xml
  27. 33 2
      app/src/main/res/layout/activity_credits.xml
  28. 0 48
      app/src/main/res/layout/activity_error.xml
  29. 0 1
      app/src/main/res/layout/activity_host.xml
  30. 77 37
      app/src/main/res/layout/activity_media.xml
  31. 54 0
      app/src/main/res/layout/activity_menu.xml
  32. 43 7
      app/src/main/res/layout/activity_resource_list.xml
  33. 163 0
      app/src/main/res/layout/activity_select_difficult.xml
  34. 51 36
      app/src/main/res/layout/activity_viewer.xml
  35. 1 1
      app/src/main/res/layout/fragment_bomb.xml
  36. 1 0
      app/src/main/res/layout/fragment_qcm.xml
  37. 2 1
      app/src/main/res/layout/fragment_qrcode.xml
  38. 1 0
      app/src/main/res/layout/fragment_question.xml
  39. BIN
      app/src/main/res/raw/boom.mp3
  40. BIN
      app/src/main/res/raw/boom.wav
  41. BIN
      app/src/main/res/raw/fail.mp3
  42. BIN
      app/src/main/res/raw/ok.mp3
  43. 34 3
      app/src/main/res/values/strings.xml

+ 13 - 9
app/src/main/AndroidManifest.xml

@@ -8,8 +8,8 @@
     <uses-feature android:name="android.hardware.camera" />
     <uses-feature android:name="android.hardware.camera2.full" />
     <uses-feature android:name="android.hardware.camera.autofocus" />
-    <uses-permission android:name="android.permission.VIBRATE"/>
 
+    <uses-permission android:name="android.permission.VIBRATE" />
 
     <application
         android:allowBackup="true"
@@ -48,16 +48,12 @@
             android:theme="@style/AppTheme.NoActionBar.Fullscreen" />
         <activity
             android:name=".HostActivity"
-            android:screenOrientation="portrait"
             android:label="@string/title_activity_host"
-            android:theme="@style/AppTheme.NoActionBar" />
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar.Fullscreen" />
         <activity
             android:name=".BombActivity"
-            android:screenOrientation="portrait"
             android:label="@string/title_activity_bomb"
-            android:theme="@style/AppTheme.NoActionBar" />
-        <activity
-            android:name=".ErrorActivity"
             android:screenOrientation="portrait"
             android:theme="@style/AppTheme.NoActionBar.Fullscreen" />
         <activity
@@ -68,8 +64,16 @@
             android:name=".EndActivity"
             android:screenOrientation="portrait"
             android:theme="@style/AppTheme.NoActionBar.Fullscreen" />
-
-        <activity android:name=".CrashActivity"
+        <activity
+            android:name=".CrashActivity"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar.Fullscreen" />
+        <activity
+            android:name=".MenuActivity"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.NoActionBar.Fullscreen" />
+        <activity
+            android:name=".SelectDifficultActivity"
             android:screenOrientation="portrait"
             android:theme="@style/AppTheme.NoActionBar.Fullscreen" />
     </application>

+ 417 - 0
app/src/main/assets/game_easy

@@ -0,0 +1,417 @@
+{
+    "password" : "19662016",
+    "max_time" : 60,
+	"resources_file" : "ressources.res",
+	"stages" : [{
+	"name" : "Intro",
+	"challenges" : [],
+	"resources" : ["e0"],
+	"event_end" : [ 
+		{"method" : "tuto"},
+		{"method" : "armBomb"}
+	]
+},
+{
+	"name" : "Bibliotheuqe_intro",
+	"challenges" :
+		[
+			{
+				"type" : "QRCodeTreasure",
+				"name" : "BibQr",
+				"bad_message" : "C'est pas le bon !",
+				"text" : "Trouve le QR code caché à côté de la photo suivante",
+				"qr_value" : "http://www.mjc-louis-aragon.asso.fr/qrcode/#1",
+				"resource" : "bib",
+				"indices" : [
+					{
+						"type" : "text",
+						"text" : "C'est un vélo sur la pancarte ?",
+						"penality": 0.5
+					},
+					{
+						"type" : "text",
+						"penality": 1,
+						"text" : "Et il y a un truc vert pour accrocher les vélos..." 
+					},
+					{
+						"type" : "text",
+						"penality": 1,
+						"text" : "regarde devant la bibliothèque sur les supports de vélos." 
+					}
+				]
+			}
+		],
+	"resources" : ["e1"]
+},
+{
+	"name" : "MPG",
+	"charIndex" : 0,
+	"resources" : ["e3"],
+	"challenges" :
+		[
+			{
+				"type" : "QRCodeTreasure",
+				"name" : "MPG_Qr",
+				"bad_message" : "C'est pas le bon !",
+				"text" : "Trouve le QR code caché à côté de la photo suivante",
+				"qr_value" : "http://www.mjc-louis-aragon.asso.fr/qrcode/#2",
+				"resource" : "mpg",
+				"indices" : [
+					{
+						"text" : "Un endroit Merveilleux où les enfants et ados sont Joyeux !",
+						"penality": 0.5
+					},
+					{
+						"penality": 1,
+						"text" : "[...] [...] Loisirs." 
+					},
+					{
+						"penality": 1,
+						"text" : "Ne pas sonner SVP !" 
+					}
+				],
+				"event_end" : { "method" : "giveResource", "args" : ["e2q", "e2"] }
+			},
+			{
+                    "type" : "QCM",
+                    "name" : "a1",
+                    "question" : "La première réponse",
+                    "answer" : ["Louis Aragon"],
+                    "choices" : [
+									"Oui !",
+									"Jean-Vincent Placé", 
+									"Zinedine Zidane", 
+									"Patrick Timsit", 
+									"Louis Aragon", 
+									"La réponse D",
+									"Non !",
+									"Kylian M'Bappé",
+									"Des jeux"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "none",
+					"penality": 0.5,
+					"mandatory" : false
+                 },
+                 {
+                    "type" : "QCM",
+                    "name" : "a2",
+                    "question" : "La deuxieme réponse",
+                    "answer" : ["Des jeux"],
+                    "choices" : [
+									"Oui !",
+									"Des jeux", 
+									"Rond", 
+									"Des livres", 
+									"Des DVD",
+									"Non !",
+									"Kylian M'Bappé",
+									"Marc Levy"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "none",
+					"penality": 0.5,
+                    "mandatory" : false
+                 },
+                 {
+                    "type" : "QCM",
+                    "name" : "a3",
+                    "question" : "La troisème réponse",
+                    "answer" : ["Rond", "Carré"],
+                    "choices" : [
+									"Oui !",
+									"Des jeux", 
+									"Rond", 
+									"Carré", 
+									"Losange",
+									"VTT",
+									"Dodécagonal",
+									"Hexagone"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "none",
+					"penality": 0.5,
+                    "mandatory" : false
+                 },
+                 {
+                    "type" : "QCM",
+                    "name" : "a4",
+                    "question" : "La quatrième réponse",
+                    "answer" : ["D"],
+                    "choices" : [
+									"Oui !",
+									"Des jeux", 
+									"Rond", 
+									"Carré", 
+									"Losange",
+									"VTT",
+									"D",
+									"Hexagone",
+									"W"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "none",
+					"penality": 0.5,
+                    "mandatory" : false
+                 },
+                 {
+                    "type" : "QCM",
+                    "name" : "a5",
+                    "question" : "La cinquième réponse",
+                    "answer" : ["w", "vv"],
+                    "choices" : [
+									"Oui !",
+									"Des jeux", 
+									"Bob Marley", 
+									"Carré", 
+									"42",
+									"VTT",
+									"D",
+									"Hexagone",
+									"W"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "none",
+					"penality": 0.5,
+                    "mandatory" : false
+                 },
+                 {
+                    "type" : "QCM",
+                    "name" : "a6",
+                    "question" : "La sixième réponse",
+                    "answer" : "Des DVD",
+                    "choices" : [
+									"Oui !",
+									"Des DVD", 
+									"Bob Marley", 
+									"Carré", 
+									"42",
+									"VTT",
+									"D",
+									"Hexagone",
+									"W"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "none",
+					"penality": 0.5,
+                    "mandatory" : false
+                 },
+                 {
+                    "type" : "QCM",
+                    "name" : "a7",
+                    "question" : "La septième réponse",
+                    "answer" : "Ma Campagne",
+                    "choices" : [
+									"Le Blosne RPZ 35 BZH !!!!",
+									"C'est quoi la question ?", 
+									"Bob Marley", 
+									"Zinedine Zidane", 
+									"42",
+									"Ma Campagne",
+									"D",
+									"W"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "none",
+					"penality": 0.5,
+                    "mandatory" : false
+                 }
+		]
+},
+{
+	"name" : "Ludothèque",
+	"challenges" :
+		[
+			{
+				"type" : "QRCodeTreasure",
+				"name" : "Jardin ludothèque",
+				"bad_message" : "C'est pas le bon !",
+				"text" : "Trouve un QR Code à cet endroit pour continuer.",
+				"qr_value" : "http://www.mjc-louis-aragon.asso.fr/qrcode/#3",
+				"resource" : "ludo",
+				"indices" : [
+					{
+						"type" : "text",
+						"text" : "Regarde en face de la porte de la MPG et avancez !",
+						"penality": 0.5
+					},
+					{
+						"type" : "text",
+						"text" : "Fais le tour du jardin de la LUDO et lève la tête !",
+						 "penality": 1
+					},
+					{
+						"type" : "text",
+						"text" : "Quel beau plafond exterieur en beton...",
+						 "penality": 1
+					}
+				]
+			},
+			{
+				"type": "Question",
+				"name" : "QuestionLudo",
+				"bad_message" : "Non !",
+				"question" : "Trouvez le numéro de la place sur laquelle est garé la voiture sur l'énigme de la porte arrière de la MJC",
+				"good_message" : "Brillant !",
+				"resource" : "parking",
+				"answer" : "87",
+				"indices" : [
+					{
+						"penality" : 0.5,
+						"text": "Question de point de vu..."
+					},
+					{
+						"penality" : 1,
+						"text": "Ces places sont bien dans l’ordre !"
+					},
+					{
+						"penality" : 1,
+						"text": "Bon, regardez à l’envers."
+					},
+					{
+						"penality" : 1,
+						"text": "si on regarde les places à côté dans l’autre sens la voiture est garée entre la place 86 et 88"
+					}
+				]
+			}
+		],
+	"resources" : ["e4"],
+	"charIndex" : 5
+},
+{
+	"name" : "JardinDhiver",
+	"resources" : ["e5"],
+	"challenges" :
+		[
+			{
+				"type" : "Question",
+				"name" : "JardinHiverQuestion",
+				"bad_message" : "Non !",
+				"resource" : "jardin", 
+				"question" : "Trouve les 6 lettres du mot caché dans le jardin d’hiver de la MJC",
+				"good_message" : "Bravo !",
+				"answer" : "patate",
+				"indices" : [
+					{
+						"penality" : 0.5,
+						"text": "Le rouge est ma couleur favorite."
+					},
+					{
+						"penality" : 1,
+						"text": "Les affiches sont intéressantes ?"
+					},
+					{
+						"penality" : 1,
+						"text": "Des LETTRES en ROUGE sur les AFFICHES qui peuvent faire un MOT"
+					}
+				]
+			}
+		],
+	"charIndex" : 2
+},
+{
+	"name" : "Accueil",
+	"resources" : ["e6"],
+	"challenges" :
+		[
+			{
+				"type" : "QRCodeTreasure",
+				"name" : "accueilQr",
+				"bad_message" : "C'est pas le bon !",
+				"good_message" : "Bravo !",
+				"resource" : "accueil",
+				"qr_value" : "https://www.facebook.com/mediathequesdequartierdangouleme/",
+				"text" : "Pour trouver ce QR code caché, pose la question \"Comment est votre blanquette\" à l’habitant de l’aquarium",
+				"indices" : [
+					{
+						"penality" : 0.5,
+						"text": "Quand on a une question, on la pose à l’accueil non ?"
+					},
+					{
+						"penality" : 1,
+						"text": "On peut aussi avoir des informations à la médiathèque."
+					},
+					{
+						"penality" : 1,
+						"text": "C’est quoi ca sur le flyer du facebook de la médiathèque ?"
+					}
+				]
+			}
+		],
+	"charIndex" : 6
+},
+{
+	"name" : "livre",
+	"resources" : ["e7"],
+	"challenges" :
+		[
+			{
+				"type" : "Question",
+				"name" : "LivreQuestion",
+				"question" : "Va chercher ce roman : un message codé se trouve à l'intérieur…",
+				"bad_message" : "Non !",
+				"resource" : "livre",
+				"answer" : "Dindon",
+				"indices" : [
+					{
+						"penality" : 0.5,
+						"text": "Les romans se trouvent à l'étage sont classés par ordre alphabétique du nom de l'auteur."
+					},
+					{
+						"penality" : 1,
+						"text": "La côte est R ISH"
+					},
+					{
+						"penality" : 1,
+						"text": "Quand je ne sais pas où trouver ce que je cherche, je regarde au sommaire ou à l'index. Généralement, c'est au début ou à la fin du livre."
+					}
+				]
+			}
+		],
+	"charIndex" : 1
+},
+{
+	"name" : "Bomb",
+	"challenges" :
+		[
+			{
+				"type" : "BombDefuse",
+				"name" : "DefuseBomb",
+				"resource" : "oeil",
+				"text" : "Va à cet endroit et désamorce le dispositif !",
+				"indices" : [
+					{
+						"penality" : 0.5,
+						"text": "L’oeil se trouve sur une peinture d’un mur"
+					},
+					{
+						"penality" : 1,
+						"text": "On dirait que plus c’est écrit grand moins on le voit"
+					},
+					{
+						"penality" : 1,
+						"text": "Tiens, on retrouve certain chiffre du code sur cette peinture"
+					}
+				]
+			}
+		],
+	"resources" : []
+}	],
+     "win" : {
+         "name" : "win",
+          "challenges" : [],
+         "resources" : ["fin"]
+     },
+      "loose" : {
+          "name" : "loose",
+          "resources" : [],
+          "challenges" : []
+      },
+	"credits" : 
+	{
+		"text" : "Par Fran\u00e7ois Gautrais !",
+		"useHtml" : true
+	},
+	"map" : "/home/ptitcois/Documents/Angouleme/DemoRA/ressources/carte.png",
+	"name" : "game_medium"
+}

+ 417 - 0
app/src/main/assets/game_hard

@@ -0,0 +1,417 @@
+{
+    "password" : "19662016",
+    "max_time" : 30,
+	"resources_file" : "ressources.res",
+	"stages" : [{
+	"name" : "Intro",
+	"challenges" : [],
+	"resources" : ["e0"],
+	"event_end" : [ 
+		{"method" : "tuto"},
+		{"method" : "armBomb"}
+	]
+},
+{
+	"name" : "Bibliotheuqe_intro",
+	"challenges" :
+		[
+			{
+				"type" : "QRCodeTreasure",
+				"name" : "BibQr",
+				"bad_message" : "C'est pas le bon !",
+				"text" : "Trouve le QR code caché à côté de la photo suivante",
+				"qr_value" : "http://www.mjc-louis-aragon.asso.fr/qrcode/#1",
+				"resource" : "bib",
+				"indices" : [
+					{
+						"type" : "text",
+						"text" : "C'est un vélo sur la pancarte ?",
+						"penality": 0.5
+					},
+					{
+						"type" : "text",
+						"penality": 1,
+						"text" : "Et il y a un truc vert pour accrocher les vélos..." 
+					},
+					{
+						"type" : "text",
+						"penality": 1,
+						"text" : "regarde devant la bibliothèque sur les supports de vélos." 
+					}
+				]
+			}
+		],
+	"resources" : ["e1"]
+},
+{
+	"name" : "MPG",
+	"charIndex" : 0,
+	"resources" : ["e3"],
+	"challenges" :
+		[
+			{
+				"type" : "QRCodeTreasure",
+				"name" : "MPG_Qr",
+				"bad_message" : "C'est pas le bon !",
+				"text" : "Trouve le QR code caché à côté de la photo suivante",
+				"qr_value" : "http://www.mjc-louis-aragon.asso.fr/qrcode/#2",
+				"resource" : "mpg",
+				"indices" : [
+					{
+						"text" : "Un endroit Merveilleux où les enfants et ados sont Joyeux !",
+						"penality": 0.5
+					},
+					{
+						"penality": 1,
+						"text" : "[...] [...] Loisirs." 
+					},
+					{
+						"penality": 1,
+						"text" : "Ne pas sonner SVP !" 
+					}
+				],
+				"event_end" : { "method" : "giveResource", "args" : ["e2q", "e2"] }
+			},
+			{
+                    "type" : "QCM",
+                    "name" : "a1",
+                    "question" : "La première réponse",
+                    "answer" : ["Louis Aragon"],
+                    "choices" : [
+									"Oui !",
+									"Jean-Vincent Placé", 
+									"Zinedine Zidane", 
+									"Patrick Timsit", 
+									"Louis Aragon", 
+									"La réponse D",
+									"Non !",
+									"Kylian M'Bappé",
+									"Des jeux"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "none",
+					"penality": 0.5,
+					"mandatory" : false
+                 },
+                 {
+                    "type" : "QCM",
+                    "name" : "a2",
+                    "question" : "La deuxieme réponse",
+                    "answer" : ["Des jeux"],
+                    "choices" : [
+									"Oui !",
+									"Des jeux", 
+									"Rond", 
+									"Des livres", 
+									"Des DVD",
+									"Non !",
+									"Kylian M'Bappé",
+									"Marc Levy"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "none",
+					"penality": 0.5,
+                    "mandatory" : false
+                 },
+                 {
+                    "type" : "QCM",
+                    "name" : "a3",
+                    "question" : "La troisème réponse",
+                    "answer" : ["Rond", "Carré"],
+                    "choices" : [
+									"Oui !",
+									"Des jeux", 
+									"Rond", 
+									"Carré", 
+									"Losange",
+									"VTT",
+									"Dodécagonal",
+									"Hexagone"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "none",
+					"penality": 0.5,
+                    "mandatory" : false
+                 },
+                 {
+                    "type" : "QCM",
+                    "name" : "a4",
+                    "question" : "La quatrième réponse",
+                    "answer" : ["D"],
+                    "choices" : [
+									"Oui !",
+									"Des jeux", 
+									"Rond", 
+									"Carré", 
+									"Losange",
+									"VTT",
+									"D",
+									"Hexagone",
+									"W"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "none",
+					"penality": 0.5,
+                    "mandatory" : false
+                 },
+                 {
+                    "type" : "QCM",
+                    "name" : "a5",
+                    "question" : "La cinquième réponse",
+                    "answer" : ["w", "vv"],
+                    "choices" : [
+									"Oui !",
+									"Des jeux", 
+									"Bob Marley", 
+									"Carré", 
+									"42",
+									"VTT",
+									"D",
+									"Hexagone",
+									"W"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "none",
+					"penality": 0.5,
+                    "mandatory" : false
+                 },
+                 {
+                    "type" : "QCM",
+                    "name" : "a6",
+                    "question" : "La sixième réponse",
+                    "answer" : "Des DVD",
+                    "choices" : [
+									"Oui !",
+									"Des DVD", 
+									"Bob Marley", 
+									"Carré", 
+									"42",
+									"VTT",
+									"D",
+									"Hexagone",
+									"W"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "none",
+					"penality": 0.5,
+                    "mandatory" : false
+                 },
+                 {
+                    "type" : "QCM",
+                    "name" : "a7",
+                    "question" : "La septième réponse",
+                    "answer" : "Ma Campagne",
+                    "choices" : [
+									"Le Blosne RPZ 35 BZH !!!!",
+									"C'est quoi la question ?", 
+									"Bob Marley", 
+									"Zinedine Zidane", 
+									"42",
+									"Ma Campagne",
+									"D",
+									"W"
+								],
+                    "bad_message" : "T'es nul !",
+					"resource" : "none",
+					"penality": 0.5,
+                    "mandatory" : false
+                 }
+		]
+},
+{
+	"name" : "Ludothèque",
+	"challenges" :
+		[
+			{
+				"type" : "QRCodeTreasure",
+				"name" : "Jardin ludothèque",
+				"bad_message" : "C'est pas le bon !",
+				"text" : "Trouve un QR Code à cet endroit pour continuer.",
+				"qr_value" : "http://www.mjc-louis-aragon.asso.fr/qrcode/#3",
+				"resource" : "ludo",
+				"indices" : [
+					{
+						"type" : "text",
+						"text" : "Regarde en face de la porte de la MPG et avancez !",
+						"penality": 0.5
+					},
+					{
+						"type" : "text",
+						"text" : "Fais le tour du jardin de la LUDO et lève la tête !",
+						 "penality": 1
+					},
+					{
+						"type" : "text",
+						"text" : "Quel beau plafond exterieur en beton...",
+						 "penality": 1
+					}
+				]
+			},
+			{
+				"type": "Question",
+				"name" : "QuestionLudo",
+				"bad_message" : "Non !",
+				"question" : "Trouvez le numéro de la place sur laquelle est garé la voiture sur l'énigme de la porte arrière de la MJC",
+				"good_message" : "Brillant !",
+				"resource" : "parking",
+				"answer" : "87",
+				"indices" : [
+					{
+						"penality" : 0.5,
+						"text": "Question de point de vu..."
+					},
+					{
+						"penality" : 1,
+						"text": "Ces places sont bien dans l’ordre !"
+					},
+					{
+						"penality" : 1,
+						"text": "Bon, regardez à l’envers."
+					},
+					{
+						"penality" : 1,
+						"text": "si on regarde les places à côté dans l’autre sens la voiture est garée entre la place 86 et 88"
+					}
+				]
+			}
+		],
+	"resources" : ["e4"],
+	"charIndex" : 5
+},
+{
+	"name" : "JardinDhiver",
+	"resources" : ["e5"],
+	"challenges" :
+		[
+			{
+				"type" : "Question",
+				"name" : "JardinHiverQuestion",
+				"bad_message" : "Non !",
+				"resource" : "jardin", 
+				"question" : "Trouve les 6 lettres du mot caché dans le jardin d’hiver de la MJC",
+				"good_message" : "Bravo !",
+				"answer" : "patate",
+				"indices" : [
+					{
+						"penality" : 0.5,
+						"text": "Le rouge est ma couleur favorite."
+					},
+					{
+						"penality" : 1,
+						"text": "Les affiches sont intéressantes ?"
+					},
+					{
+						"penality" : 1,
+						"text": "Des LETTRES en ROUGE sur les AFFICHES qui peuvent faire un MOT"
+					}
+				]
+			}
+		],
+	"charIndex" : 2
+},
+{
+	"name" : "Accueil",
+	"resources" : ["e6"],
+	"challenges" :
+		[
+			{
+				"type" : "QRCodeTreasure",
+				"name" : "accueilQr",
+				"bad_message" : "C'est pas le bon !",
+				"good_message" : "Bravo !",
+				"resource" : "accueil",
+				"qr_value" : "https://www.facebook.com/mediathequesdequartierdangouleme/",
+				"text" : "Pour trouver ce QR code caché, pose la question \"Comment est votre blanquette\" à l’habitant de l’aquarium",
+				"indices" : [
+					{
+						"penality" : 0.5,
+						"text": "Quand on a une question, on la pose à l’accueil non ?"
+					},
+					{
+						"penality" : 1,
+						"text": "On peut aussi avoir des informations à la médiathèque."
+					},
+					{
+						"penality" : 1,
+						"text": "C’est quoi ca sur le flyer du facebook de la médiathèque ?"
+					}
+				]
+			}
+		],
+	"charIndex" : 6
+},
+{
+	"name" : "livre",
+	"resources" : ["e7"],
+	"challenges" :
+		[
+			{
+				"type" : "Question",
+				"name" : "LivreQuestion",
+				"question" : "Va chercher ce roman : un message codé se trouve à l'intérieur…",
+				"bad_message" : "Non !",
+				"resource" : "livre",
+				"answer" : "Dindon",
+				"indices" : [
+					{
+						"penality" : 0.5,
+						"text": "Les romans se trouvent à l'étage sont classés par ordre alphabétique du nom de l'auteur."
+					},
+					{
+						"penality" : 1,
+						"text": "La côte est R ISH"
+					},
+					{
+						"penality" : 1,
+						"text": "Quand je ne sais pas où trouver ce que je cherche, je regarde au sommaire ou à l'index. Généralement, c'est au début ou à la fin du livre."
+					}
+				]
+			}
+		],
+	"charIndex" : 1
+},
+{
+	"name" : "Bomb",
+	"challenges" :
+		[
+			{
+				"type" : "BombDefuse",
+				"name" : "DefuseBomb",
+				"resource" : "oeil",
+				"text" : "Va à cet endroit et désamorce le dispositif !",
+				"indices" : [
+					{
+						"penality" : 0.5,
+						"text": "L’oeil se trouve sur une peinture d’un mur"
+					},
+					{
+						"penality" : 1,
+						"text": "On dirait que plus c’est écrit grand moins on le voit"
+					},
+					{
+						"penality" : 1,
+						"text": "Tiens, on retrouve certain chiffre du code sur cette peinture"
+					}
+				]
+			}
+		],
+	"resources" : []
+}	],
+     "win" : {
+         "name" : "win",
+          "challenges" : [],
+         "resources" : ["fin"]
+     },
+      "loose" : {
+          "name" : "loose",
+          "resources" : [],
+          "challenges" : []
+      },
+	"credits" : 
+	{
+		"text" : "Par Fran\u00e7ois Gautrais !",
+		"useHtml" : true
+	},
+	"map" : "/home/ptitcois/Documents/Angouleme/DemoRA/ressources/carte.png",
+	"name" : "game_medium"
+}

+ 39 - 36
app/src/main/assets/game_medium

@@ -1,6 +1,6 @@
 {
     "password" : "19662016",
-    "max_time" : 120,
+    "max_time" : 45,
 	"resources_file" : "ressources.res",
 	"stages" : [{
 	"name" : "Intro",
@@ -19,7 +19,7 @@
 				"type" : "QRCodeTreasure",
 				"name" : "BibQr",
 				"bad_message" : "C'est pas le bon !",
-				"text" : "Trouvez le QR code caché à côté de la photo suivante",
+				"text" : "Trouve le QR code caché à côté de la photo suivante",
 				"qr_value" : "http://www.mjc-louis-aragon.asso.fr/qrcode/#1",
 				"resource" : "bib",
 				"indices" : [
@@ -32,6 +32,11 @@
 						"type" : "text",
 						"penality": 1,
 						"text" : "Et il y a un truc vert pour accrocher les vélos..." 
+					},
+					{
+						"type" : "text",
+						"penality": 1,
+						"text" : "regarde devant la bibliothèque sur les supports de vélos." 
 					}
 				]
 			}
@@ -48,6 +53,7 @@
 				"type" : "QRCodeTreasure",
 				"name" : "MPG_Qr",
 				"bad_message" : "C'est pas le bon !",
+				"text" : "Trouve le QR code caché à côté de la photo suivante",
 				"qr_value" : "http://www.mjc-louis-aragon.asso.fr/qrcode/#2",
 				"resource" : "mpg",
 				"indices" : [
@@ -64,7 +70,7 @@
 						"text" : "Ne pas sonner SVP !" 
 					}
 				],
-				"event_end" : { "method" : "giveResource", "args" : ["e2", "e2q"] }
+				"event_end" : { "method" : "giveResource", "args" : ["e2q", "e2"] }
 			},
 			{
                     "type" : "QCM",
@@ -83,7 +89,7 @@
 									"Des jeux"
 								],
                     "bad_message" : "T'es nul !",
-					"resource" : "question",
+					"resource" : "none",
 					"penality": 0.5,
 					"mandatory" : false
                  },
@@ -103,7 +109,7 @@
 									"Marc Levy"
 								],
                     "bad_message" : "T'es nul !",
-					"resource" : "question",
+					"resource" : "none",
 					"penality": 0.5,
                     "mandatory" : false
                  },
@@ -123,7 +129,7 @@
 									"Hexagone"
 								],
                     "bad_message" : "T'es nul !",
-					"resource" : "question",
+					"resource" : "none",
 					"penality": 0.5,
                     "mandatory" : false
                  },
@@ -144,7 +150,7 @@
 									"W"
 								],
                     "bad_message" : "T'es nul !",
-					"resource" : "question",
+					"resource" : "none",
 					"penality": 0.5,
                     "mandatory" : false
                  },
@@ -165,7 +171,7 @@
 									"W"
 								],
                     "bad_message" : "T'es nul !",
-					"resource" : "question",
+					"resource" : "none",
 					"penality": 0.5,
                     "mandatory" : false
                  },
@@ -186,7 +192,7 @@
 									"W"
 								],
                     "bad_message" : "T'es nul !",
-					"resource" : "question",
+					"resource" : "none",
 					"penality": 0.5,
                     "mandatory" : false
                  },
@@ -206,7 +212,7 @@
 									"W"
 								],
                     "bad_message" : "T'es nul !",
-					"resource" : "question",
+					"resource" : "none",
 					"penality": 0.5,
                     "mandatory" : false
                  }
@@ -220,17 +226,18 @@
 				"type" : "QRCodeTreasure",
 				"name" : "Jardin ludothèque",
 				"bad_message" : "C'est pas le bon !",
+				"text" : "Trouve un QR Code à cet endroit pour continuer.",
 				"qr_value" : "http://www.mjc-louis-aragon.asso.fr/qrcode/#3",
 				"resource" : "ludo",
 				"indices" : [
 					{
 						"type" : "text",
-						"text" : "Regardez en face de la porte de la MPG et avancez !",
+						"text" : "Regarde en face de la porte de la MPG et avancez !",
 						"penality": 0.5
 					},
 					{
 						"type" : "text",
-						"text" : "Fait le tour du jardin de la LUDO et lève la tête !",
+						"text" : "Fais le tour du jardin de la LUDO et lève la tête !",
 						 "penality": 1
 					},
 					{
@@ -244,7 +251,7 @@
 				"type": "Question",
 				"name" : "QuestionLudo",
 				"bad_message" : "Non !",
-				"question" : "Et maintenant, un petit test de raisonnement : Regardez sur la porte, vous trouverez cette énigme. Vous pouvez essayer de deviner sur quelle place est garé la voiture, mais ca m’étonnerais que vous trouviez !",
+				"question" : "Trouvez le numéro de la place sur laquelle est garé la voiture sur l'énigme de la porte arrière de la MJC",
 				"good_message" : "Brillant !",
 				"resource" : "parking",
 				"answer" : "87",
@@ -259,11 +266,11 @@
 					},
 					{
 						"penality" : 1,
-						"text": "C’est à vous mettre la tête à l’envers hein ?"
+						"text": "Bon, regardez à l’envers."
 					},
 					{
 						"penality" : 1,
-						"text": "Bon, regardez à l’envers."
+						"text": "si on regarde les places à côté dans l’autre sens la voiture est garée entre la place 86 et 88"
 					}
 				]
 			}
@@ -281,7 +288,7 @@
 				"name" : "JardinHiverQuestion",
 				"bad_message" : "Non !",
 				"resource" : "jardin", 
-				"question" : "Trouvez les 6 lettres du mot caché dans le jardin d’hiver de la MJC",
+				"question" : "Trouve les 6 lettres du mot caché dans le jardin d’hiver de la MJC",
 				"good_message" : "Bravo !",
 				"answer" : "patate",
 				"indices" : [
@@ -313,8 +320,8 @@
 				"bad_message" : "C'est pas le bon !",
 				"good_message" : "Bravo !",
 				"resource" : "accueil",
-				"qr_value" : "http://www.mjc-louis-aragon.asso.fr/qrcode/#4",
-				"text" : "Pour trouver ce QR code caché, posez la question \"Comment est votre blanquette\" à l’habitant de l’aquarium",
+				"qr_value" : "https://www.facebook.com/mediathequesdequartierdangouleme/",
+				"text" : "Pour trouver ce QR code caché, pose la question \"Comment est votre blanquette\" à l’habitant de l’aquarium",
 				"indices" : [
 					{
 						"penality" : 0.5,
@@ -334,37 +341,29 @@
 	"charIndex" : 6
 },
 {
-	"name" : "Prospectus",
+	"name" : "livre",
 	"resources" : ["e7"],
 	"challenges" :
 		[
 			{
-				"type" : "QRCodeTreasure",
-				"name" : "ProspectusQr",
-				"text" : "J'espère que vous avez bien récupérer les documents, car des fois il faut aussi savoir se débrouiller soit-même pour avoir sa réponse... Trouvez la vous même et montrez la moi avec votre caméra !",
+				"type" : "Question",
+				"name" : "LivreQuestion",
+				"question" : "Va chercher ce roman : un message codé se trouve à l'intérieur…",
 				"bad_message" : "Non !",
-				"resource" : "prospect",
-				"qr_value" : "http://www.mjc-louis-aragon.asso.fr/qrcode/#4",
+				"resource" : "livre",
+				"answer" : "Dindon",
 				"indices" : [
 					{
 						"penality" : 0.5,
-						"text": "Je vous avais bien dit de prendre la plaquette et le facebook de la médiathèque."
+						"text": "Les romans se trouvent à l'étage sont classés par ordre alphabétique du nom de l'auteur."
 					},
 					{
 						"penality" : 1,
-						"text": "Deux moitiés ça fait un entier  non ?"
+						"text": "La côte est R ISH"
 					},
 					{
 						"penality" : 1,
-						"text": "QR quoi ?"
-					},
-					{
-						"penality" : 1,
-						"text": "Le meilleur pour la fin… de la plaquette."
-					},
-					{
-						"penality" : 1,
-						"text": "Une moitié de QR code sur la feuille facebook et une à la fin de la plaquette..."
+						"text": "Quand je ne sais pas où trouver ce que je cherche, je regarde au sommaire ou à l'index. Généralement, c'est au début ou à la fin du livre."
 					}
 				]
 			}
@@ -379,7 +378,7 @@
 				"type" : "BombDefuse",
 				"name" : "DefuseBomb",
 				"resource" : "oeil",
-				"text" : "Allez à cet endroit et désamorcez la bombe !",
+				"text" : "Va à cet endroit et désamorce le dispositif !",
 				"indices" : [
 					{
 						"penality" : 0.5,
@@ -388,6 +387,10 @@
 					{
 						"penality" : 1,
 						"text": "On dirait que plus c’est écrit grand moins on le voit"
+					},
+					{
+						"penality" : 1,
+						"text": "Tiens, on retrouve certain chiffre du code sur cette peinture"
 					}
 				]
 			}

+ 11 - 10
app/src/main/assets/ressources.res

@@ -1,5 +1,6 @@
 {
 	"mjc" : {"type" : "Image"},
+	"none" : { "type" : "None"},
 	"intro_fin" : { "type" : "Audio"},
 	"mpg" : { "type" : "Image" } ,
 	"question" : {"type" : "Image"},
@@ -20,56 +21,56 @@
 		"display" : true
 	},
 	"e1" : {
-		"comment" : "Appel inconnu",
-		"title" : "Appel inconnu",
+		"comment" : "",
+		"title" : "Appel inconnu : vélo",
 		"type" : "Audio",
 		"display" : true
 	},
 	"e2" : {
 		"comment" : "Appel inconnu",
-		"title" : "Appel inconnu",
+		"title" : "Appel inconnu : médiathèque",
 		"type" : "Audio",
 		"display" : true
 	},
 	"e2q" : {
 		"comment" : "Appel inconnu",
-		"title" : "Appel inconnu",
+		"title" : "Appel inconnu : questionnaire de la mort",
 		"type" : "Audio",
 		"display" : true
 	},
 	"e3" : {
 		"comment" : "Appel inconnu",
-		"title" : "Appel inconnu",
+		"title" : "Appel inconnu : Centre de loisirs",
 		"type" : "Audio",
 		"display" : true
 	},
 	"e4" : {
 		"comment" : "Appel inconnu",
-		"title" : "Appel inconnu",
+		"title" : "Appel inconnu : Ludothèque",
 		"type" : "Audio",
 		"display" : true
 	},
 	"e5" : {
 		"comment" : "Appel inconnu",
-		"title" : "Appel inconnu",
+		"title" : "Appel inconnu : Jardin divers",
 		"type" : "Audio",
 		"display" : true
 	},
 	"e6" : {
 		"comment" : "Appel inconnu",
-		"title" : "Appel inconnu",
+		"title" : "Appel inconnu : Aquarium",
 		"type" : "Audio",
 		"display" : true
 	},
 	"e7" : {
 		"comment" : "Appel inconnu",
-		"title" : "Appel inconnu",
+		"title" : "Appel inconnu : Big brother",
 		"type" : "Audio",
 		"display" : true
 	}, 
 	"fin" : {
 		"comment" : "Nous avons réussi !",
-		"title" : "On a gagné",
+		"title" : "Félicitations !",
 		"type" : "Audio",
 		"display" : true
 	}

+ 14 - 0
app/src/main/java/macampcorp/macamp/activities/BombActivity.java

@@ -1,5 +1,6 @@
 package macampcorp.macamp.activities;
 
+import android.app.Activity;
 import android.content.Intent;
 import android.graphics.Point;
 import android.graphics.Typeface;
@@ -11,6 +12,7 @@ import android.support.v7.widget.Toolbar;
 import android.view.Display;
 import android.view.View;
 import android.widget.Button;
+import android.widget.ImageButton;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -35,6 +37,7 @@ public class BombActivity extends AppCompatActivity {
     protected TextView mTvCar;
     protected TextView mTvBomb;
     protected Button mButtons[] = new Button[12];
+    protected ImageButton mBack;
 
     /**
      * Si vrai, c'est que c'est la fin du jeu
@@ -93,6 +96,7 @@ public class BombActivity extends AppCompatActivity {
         mTvCar= findViewById(R.id.tv_car);
 
         mTvBomb.setText(mBomb.getPasswordKnown());
+        mBack=findViewById(R.id.b_back);
 
         Typeface face = Typeface.createFromAsset(getAssets(), "fonts/font.ttf");
         mTvPassword.setTypeface(face);
@@ -134,6 +138,8 @@ public class BombActivity extends AppCompatActivity {
             mButtons[i].setHeight(c);
             mButtons[i].setWidth(c);
         }
+        if(!getIntent().getBooleanExtra("stacked", true))
+            mBack.setVisibility(View.GONE);
     }
 
     protected String completeTypedString()
@@ -202,6 +208,7 @@ public class BombActivity extends AppCompatActivity {
         updatePassword();
     }
 
+    public void onBackClicked(View v) { onBackPressed(); }
 
     protected void clear()
     {
@@ -231,6 +238,13 @@ public class BombActivity extends AppCompatActivity {
     public void onButtonOk(View v) {onButton(KEY_OK);}
     public static final int REQUEST_CODE = 24;
 
+
+    public static void startStacked(Activity a)
+    {
+        Intent i = new Intent(a, BombActivity.class);
+        i.putExtra("stacked", true);
+        a.startActivity(i);
+    }
 }
 
 

+ 2 - 0
app/src/main/java/macampcorp/macamp/activities/CreditsActivity.java

@@ -6,6 +6,7 @@ import android.content.Intent;
 import android.support.v7.app.AppCompatActivity;
 import android.os.Bundle;
 import android.text.Html;
+import android.view.View;
 import android.widget.TextView;
 
 import macampcorp.macamp.game.Game;
@@ -54,4 +55,5 @@ public class CreditsActivity extends AppCompatActivity {
         Intent in = new Intent(v, CreditsActivity.class);
         v.startActivityForResult(in, REQUEST_CODE);
     }
+    public void onBackClicked(View v) { onBackPressed(); }
 }

+ 0 - 63
app/src/main/java/macampcorp/macamp/activities/ErrorActivity.java

@@ -1,63 +0,0 @@
-package macampcorp.macamp.activities;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.Intent;
-import android.support.v7.app.AppCompatActivity;
-import android.os.Bundle;
-import android.view.View;
-import android.widget.EditText;
-import android.widget.TextView;
-
-import macampcorp.macamp.game.Game;
-import macampcorp.macamp.game.scheduler.Scheduler;
-
-public class ErrorActivity extends AppCompatActivity {
-
-    protected Game mGame;
-    protected String mText="";
-    protected String mTitle="";
-    protected TextView mEt;
-    protected TextView mTvTitle;
-    public static int REQUEST_CODE=-1;
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_error);
-        mEt=(TextView)findViewById(R.id.message);
-        mTvTitle=(TextView)findViewById(R.id.title);
-        mText=getIntent().getExtras().getString("text", "");
-        mTitle=getIntent().getExtras().getString("title", "Error");
-        mEt.setText(mText);
-        mTvTitle.setText(mTitle);
-    }
-
-    public void onOk(View v)
-    {
-        setResult(0);
-        finish();
-    }
-
-    public static void error(Activity ctx, String text)
-    {
-        Intent intent = new Intent(ctx, ErrorActivity.class);
-        intent.putExtra("text", text);
-        ctx.startActivityForResult(intent, REQUEST_CODE);
-    }
-
-    public static void error(Activity ctx, String title, String text)
-    {
-        Intent intent = new Intent(ctx, ErrorActivity.class);
-        intent.putExtra("text", text);
-        intent.putExtra("title", title);
-        ctx.startActivityForResult(intent, REQUEST_CODE);
-    }
-
-
-    @Override
-    public void onBackPressed() {
-        setResult(0);
-        super.onBackPressed();
-    }
-
-}

+ 4 - 4
app/src/main/java/macampcorp/macamp/activities/HostActivity.java

@@ -204,8 +204,8 @@ public class HostActivity extends Activity implements ChallengeFragment.OnFragme
             int res = mCurrentFragment.check();
             if(res==Challenge.OK)
             { //bonne réponse
-                challengeValidate(mCurrentFragment.getChallenge(),  mGame, this);
                 Sound.ok(this);
+                challengeValidate(mCurrentFragment.getChallenge(),  mGame, this);
             }else if(res==Challenge.FAIL)
             { //mauvaise réponse
                 //réponse facultative
@@ -259,8 +259,8 @@ public class HostActivity extends Activity implements ChallengeFragment.OnFragme
             int c = Math.round(x.getPenality()*60);
             String out = ""+c+" "+_(R.string.secondes);
             if(c>=60)
-                out=(c/60)+" "+_(R.string.secondes)+" "+
-                        _(R.string.and)+" "+(c%60)+" "+_(R.string.minutes);
+                out=(c/60)+" "+_(R.string.minutes )+" "+
+                        _(R.string.and)+" "+(c%60)+" "+_(R.string.secondes);
 
             new AlertDialog.Builder(this)
                     .setTitle(_(R.string.dialog_sure_title))
@@ -342,7 +342,7 @@ public class HostActivity extends Activity implements ChallengeFragment.OnFragme
     public void startResource(Resource r, boolean autopass)
     {
         Intent intent = AndroidResources.getViewerIntent(this, r, autopass);
-        startActivityForResult(intent, AndroidResources.getViewerRequestCode(r));
+        startActivityForResult(intent, AndroidResources.getViewerRequestCode(r) );
     }
 
     public void _challengeValidate(Challenge c, Game g, HostActivity dri, boolean ok) {

+ 81 - 0
app/src/main/java/macampcorp/macamp/activities/MenuActivity.java

@@ -0,0 +1,81 @@
+package macampcorp.macamp.activities;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+
+import macampcorp.macamp.activities.R;
+import macampcorp.macamp.game.Game;
+
+public class MenuActivity extends AppCompatActivity {
+
+    protected boolean mIsSaved;
+    protected Button mContinue;
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_menu);
+        mContinue = findViewById(R.id.b_continue);
+        Game g = Game.load(this);
+        if(g==null)
+        {
+            mContinue.setVisibility(View.GONE);
+            mIsSaved=false;
+        }else
+        {
+            mContinue.setVisibility(View.VISIBLE);
+            mIsSaved=true;
+        }
+
+    }
+
+    public void onNew(View v)
+    {
+        if(!mIsSaved)
+        {
+            SelectDifficultActivity.start(this);
+            return;
+        }
+        askForReset();
+
+    }
+
+    public void onContinue(View v)
+    {
+        HostActivity.startGame(this, false);
+    }
+
+    public void askForReset()
+    {
+        final Activity t = this;
+        AlertDialog.Builder builder = new AlertDialog.Builder(this);
+        // Add the buttons
+        builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
+            public void onClick(DialogInterface dialog, int id) {
+                SelectDifficultActivity.start(t);
+            }
+        });
+        builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
+            public void onClick(DialogInterface dialog, int id) {
+
+            }
+        });
+        // Set other dialog properties
+        builder.setMessage(R.string.toast_continue);
+
+        // Create the AlertDialog
+        AlertDialog dialog = builder.create();
+        dialog.show();
+    }
+
+    public static void start(Activity a)
+    {
+        Intent i = new Intent(a, MenuActivity.class);
+        a.startActivity(i);
+    }
+}

+ 8 - 34
app/src/main/java/macampcorp/macamp/activities/PermissionActivity.java

@@ -28,6 +28,7 @@ import java.util.ArrayList;
 import macampcorp.macamp.game.Game;
 import macampcorp.macamp.game.Resource;
 import macampcorp.macamp.lang.Locale;
+import macampcorp.macamp.ui.Sound;
 import macampcorp.macamp.utils.files.FileManager;
 
 
@@ -63,12 +64,10 @@ public class PermissionActivity extends AppCompatActivity {
         m_nPerm=PERMISSIONS.length;
         ArrayList<String> al = new ArrayList<String>();
 
-        
-
         FileManager.init(this);
         mText = (TextView) findViewById(R.id.disclamer);
         if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.N) {
-            mText.setText(Html.fromHtml(DISCLAMER));
+            mText.setText(Html.fromHtml(getResources().getString(R.string.text_disclamer)));
         }else
         {
             mText.setText(Html.fromHtml(DISCLAMER, Html.FROM_HTML_MODE_COMPACT));
@@ -81,38 +80,19 @@ public class PermissionActivity extends AppCompatActivity {
             } else m_nPerm--;
         }
 
-
         try {
             if (al.size() > 0)
                 ActivityCompat.requestPermissions(this, al.toArray(new String[m_nPerm]), ALL_PERMISSIONS);
         }catch(Exception e) {
             e.printStackTrace();
         }
+
+        Sound.init(this);
     }
 
 
-    public void askForReset()
-    {
-        final Activity t = this;
-        AlertDialog.Builder builder = new AlertDialog.Builder(this);
-        // Add the buttons
-                builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
-                    public void onClick(DialogInterface dialog, int id) {
-                        startGame(false);
-                    }
-                });
-                builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
-                    public void onClick(DialogInterface dialog, int id) {
-                        startGame(true);
-                    }
-                });
-        // Set other dialog properties
-        builder.setMessage(R.string.toast_continue);
 
-        // Create the AlertDialog
-        AlertDialog dialog = builder.create();
-        dialog.show();
-    }
+
 
 
     public void onRequestPermissionsResult(int requestCode,
@@ -130,14 +110,6 @@ public class PermissionActivity extends AppCompatActivity {
                     break;
             }
         }
-
-
-    }
-
-    public void startGame(boolean  erase)
-    {
-        HostActivity.startGame(this, erase);
-        finish();
     }
 
     public void onUnderstood(View v)
@@ -146,9 +118,11 @@ public class PermissionActivity extends AppCompatActivity {
 
         if(m_nPerm==0)
         {
-            askForReset();
+            MenuActivity.start(this);
         }
     }
 
 
+
+
 }

+ 50 - 0
app/src/main/java/macampcorp/macamp/activities/SelectDifficultActivity.java

@@ -0,0 +1,50 @@
+package macampcorp.macamp.activities;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.text.Html;
+import android.view.View;
+import android.widget.TextView;
+
+public class SelectDifficultActivity extends AppCompatActivity {
+    protected TextView mEasy;
+    protected TextView mMedium;
+    protected TextView mHard;
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_select_difficult);
+
+        mEasy=findViewById(R.id.tv_easy);
+        mMedium=findViewById(R.id.tv_medium);
+        mHard=findViewById(R.id.tv_hard);
+
+        mEasy.setText(Html.fromHtml(getResources().getString(R.string.diff_select_easy)));
+        mMedium.setText(Html.fromHtml(getResources().getString(R.string.diff_select_medium)));
+        mHard.setText(Html.fromHtml(getResources().getString(R.string.diff_select_hard)));
+    }
+
+    public void onChooseEasy(View v)
+    {
+        HostActivity.startGame(this, true, "game_easy");
+    }
+
+    public void onChooseMedium(View v)
+    {
+        HostActivity.startGame(this, true, "game_medium");
+    }
+
+    public void onChooseHard(View v)
+    {
+        HostActivity.startGame(this, true, "game_hard");
+    }
+
+    public static void start(Activity a)
+    {
+        Intent i = new Intent(a, SelectDifficultActivity.class);
+        a.startActivity(i);
+        a.finish();
+    }
+}

+ 0 - 1
app/src/main/java/macampcorp/macamp/activities/TutoActivity.java

@@ -73,7 +73,6 @@ public class TutoActivity extends AppCompatActivity  {
         { //Si ce n''est pas le dernier on demande confirmation
             new AlertDialog.Builder(this)
                     .setTitle(R.string.tuto_pass_title)
-                    .setMessage(R.string.no)
                     .setNegativeButton(android.R.string.no,  null)
                     .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
                         public void onClick(DialogInterface arg0, int arg1) {

+ 14 - 2
app/src/main/java/macampcorp/macamp/activities/fragments/ChallengeFragment.java

@@ -15,6 +15,7 @@ import android.view.animation.Animation;
 import android.view.animation.AnimationUtils;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
+import android.widget.ScrollView;
 import android.widget.TextView;
 
 import java.util.ArrayList;
@@ -49,6 +50,7 @@ public abstract class ChallengeFragment extends Fragment{
     protected Challenge     mChallenge;
     protected ImageView     mImage;
     private PhotoViewAttacher mAttacher;
+    private ScrollView      mScroller;
 
     public HostActivity getHostActivity()
     {
@@ -146,8 +148,16 @@ public abstract class ChallengeFragment extends Fragment{
             throw new ResourceNotFoundException(res);
         }
 
-        if( r.isImage() )
+        if(r.isVideo() || r.isVideo())
         {
+            throw new RuntimeException("La ressource n'est pas une image");
+        }
+        if(r.isNone()){
+            mImage.setVisibility(View.GONE);
+        }
+        else if( r.isImage() )
+        {
+            mImage.setVisibility(View.VISIBLE);
             String name = r.getName();
             String path = r.getFile();
 
@@ -259,8 +269,10 @@ public abstract class ChallengeFragment extends Fragment{
             getHostActivity().setVisibilityView(R.id.btn_indice, View.INVISIBLE);
         }
         onInitChallenge(c);
-        if(getView().getAnimation()==null)
+        if(getView().getAnimation()==null) {
             getView().startAnimation(mAnimIn);
+
+        }
         else appendToAnim();
 
     }

+ 4 - 1
app/src/main/java/macampcorp/macamp/activities/fragments/QCMFragment.java

@@ -9,6 +9,7 @@ import android.view.ViewGroup;
 import android.widget.ImageView;
 import android.widget.RadioButton;
 import android.widget.RadioGroup;
+import android.widget.ScrollView;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -31,6 +32,7 @@ public class QCMFragment extends ChallengeFragment {
     protected TextView mUIQuestion;
     protected RadioGroup mUIGoupQCM;
     protected ArrayList<String> mChoices;
+    protected ScrollView mScroller;
 
     protected int           mIdOffset = 1234;
 
@@ -60,6 +62,7 @@ public class QCMFragment extends ChallengeFragment {
         mUIImage = (ImageView) v.findViewById(R.id.iv_img);
         mUIQuestion = (TextView) v.findViewById(R.id.tv_question);
         mUIGoupQCM = (RadioGroup) v.findViewById(R.id.rg_qcm);
+        mScroller = v.findViewById(R.id.scrollview);
         return v;
     }
 
@@ -120,6 +123,6 @@ public class QCMFragment extends ChallengeFragment {
     protected void onResetUi() {
         mUIGoupQCM.clearCheck();
         getHostActivity().setVisibilityView(R.id.btn_valid, View.VISIBLE);
+        mScroller.fullScroll(ScrollView.FOCUS_UP);
     }
-
 }

+ 4 - 1
app/src/main/java/macampcorp/macamp/activities/fragments/QRCodeFragment.java

@@ -9,6 +9,7 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.widget.Button;
 import android.widget.LinearLayout;
+import android.widget.ScrollView;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -61,7 +62,7 @@ public class QRCodeFragment extends ChallengeFragment  implements BarcodeCallbac
     protected LinearLayout mUITextIndices2;
     protected TextView      mUIGeoIndice2;
     protected LinearLayout  mUIGlobalIndice2;
-
+    protected ScrollView mScroller;
     public QRCodeFragment() {
         // Required empty public constructor
     }
@@ -117,6 +118,7 @@ public class QRCodeFragment extends ChallengeFragment  implements BarcodeCallbac
             mUIGlobalIndice2.setVisibility(View.GONE);
         }
         getHostActivity().setVisibilityView(R.id.btn_valid, View.INVISIBLE);
+        mScroller.fullScroll(ScrollView.FOCUS_UP);
     }
 
     @Override
@@ -131,6 +133,7 @@ public class QRCodeFragment extends ChallengeFragment  implements BarcodeCallbac
         vPresRoot=v.findViewById(R.id.presentation);
         vScanRoot=v.findViewById(R.id.root_qr);
         tvQuestion=v.findViewById(R.id.tv_question);
+        mScroller = v.findViewById(R.id.scrollview);
 
         mUITextIndices2= (LinearLayout) v.findViewById(R.id.ll_textIndices2);
         mUIGlobalIndice2 = (LinearLayout) v.findViewById(R.id.ll_rootIndices2);

+ 6 - 1
app/src/main/java/macampcorp/macamp/activities/fragments/QuestionFragment.java

@@ -14,6 +14,7 @@ import android.view.inputmethod.EditorInfo;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.EditText;
 import android.widget.ImageView;
+import android.widget.ScrollView;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -37,6 +38,9 @@ public class QuestionFragment extends ChallengeFragment  {
     protected Question  mQuestion=null;
 
 
+    protected ScrollView mScroller;
+
+
     public QuestionFragment() {
         // Required empty public constructor
     }
@@ -69,6 +73,7 @@ public class QuestionFragment extends ChallengeFragment  {
             }
 
         });
+        mScroller = v.findViewById(R.id.scrollview);
         mUIResponse.setOnTouchListener(new View.OnTouchListener() {
             @Override
             public boolean onTouch(View v, MotionEvent event) {
@@ -132,7 +137,7 @@ public class QuestionFragment extends ChallengeFragment  {
         mUIResponse.setText("");
         mUIResponse.setHint(R.string.hint_resp);
         getHostActivity().setVisibilityView(R.id.btn_valid, View.VISIBLE);
-
+        mScroller.fullScroll(ScrollView.FOCUS_UP);
     }
 
     @Override

+ 1 - 0
app/src/main/java/macampcorp/macamp/activities/viewers/ImageViewerActivity.java

@@ -28,6 +28,7 @@ public class ImageViewerActivity extends AppCompatActivity {
     private PhotoViewAttacher mAttacher;
 
 
+    public void onBackClicked(View v) { onBackPressed(); }
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {

+ 9 - 1
app/src/main/java/macampcorp/macamp/activities/viewers/MediaViewerAcitvity.java

@@ -25,7 +25,8 @@ import macampcorp.macamp.utils.files.FileManager;
 public class MediaViewerAcitvity extends AppCompatActivity implements MediaPlayer.OnSeekCompleteListener,
                                                                 MediaView.OnStartListener,
                                                                 SeekBar.OnSeekBarChangeListener,
-                                                                MediaPlayer.OnCompletionListener{
+                                                                MediaPlayer.OnCompletionListener,
+                                                                MediaView.OnPlayPauseListener {
     public static final int REQUEST_CODE = 27;
     private Resource mResource;
     private Button mInfo;
@@ -61,6 +62,7 @@ public class MediaViewerAcitvity extends AppCompatActivity implements MediaPlaye
         mMediaView = new MediaView(this);
         mMediaView.setOnStartListener(this);
         mMediaView.setOnCompleteListener(this);
+        mMediaView.setOnPlayPauseListener(this);
         mImageView = new ImageView(this);
 
         mFrameLayout.addView(mMediaView);
@@ -203,6 +205,11 @@ public class MediaViewerAcitvity extends AppCompatActivity implements MediaPlaye
             onOk(null);
     }
 
+    @Override
+    public void onPointerCaptureChanged(boolean hasCapture) {
+
+    }
+
     private class AutoSeek implements Runnable
     {
         private Handler mHandler;
@@ -259,4 +266,5 @@ public class MediaViewerAcitvity extends AppCompatActivity implements MediaPlaye
         super.onDestroy();
     }
 
+    public void onBackClicked(View v) { onBackPressed(); }
 }

+ 2 - 0
app/src/main/java/macampcorp/macamp/activities/viewers/ResourceListActivity.java

@@ -4,6 +4,7 @@ import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
 import android.util.Log;
+import android.view.View;
 import android.widget.ListView;
 
 import macampcorp.macamp.game.Game;
@@ -56,4 +57,5 @@ public class ResourceListActivity extends Activity {
         intent.putExtra("inventaire", Game.game().getInventaire());
         a.startActivity(intent);
     }
+    public void onBackClicked(View v) { onBackPressed(); }
 }

+ 13 - 4
app/src/main/java/macampcorp/macamp/game/Resource.java

@@ -24,18 +24,26 @@ import macampcorp.macamp.utils.files.JSONAssetsManager;
  */
 public class Resource implements Serializable {
 
+    public static final String IMAGE = "Image";
+    public static final String VIDEO = "Video";
+    public static final String AUDIO = "Audio";
+    public static final String NONE = "None";
+
+
     protected String mName;
     protected String mComment = "null";
     protected boolean isLoaded = false;
     protected boolean mIsDisplay = false;
     protected int   mStage;
     protected String mImage;
-    protected String mType = ""; //3D Image Audio Video
+    protected String mType = NONE; //3D Image Audio Video
     protected String mTitle= ""; //3D Image Audio Video
     private  static JSONObject mRessourcesList = null;
     public static ArrayList<String> mNotFound = new ArrayList<>();
     protected String mFile = null;
 
+
+
     public String getFile() {
         if(mFile!=null)
             return mFile;
@@ -198,9 +206,6 @@ public class Resource implements Serializable {
         return mTitle;
     }
 
-    public static final String IMAGE = "Image";
-    public static final String VIDEO = "Video";
-    public static final String AUDIO = "Audio";
 
 
     public boolean isAudio()
@@ -221,4 +226,8 @@ public class Resource implements Serializable {
     public boolean isDisplay() {
         return mIsDisplay;
     }
+
+    public boolean isNone() {
+        return mType.toLowerCase().compareTo(NONE.toLowerCase())==0;
+    }
 }

+ 13 - 8
app/src/main/java/macampcorp/macamp/ui/MediaView.java

@@ -24,6 +24,16 @@ public class MediaView extends SurfaceView implements View.OnClickListener,Surfa
     private Context mContext;
     private OnStartListener mOnStart;
     private MediaPlayer.OnCompletionListener mOnComplete;
+    private OnPlayPauseListener mPlayPauseListener;
+
+    public void setOnPlayPauseListener(OnPlayPauseListener l)
+    {
+        mPlayPauseListener=l;
+    }
+
+    public interface OnPlayPauseListener{
+        void onPlayPause(View v);
+    }
 
     public interface OnStartListener
     {
@@ -65,9 +75,9 @@ public class MediaView extends SurfaceView implements View.OnClickListener,Surfa
 
     public void clearPlayer() {
         mPlayer=null;
-
     }
 
+
     public boolean play(String path)
     {
         final MediaView x=this;
@@ -100,13 +110,8 @@ public class MediaView extends SurfaceView implements View.OnClickListener,Surfa
     public void onClick(View view) {
         if(mPlayer!=null)
         {
-            if(mPlayer.isPlaying())
-            {
-                mPlayer.pause();
-            }else{
-                mPlayer.start();
-            }
-
+            if(mPlayPauseListener!=null)
+                mPlayPauseListener.onPlayPause(view);
         }
     }
 

+ 49 - 15
app/src/main/java/macampcorp/macamp/ui/Sound.java

@@ -12,42 +12,76 @@ import android.view.View;
 import android.view.animation.Animation;
 import android.view.animation.AnimationUtils;
 
+import java.io.IOException;
+
 import macampcorp.macamp.activities.R;
 
 public class Sound {
+    public interface MediaCompletionListener{
+        void completed(int id);
+    }
+    public static final int BOOM = 0;
+    public static final int OK = 1;
+    public static final int FAIL = 2;
+
+    protected static int mIds[] = {R.raw.boom, R.raw.ok, R.raw.fail};
+    protected static MediaPlayer mPlayers[] = new MediaPlayer[mIds.length];
+
+
+
+
+    protected static MediaPlayer.OnCompletionListener mM = new MediaPlayer.OnCompletionListener() {
+        @Override
+        public void onCompletion(MediaPlayer mp) {
+
+        }
+    };
+
+    private static void precache(Activity a,int x)
+    {
+        MediaPlayer p = mPlayers[x];
+        int res = mIds[x];
+
+        if(p==null)
+            p=mPlayers[x]=MediaPlayer.create(a, mIds[x]);
+        p.setOnCompletionListener(mM);
+        p.setAudioStreamType(AudioManager.STREAM_MUSIC);
+        p.setLooping(false);
 
-    public static void play(Activity a, int res) {
-        MediaPlayer mediaPlayer = MediaPlayer.create(a, res);
-        mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
-        mediaPlayer.setLooping(false);
-        mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
-            @Override
-            public void onCompletion(MediaPlayer mp) {
-                mp.stop();
-                mp.release();
-            }
-        });
-        mediaPlayer.start();
+    }
+
+    public static void init(Activity a)
+    {
+        for(int i = 0; i<mIds.length; i++)
+            precache(a, i);
+    }
+
+    public static void play(Activity a, int x)
+    {
+        MediaPlayer p = mPlayers[x];
+        int res = mIds[x];
+        p.start();
     }
 
 
     public static void boom(Activity a)
     {
-        play(a, R.raw.boom);
+        play(a, BOOM);
     }
 
     public static void ok(Activity a)
     {
-        play(a, R.raw.ok);
+        play(a, OK);
     }
 
     public static void fail(Activity a)
     {
-        play(a, R.raw.fail);
+        play(a, FAIL);
         vibrate(a,500);
         animateFail(a);
     }
 
+
     public static void animateFail(Activity a)
     {
         View v = a.getWindow().getDecorView().findViewById(android.R.id.content);

+ 1 - 1
app/src/main/res/anim/trans_out.xml

@@ -1,5 +1,5 @@
 <set xmlns:android="http://schemas.android.com/apk/res/android">
-    <translate android:duration="600"
+    <translate android:duration="800"
         android:fromYDelta="0%"
         android:toYDelta="100%"/>
 </set>

BIN
app/src/main/res/drawable/back.png


+ 66 - 31
app/src/main/res/layout/activity_bomb.xml

@@ -8,39 +8,74 @@
     android:orientation="vertical"
     tools:context="macampcorp.macamp.activities.BombActivity">
 
-    <TextView
-        android:id="@+id/textView9"
+    <android.support.constraint.ConstraintLayout
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginEnd="8dp"
-        android:layout_marginLeft="8dp"
-        android:layout_marginRight="8dp"
-        android:layout_marginStart="8dp"
-        android:layout_marginTop="2dp"
-        android:gravity="center"
-        android:paddingTop="10sp"
-        android:text="Code de la bombe"
-        android:textSize="14sp"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toEndOf="@+id/divider4"
-        app:layout_constraintTop_toTopOf="parent" />
+        android:layout_height="wrap_content">
 
-    <TextView
-        android:id="@+id/tv_bombe"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginEnd="8dp"
-        android:layout_marginLeft="8dp"
-        android:layout_marginRight="8dp"
-        android:layout_marginStart="8dp"
-        android:layout_marginTop="2dp"
-        android:gravity="center"
-        android:paddingBottom="10sp"
-        android:text="_ _ _ _ _ _ _ "
-        android:textSize="14sp"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toEndOf="@+id/divider4"
-        app:layout_constraintTop_toTopOf="parent" />
+        <ImageButton
+            android:id="@+id/b_back"
+            android:layout_width="wrap_content"
+            android:layout_height="0dp"
+            android:layout_marginBottom="8dp"
+            android:layout_marginLeft="8dp"
+            android:layout_marginStart="8dp"
+            android:layout_marginTop="8dp"
+            android:adjustViewBounds="true"
+            android:background="#0000"
+            android:onClick="onBackClicked"
+            android:scaleType="fitCenter"
+            app:layout_constraintBottom_toBottomOf="@+id/linearLayout3"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:srcCompat="@drawable/back" />
+
+        <LinearLayout
+            android:id="@+id/linearLayout3"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="8dp"
+            android:layout_marginStart="8dp"
+            android:layout_marginTop="8dp"
+            android:orientation="vertical"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toEndOf="@+id/b_back"
+            app:layout_constraintTop_toTopOf="parent">
+
+            <TextView
+                android:id="@+id/textView9"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginEnd="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginStart="8dp"
+                android:layout_marginTop="2dp"
+                android:gravity="center"
+                android:paddingTop="10sp"
+                android:text="@string/btn_code"
+                android:textSize="14sp"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toEndOf="@+id/divider4"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <TextView
+                android:id="@+id/tv_bombe"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginEnd="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginStart="8dp"
+                android:layout_marginTop="2dp"
+                android:gravity="center"
+                android:paddingBottom="10sp"
+                android:text="_ _ _ _ _ _ _ "
+                android:textSize="14sp"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toEndOf="@+id/divider4"
+                app:layout_constraintTop_toTopOf="parent" />
+        </LinearLayout>
+    </android.support.constraint.ConstraintLayout>
 
     <LinearLayout
         android:layout_width="match_parent"

+ 33 - 2
app/src/main/res/layout/activity_credits.xml

@@ -7,6 +7,22 @@
     tools:context="macampcorp.macamp.activities.CreditsActivity">
 
 
+    <TextView
+        android:id="@+id/textView2"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:gravity="center"
+        android:text="@string/btn_credits"
+        android:textSize="@dimen/title_text_size"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toEndOf="@+id/imageButton4"
+        app:layout_constraintTop_toTopOf="parent" />
+
     <ImageView
         android:id="@+id/imageView2"
         android:layout_width="87dp"
@@ -37,11 +53,10 @@
         android:layout_marginLeft="8dp"
         android:layout_marginRight="8dp"
         android:layout_marginStart="8dp"
-        android:layout_marginTop="8dp"
         app:layout_constraintBottom_toTopOf="@+id/imageView3"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent">
+        app:layout_constraintTop_toBottomOf="@+id/textView2">
 
         <LinearLayout
             android:layout_width="match_parent"
@@ -58,4 +73,20 @@
         </LinearLayout>
     </ScrollView>
 
+    <ImageButton
+        android:id="@+id/imageButton4"
+        android:layout_width="wrap_content"
+        android:layout_height="0dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginStart="8dp"
+        android:adjustViewBounds="true"
+        android:background="#0000"
+        android:cropToPadding="false"
+        android:onClick="onBackClicked"
+        android:scaleType="fitCenter"
+        app:layout_constraintBottom_toBottomOf="@+id/textView2"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="@+id/textView2"
+        app:srcCompat="@drawable/back" />
+
 </android.support.constraint.ConstraintLayout>

+ 0 - 48
app/src/main/res/layout/activity_error.xml

@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:gravity="top"
-    android:orientation="vertical"
-    tools:context="macampcorp.macamp.activities.ErrorActivity">
-
-
-    <TextView
-        android:id="@+id/title"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:gravity="center"
-        android:text="Erreur:"
-        android:textSize="24sp"
-        android:textStyle="bold" />
-
-    <ScrollView
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_weight="1">
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:gravity="top"
-            android:orientation="vertical">
-
-            <TextView
-                android:id="@+id/message"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:text="TextView" />
-        </LinearLayout>
-    </ScrollView>
-
-    <Button
-        android:id="@+id/button"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:onClick="onOk"
-        android:text="Ok" />
-
-</LinearLayout>

+ 0 - 1
app/src/main/res/layout/activity_host.xml

@@ -12,7 +12,6 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:orientation="vertical"
-        android:padding="10sp"
         app:layout_anchor="@+id/linearLayout"
         app:layout_anchorGravity="left|top">
 

+ 77 - 37
app/src/main/res/layout/activity_media.xml

@@ -1,63 +1,88 @@
 <?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:paddingBottom="@dimen/activity_vertical_margin"
-    android:paddingLeft="@dimen/activity_horizontal_margin"
-    android:paddingRight="@dimen/activity_horizontal_margin"
-    android:paddingTop="@dimen/activity_vertical_margin"
     tools:context=".viewers.MediaViewerAcitvity">
 
+
     <Button
         android:id="@+id/info"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
-        android:layout_alignParentEnd="true"
-        android:layout_alignParentLeft="true"
-        android:layout_alignParentRight="true"
-        android:layout_alignParentStart="true"
+        android:layout_marginBottom="8dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
         android:onClick="onOk"
-        android:text="@string/btn_ok"
+        android:text="@string/pass"
         android:textSize="@dimen/font_button_size"
-        android:textStyle="bold" />
+        android:textStyle="bold"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent" />
 
     <ImageButton
         android:id="@+id/play"
         android:layout_width="40dp"
         android:layout_height="40dp"
         android:layout_alignTop="@+id/fullscreen"
+        android:layout_marginEnd="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginTop="8dp"
         android:layout_toLeftOf="@+id/fullscreen"
         android:layout_toStartOf="@+id/fullscreen"
         android:onClick="onPlayPause"
-        android:src="@android:drawable/ic_media_pause" />
+        android:src="@android:drawable/ic_media_pause"
+        app:layout_constraintEnd_toStartOf="@+id/fullscreen"
+        app:layout_constraintTop_toBottomOf="@+id/title" />
 
     <SeekBar
         android:id="@+id/seekBar"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+        android:layout_width="0dp"
+        android:layout_height="0dp"
         android:layout_alignBottom="@+id/play"
         android:layout_alignParentLeft="true"
         android:layout_alignParentStart="true"
         android:layout_below="@+id/title"
+        android:layout_marginBottom="8dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="16dp"
         android:layout_toLeftOf="@+id/play"
         android:layout_toStartOf="@+id/play"
-        android:background="#191919" />
+        android:background="#191919"
+        app:layout_constraintBottom_toBottomOf="@+id/play"
+        app:layout_constraintEnd_toStartOf="@+id/play"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/title" />
 
     <TextView
         android:id="@+id/title"
-        android:layout_width="fill_parent"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_alignParentEnd="true"
         android:layout_alignParentLeft="true"
         android:layout_alignParentRight="true"
         android:layout_alignParentStart="true"
         android:layout_alignParentTop="true"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:text="test"
         android:textAlignment="center"
         android:textAppearance="?android:attr/textAppearanceLarge"
         android:textSize="25dp"
-        android:textStyle="bold" />
+        android:textStyle="bold"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toEndOf="@+id/imageView4"
+        app:layout_constraintTop_toTopOf="parent" />
 
     <ImageButton
         android:id="@+id/fullscreen"
@@ -66,28 +91,43 @@
         android:layout_alignParentEnd="true"
         android:layout_alignParentRight="true"
         android:layout_below="@+id/title"
+        android:layout_marginEnd="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginTop="8dp"
         android:onClick="onFullscreen"
-        android:src="@android:drawable/ic_menu_crop" />
+        android:src="@android:drawable/ic_menu_crop"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/title" />
 
-    <RelativeLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_above="@+id/info"
+    <FrameLayout
+        android:id="@+id/media_viewer"
+        android:layout_width="0dp"
+        android:layout_height="0dp"
+        android:layout_alignParentBottom="true"
         android:layout_alignParentLeft="true"
+        android:layout_alignParentRight="true"
         android:layout_alignParentStart="true"
-        android:layout_below="@+id/seekBar"
-        android:gravity="center">
-
-        <FrameLayout
-            android:id="@+id/media_viewer"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:layout_alignParentBottom="true"
-            android:layout_alignParentLeft="true"
-            android:layout_alignParentRight="true"
-            android:layout_alignParentStart="true"
-            android:layout_alignParentTop="true"></FrameLayout>
+        android:layout_alignParentTop="true"
+        app:layout_constraintBottom_toTopOf="@+id/info"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/play"></FrameLayout>
 
-    </RelativeLayout>
+    <ImageView
+        android:id="@+id/imageView4"
+        android:layout_width="wrap_content"
+        android:layout_height="0dp"
+        android:layout_above="@+id/play"
+        android:layout_marginLeft="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:adjustViewBounds="true"
+        android:cropToPadding="false"
+        android:onClick="onBackClicked"
+        android:scaleType="fitCenter"
+        app:layout_constraintBottom_toBottomOf="@+id/title"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:srcCompat="@drawable/back" />
 
-</RelativeLayout>
+</android.support.constraint.ConstraintLayout>

+ 54 - 0
app/src/main/res/layout/activity_menu.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context="macampcorp.macamp.activities.MenuActivity">
+
+    <TextView
+        android:id="@+id/textView3"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:gravity="center"
+        android:text="@string/titre"
+        android:textColor="#000"
+        android:textSize="@dimen/title_text_size"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <Button
+        android:id="@+id/b_continue"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="24dp"
+        android:onClick="onContinue"
+        android:text="@string/btn_continuer"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/textView3" />
+
+    <Button
+        android:id="@+id/button11"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="24dp"
+        android:onClick="onNew"
+        android:text="@string/btn_new"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/b_continue" />
+</android.support.constraint.ConstraintLayout>

+ 43 - 7
app/src/main/res/layout/activity_resource_list.xml

@@ -1,8 +1,8 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:orientation="vertical"
     tools:context="macampcorp.macamp.activities.viewers.ResourceListActivity">
 
     <!-- The primary full-screen view. This can be replaced with whatever view
@@ -12,21 +12,57 @@
     <!-- This FrameLayout insets its children based on system windows using
          android:fitsSystemWindows. -->
 
+
     <TextView
         android:id="@+id/textView"
-        android:layout_width="match_parent"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:gravity="center"
         android:text="@string/lbl_journal"
-        android:textSize="@dimen/big_label_size" />
+        android:textAppearance="@style/TextAppearance.AppCompat"
+        android:textColor="#000000"
+        android:textSize="@dimen/big_label_size"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toEndOf="@+id/imageButton5"
+        app:layout_constraintTop_toTopOf="parent" />
 
     <ListView
         android:id="@+id/list_layout"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
+        android:layout_height="0dp"
+        android:layout_marginBottom="16dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="16dp"
         android:choiceMode="singleChoice"
         android:fastScrollAlwaysVisible="true"
         android:fastScrollEnabled="true"
         android:longClickable="false"
-        android:scrollingCache="true" />
+        android:scrollingCache="true"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/textView" />
+
+    <ImageButton
+        android:id="@+id/imageButton5"
+        android:layout_width="wrap_content"
+        android:layout_height="0dp"
+        android:adjustViewBounds="true"
+        android:background="#0000"
+        android:cropToPadding="true"
+        android:onClick="onBackClicked"
+        android:scaleType="fitCenter"
+        android:src="@drawable/back"
+        app:layout_constraintBottom_toBottomOf="@+id/textView"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="@+id/textView" />
 
-</LinearLayout>
+</android.support.constraint.ConstraintLayout>

+ 163 - 0
app/src/main/res/layout/activity_select_difficult.xml

@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context="macampcorp.macamp.activities.SelectDifficultActivity">
+
+    <Button
+        android:id="@+id/button15"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginTop="8dp"
+        android:onClick="onChooseHard"
+        android:text="@string/btn_choose"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_hard"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="@+id/tv_hard" />
+
+    <Button
+        android:id="@+id/button12"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginTop="8dp"
+        android:onClick="onChooseEasy"
+        android:text="@string/btn_choose"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_easy"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="@+id/tv_easy" />
+
+    <TextView
+        android:id="@+id/textView4"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:gravity="center"
+        android:text="@string/titre"
+        android:textColor="#000"
+        android:textSize="@dimen/title_text_size"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <Button
+        android:id="@+id/button"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginTop="8dp"
+        android:onClick="onChooseMedium"
+        android:text="@string/btn_choose"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_medium"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="@+id/tv_medium" />
+
+    <TextView
+        android:id="@+id/textView5"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:text="@string/diff_select_title"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/textView4" />
+
+    <TextView
+        android:id="@+id/tv_easy"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:text="@string/diff_select_easy"
+        app:layout_constraintEnd_toStartOf="@+id/button"
+        app:layout_constraintHorizontal_bias="0.0"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/divider6" />
+
+    <TextView
+        android:id="@+id/tv_medium"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:text="@string/diff_select_medium"
+        app:layout_constraintEnd_toStartOf="@+id/button"
+        app:layout_constraintHorizontal_bias="1.0"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/divider5" />
+
+    <View
+        android:id="@+id/divider5"
+        android:layout_width="0dp"
+        android:layout_height="3dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:background="?android:attr/listDivider"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tv_easy" />
+
+    <View
+        android:id="@+id/divider6"
+        android:layout_width="304dp"
+        android:layout_height="3dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:background="?android:attr/listDivider"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/textView5" />
+
+    <View
+        android:id="@+id/divider7"
+        android:layout_width="0dp"
+        android:layout_height="3dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:background="?android:attr/listDivider"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tv_medium" />
+
+    <TextView
+        android:id="@+id/tv_hard"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:text="@string/diff_select_hard"
+        app:layout_constraintEnd_toStartOf="@+id/button15"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/divider7" />
+</android.support.constraint.ConstraintLayout>

+ 51 - 36
app/src/main/res/layout/activity_viewer.xml

@@ -1,4 +1,5 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:id="@+id/rl_screen"
     android:layout_width="match_parent"
@@ -12,37 +13,25 @@
     <!-- This FrameLayout insets its children based on system windows using
          android:fitsSystemWindows. -->
 
-    <Button
-        android:id="@+id/info"
-        android:layout_width="match_parent"
-        android:layout_height="100px"
-        android:layout_alignParentBottom="true"
-        android:layout_centerHorizontal="true"
-        android:background="@drawable/uibutton"
-        android:onClick="onClickInfo"
-        android:text="@string/informations"
-        android:textSize="25px"
-        android:textStyle="bold" />
-
-    <FrameLayout
-        android:id="@+id/frame_viewer"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_above="@+id/info"
-        android:layout_below="@+id/title">
-
-        <ImageView
-            android:id="@+id/imageView"
-            android:layout_width="fill_parent"
-            android:layout_height="fill_parent"
-            android:layout_gravity="center"
-            android:adjustViewBounds="true"
-            android:cropToPadding="false"
-            android:focusable="true"
-            android:focusableInTouchMode="true"
-            android:visibility="visible" />
-
-    </FrameLayout>
+    <ImageView
+        android:id="@+id/imageView"
+        android:layout_width="0dp"
+        android:layout_height="0dp"
+        android:layout_gravity="center"
+        android:layout_marginBottom="8dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:adjustViewBounds="true"
+        android:cropToPadding="false"
+        android:focusable="true"
+        android:focusableInTouchMode="true"
+        android:visibility="visible"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/title" />
 
     <TextView
         android:id="@+id/title"
@@ -51,6 +40,10 @@
         android:layout_alignParentLeft="true"
         android:layout_alignParentStart="true"
         android:layout_alignParentTop="true"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
         android:layout_toLeftOf="@+id/imageButton"
         android:layout_toStartOf="@+id/imageButton"
         android:onClick="onClick"
@@ -58,18 +51,40 @@
         android:textAlignment="center"
         android:textAppearance="?android:attr/textAppearanceLarge"
         android:textSize="25dp"
-        android:textStyle="bold" />
+        android:textStyle="bold"
+        app:layout_constraintEnd_toStartOf="@+id/imageButton"
+        app:layout_constraintStart_toEndOf="@+id/imageView5" />
 
     <ImageButton
         android:id="@+id/imageButton"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_above="@+id/frame_viewer"
         android:layout_alignParentEnd="true"
         android:layout_alignParentRight="true"
         android:layout_alignParentTop="true"
+        android:layout_marginEnd="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginTop="8dp"
         android:background="#00000000"
         android:onClick="onClick"
-        android:src="@android:drawable/ic_menu_crop" />
+        android:src="@android:drawable/ic_menu_crop"
+        app:layout_constraintBottom_toBottomOf="@+id/title"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <ImageView
+        android:id="@+id/imageView5"
+        android:layout_width="wrap_content"
+        android:layout_height="0dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:adjustViewBounds="true"
+        android:cropToPadding="false"
+        android:onClick="onBackClicked"
+        app:layout_constraintBottom_toBottomOf="@+id/title"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:srcCompat="@drawable/back" />
 
-</RelativeLayout>
+</android.support.constraint.ConstraintLayout>

+ 1 - 1
app/src/main/res/layout/fragment_bomb.xml

@@ -76,7 +76,7 @@
                         android:layout_height="wrap_content"
                         android:layout_gravity="bottom"
                         android:layout_weight="5"
-                        android:hint="Désamorcer la bombe"
+                        android:hint="Désamorcer le dispositif"
                         android:text="@string/btn_defuse"
                         android:textSize="@dimen/font_button_size" />
 

+ 1 - 0
app/src/main/res/layout/fragment_qcm.xml

@@ -7,6 +7,7 @@ android:layout_height="match_parent"
 tools:context="macampcorp.macamp.activities.fragments.QCMFragment">
 
     <ScrollView
+        android:id="@+id/scrollview"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_weight="1">

+ 2 - 1
app/src/main/res/layout/fragment_qrcode.xml

@@ -38,13 +38,14 @@
     </android.support.design.widget.CoordinatorLayout>
 
     <ScrollView
+        android:id="@+id/scrollview"
         android:layout_width="match_parent"
         android:layout_height="match_parent">
 
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:orientation="vertical" >
+            android:orientation="vertical">
 
             <LinearLayout
                 android:id="@+id/presentation"

+ 1 - 0
app/src/main/res/layout/fragment_question.xml

@@ -7,6 +7,7 @@ android:layout_height="match_parent"
 tools:context="macampcorp.macamp.activities.fragments.QuestionFragment">
 
     <ScrollView
+        android:id="@+id/scrollview"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:measureAllChildren="false">

BIN
app/src/main/res/raw/boom.mp3


BIN
app/src/main/res/raw/boom.wav


BIN
app/src/main/res/raw/fail.mp3


BIN
app/src/main/res/raw/ok.mp3


+ 34 - 3
app/src/main/res/values/strings.xml

@@ -98,7 +98,6 @@
     <string name="title_activity_bomb">BombActivity</string>
 
 
-
     <string name="btn_credits">Crédits</string>
     <string name="btn_retry">Réessayer</string>
     <string name="btn_quit">Quitter</string>
@@ -122,7 +121,7 @@
     <string name="game_new">Nouveau jeu</string>
     <string name="yes">Oui</string>
     <string name="no">Non</string>
-    <string name="toast_continue">Voulez-vous continuer la partie ?</string>
+    <string name="toast_continue">Cela va supprimer votre précédente partie. Es-tu sûr de vouloir la supprimer ?</string>
     <string name="tuto_pass_title">Passer le tutorial</string>
     <string name="tuto_pass">Êtes-vous variment sûre de vouloir passer le tutoriel. Il est important pour bien comprendre le fonctionnement du jeu...</string>
     <string name="indice_prefix">Indice :</string>
@@ -144,6 +143,38 @@
         <h1>Tu as échoué !</h1>
         La tâche était trop dure ! C\'est pas si grave, il n\'y aura plus d\'objets électroniques (téléphone, tablettes, PC, télévisions, etc.). À moins que ... tu souhaites réessayer ?
     ]]></string>
-
+    <string name="text_disclamer"><![CDATA[
+    <h2>Ce jeu nécessite des déplacements en ville :</h2>
+    <ul>
+        <li>&emsp;<b>1)</b> Pour réaliser ce jeu, il faut être au alentour de la Place Vitoria (Ma Campagne) 16000 Angoulême, France.</li><br><br>
+        <li>&emsp;<b>2)</b> Assurez-vous que la MJC ET la médiathèque de Ma Campagne soient ouvertes encore 45 minutes avant de commencer le jeu !</li><br><br>
+        <li>&emsp;<b>3)</b> Les enfants doivent être accompagnés.</li><br><br>
+        <li>&emsp;<b>4)</b> Soyez vigilant à l’environnement (marches, altitude…).</li><br><br>
+    </ul>
+<b>En continuant, vous convenez que l’utilisation de ce jeu est à vos propres responsabilités.</b>
+    ]]></string>
+    <string name="pass">Passer</string>
+    <string name="titre">Un super titre</string>
+    <string name="btn_continuer">Continuer la partie</string>
+    <string name="btn_new">Nouvelle partie</string>
+    <string name="btn_choose">Choisir</string>
+    <string name="diff_select_title"><![CDATA[<h2>Sélectionne ton niveau de difficulté:</h2>]]></string>
+    <string name="diff_select_easy"><![CDATA[<h2>Facile:</h2>
+            <i>Je n’ai pas envie de me presser, en plus c’est dur ce jeu…</i><br>
+            <b>Recommandé si tu ne connais pas trop le quartier</b>
+        ]]>
+   </string>
+
+    <string name="diff_select_medium">
+        <![CDATA[
+            <h2>Moyen:</h2>
+            <i>Quelques indices et hésitations ne vous pénalisent pas trop</i><br>
+            <b>Recommandé si tu n’es pas un habitué de la médiathèque ou de la MJC</b>
+        ]]>
+    </string>
+    <string name="diff_select_hard"><![CDATA[
+            <h2>Difficile:</h2>
+            <i>Je suis pas là pour rigoler: prêt à courir et pas d’indice pour nous</i><br>
+            <b>Recommandé si tu connais, le quartier, la médiathèque et la MJC comme ta poche !</b>]]></string>
 
 </resources>