Changement d'interface graphique

This commit is contained in:
2025-12-31 11:44:04 +01:00
commit 9501053984
85 changed files with 7097 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
{
"permissions": {
"allow": [
"Bash(tree:*)",
"Bash(./gradlew:*)",
"Bash(dir:*)"
]
}
}
+15
View File
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
+3
View File
@@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml
Generated
+1
View File
@@ -0,0 +1 @@
BoideloV3
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidProjectSystem">
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
</component>
</project>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="21" />
</component>
</project>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<value>
<entry key="MainActivity">
<State />
</entry>
<entry key="app">
<State />
</entry>
</value>
</component>
</project>
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
</selectionStates>
</component>
</project>
+19
View File
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveExternalAnnotations" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" project-jdk-name="24" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
</set>
</option>
</component>
</project>
+418
View File
@@ -0,0 +1,418 @@
# Analyse Complète du Code - BoideloV3
## 📋 Table des Matières
1. [Présentation du Projet](#présentation-du-projet)
2. [Structure du Projet](#structure-du-projet)
3. [Fichiers Principaux](#fichiers-principaux)
4. [Fonctionnalités](#fonctionnalités)
5. [Technologies et Dépendances](#technologies-et-dépendances)
6. [Architecture](#architecture)
7. [Composants et Leurs Relations](#composants-et-leurs-relations)
8. [Configuration](#configuration)
---
## 🎮 Présentation du Projet
**BoideloV3** est une application Android de jeu d'alcool (similaire à "King's Cup" ou "Never Have I Ever"). L'application permet à un groupe de joueurs de répondre à des questions aléatoires avec des consommations de boissons associées.
### Caractéristiques Principales
- **Jeu multijoueur** (minimum 3 joueurs, sans maximum)
- **115 questions préchargées** depuis un fichier JSON
- **Interface en français** avec Material Design 3
- **Intégration OpenAI** (en développement)
- **Connexion PostgreSQL** (prête)
- **Interface moderne et responsive**
---
## 📁 Structure du Projet
```
C:\Users\polar\Documents\boidelo\
├── .gradle/ # Cache de construction Gradle
├── .idea/ # Configuration IntelliJ IDEA
├── app/
│ ├── build.gradle # Configuration de build app-level
│ ├── libs/ # Librairies JAR externes
│ │ ├── postgresql-42.2.27.jre7.jar
│ │ └── postgresql-42.6.0.jar
│ └── src/
│ └── main/
│ ├── AndroidManifest.xml
│ ├── assets/
│ │ ├── question.json # Base de données questions (115 questions)
│ │ └── questionOLD.json
│ ├── java/com/example/boidelov3/
│ │ ├── MainActivity.java
│ │ ├── Jeux.java # Activité principale du jeu
│ │ ├── Jeuxold.java # Implémentation héritée
│ │ ├── JeuxParametres.java # Paramètres du jeu
│ │ ├── ChatGPTTask.java # Intégration OpenAI (commenté)
│ │ ├── DatabaseConnection.java # Connexion PostgreSQL
│ │ ├── Question.java # Modèle de données Question
│ │ └── Questions.java # Conteneur de questions
│ └── res/
│ ├── anim/ # Animations
│ ├── drawable/ # Icônes et graphiques
│ ├── layout/ # Layouts UI (4 fichiers XML)
│ ├── mipmap-*/ # Icônes pour différentes densités
│ ├── values/ # Chaînes, couleurs, thèmes
│ ├── values-night/ # Ressources mode nuit
│ └── xml/ # Fichiers de configuration XML
├── build.gradle # Configuration de build projet-level
├── gradle.properties # Propriétés Gradle
├── settings.gradle # Paramètres du projet
├── gradlew, gradlew.bat # Exécutables Gradle wrapper
└── .gitignore # Fichier Git ignore
```
---
## 📄 Fichiers Principaux
### Activités Principales
#### `MainActivity.java`
**Point d'entrée principal** de l'application.
**Responsabilités :**
- Gestion de la saisie des noms de joueurs
- Validation du minimum de 3 joueurs
- Génération dynamique de l'interface utilisateur
- Persistence des noms avec SharedPreferences
#### `Jeux.java`
**Cœur du jeu**, gère l'affichage des questions et les mécaniques de jeu.
**Responsabilités :**
- Chargement des questions depuis le JSON
- Sélection aléatoire sans répétition
- Gestion des tours de joueurs
- Feedback visuel avec arrière-plans colorés
- Remplacement dynamique des variantes
#### `JeuxParametres.java`
**Écran de configuration** des paramètres du jeu.
**Responsabilités :**
- Configuration du nombre de questions
- Gestion des comptes de boissons
- Configuration de l'API OpenAI
- Lancement de l'activité Jeux
#### `Jeuxold.java`
**Version héritée** du jeu avec questions hardcodées (non utilisée activement).
### Modèles de Données
#### `Question.java`
**Modèle de données** pour une question individuelle.
**Propriétés :**
```java
public class Question {
private int id; // Identifiant unique
private String question; // Texte de la question
private int boire; // Nombre de boissons
private boolean donner; // Flag de distribution
private boolean recevoir; // Flag de réception
private List<String> variantes; // Variantes de la question
private int manches; // Nombre de manches
private String stop; // Message d'arrêt
}
```
#### `Questions.java`
**Classe conteneur** pour la liste de questions.
### Intégrations
#### `ChatGPTTask.java`
**Intégration OpenAI** pour la génération de questions avec ChatGPT.
**Statut :** Commenté / En développement
**Fonctionnalités prévues :**
- Génération dynamique de questions
- Appel API à OpenAI
- Traitement des réponses
#### `DatabaseConnection.java`
**Gestionnaire de connexion** à la base de données PostgreSQL.
**Configuration :**
- Hôte : 82.65.214.214
- Port : 5432
- Base de données : boidelo
- Utilisateur : android
---
## ⚡ Fonctionnalités
### Gestion des Joueurs
- **Entrée dynamique** des noms de joueurs
- **Minimum 3 joueurs** requis pour commencer
- **Support illimité** de nombre de joueurs
- **Persistance** avec SharedPreferences
### Système de Questions
- **115 questions préchargées** depuis JSON
- **Sélection aléatoire** sans répétition
- **Variantes** avec remplacement dynamique de contenu
- **Questions à manches** avec mécanique de compte à rebours
### Mécaniques de Jeu
- **Ajustement dynamique** du nombre de boissons
- **Randomisation** des joueurs pour les questions
- **Feedback visuel** avec arrière-plans colorés
- **Catégorisation** (distribution/réception)
### Fonctionnalités Avancées
- **Intégration OpenAI ChatGPT** (stade de développement)
- **Connectivité PostgreSQL** (prête)
- **Paramètres personnalisables**
- **Défis multi-manches**
### Interface Utilisateur
- **Trois activités principales** : Main, Jeux, Paramètres
- **Interface Material Design 3**
- **Localisation en français**
- **Layout responsive avec ConstraintLayout**
---
## 🛠 Technologies et Dépendances
### Technologies Principales
| Technologie | Version | Usage |
|-------------|---------|-------|
| **Android SDK** | 33 (compile) | Développement Android natif |
| **Java** | - | Langage principal |
| **Gradle** | 8.2 | Automatisation de build |
### Bibliothèques Principales
```gradle
dependencies {
// Cœur Android
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
// Réseau
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
// Base de données
implementation 'com.impossibl.pgjdbc-ng:pgjdbc-ng:0.8.3'
// Traitement JSON
implementation 'com.google.code.gson:gson:2.8.8'
// Tests
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
```
### Librairies Externes
| Librairie | Version | Utilisation |
|-----------|---------|-------------|
| **OkHttp** | 4.9.1 | Client HTTP pour appels API |
| **PostgreSQL JDBC** | 42.6.0 | Connectivité base de données |
| **Gson** | 2.8.8 | Sérialisation/désérialisation JSON |
---
## 🏗 Architecture
### Pattern MVC (Model-View-Controller)
```
┌─────────────────────────────────────────────────┐
│ Model │
│ • Question.java │
│ • Questions.java │
└─────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────┐
│ Controller │
│ • MainActivity.java │
│ • Jeux.java │
│ • JeuxParametres.java │
└─────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────┐
│ View │
│ • XML Layouts │
│ • Resources (drawable, strings, colors) │
└─────────────────────────────────────────────────┘
```
### Architecture Basée sur les Activités
```
MainActivity
├── Gère l'entrée des joueurs
├── Valide le minimum de 3 joueurs
└── Lance JeuxParametres
JeuxParametres
├── Configure les paramètres du jeu
├── Gère la configuration de l'API OpenAI
└── Lance l'activité Jeux
Jeux
├── Charge les questions depuis JSON
├── Gère l'état du jeu
├── Affiche les questions aléatoires
└── Gère les interactions des joueurs
```
### Persistence des Données
| Méthode | Usage |
|---------|-------|
| **SharedPreferences** | Noms des joueurs et paramètres du jeu |
| **JSON Assets** | Base de données des questions |
| **PostgreSQL** | Base de données externe (planifié) |
### Opérations Asynchrones
| Type | Implémentation |
|------|----------------|
| **AsyncTask** | Opérations de base de données (héritage) |
| **OkHttp Callbacks** | Opérations réseau |
---
## 🔗 Composants et Leurs Relations
```
┌────────────────────────────────────────────────────────────┐
│ MainActivity │
│ - Saisie des noms de joueurs │
│ - Validation (min. 3 joueurs) │
│ - Génération UI dynamique │
└────────────────────┬───────────────────────────────────────┘
┌────────────────────────────────────────────────────────────┐
│ JeuxParametres │
│ - Configuration du jeu │
│ - Setup API OpenAI │
│ - Lance Jeux │
└────────────────────┬───────────────────────────────────────┘
┌────────────────────────────────────────────────────────────┐
│ Jeux │
│ - Charge questions depuis JSON │
│ - Gère l'état du jeu │
│ - Affiche questions aléatoires │
│ - Gère interactions joueurs │
└────────────────────┬───────────────────────────────────────┘
┌────────────────────────────────────────────────────────────┐
│ Question Model │
│ - Stocke les données de question │
│ - Gère variantes et manches │
│ - Fournit les mécaniques de jeu │
└────────────────────────────────────────────────────────────┘
```
---
## ⚙️ Configuration
### Configuration de Build
| Propriété | Valeur |
|-----------|--------|
| **Compile SDK** | 33 |
| **Min SDK** | 24 |
| **Target SDK** | 33 |
| **Version Code** | 1 |
| **Version Name** | "1.0" |
| **Package** | com.example.boidelov3 |
### Configuration de l'Application
| Fichier | Description |
|---------|-------------|
| **AndroidManifest.xml** | Permissions Internet, 4 activités déclarées |
| **gradle.properties** | AndroidX activé, 2GB RAM allouée |
| **settings.gradle** | Nom du projet : "BoideloV3" |
### Configuration Base de Données
```
Hôte : 82.65.214.214
Port : 5432
Base de données : boidelo
Utilisateur : android
```
### Dépendances Externes
| Service | Statut |
|---------|--------|
| **PostgreSQL Database** | Prêt |
| **OpenAI API** | En développement |
---
## 📊 Observations Clés
1. **Localisation Française** - L'application est entièrement localisée en français
2. **Jeu d'Alcool** - Conçu pour des jeux sociaux à base de boissons avec questions
3. **Évolution de Version** - V3 indique plusieurs itérations, avec code héritage préservé
4. **Pratiques Android Modernes** - Utilise AndroidX, Material Design 3, outils de build modernes
5. **Intégration Base de Données** - Prêt pour JSON local et PostgreSQL distant
6. **Intégration IA** - Support OpenAI planifié mais pas entièrement implémenté
7. **Architecture Évolutive** - Supporte joueurs et questions illimités
---
## 🔮 Statut des Fonctionnalités
| Fonctionnalité | Statut |
|----------------|--------|
| Jeu multijoueur | ✅ Terminé |
| Questions JSON | ✅ Terminé |
| Interface UI | ✅ Terminé |
| PostgreSQL | 🔧 Prêt |
| OpenAI ChatGPT | 🚧 En développement |
| Tests unitaires | 🔧 Configuré |
---
## 📝 Conclusion
Le codebase représente une **application Android de jeu d'alcool bien structurée** avec des patterns d'architecture modernes, prête pour la production mais avec certaines fonctionnalités encore en développement. L'architecture est propre, modulaire et facilement extensible pour de futures améliorations.
---
*Document généré automatiquement - 2025*
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 864 KiB

+1
View File
@@ -0,0 +1 @@
/build
+43
View File
@@ -0,0 +1,43 @@
plugins {
id 'com.android.application'
}
android {
namespace 'com.example.boidelov3'
compileSdk 33
packagingOptions { resources.excludes.add("META-INF/*") } // This line is added to avoid the error: Duplicate files copied in APK META-INF/LICENSE.txt
defaultConfig {
applicationId "com.example.boidelov3"
minSdk 24
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
implementation 'com.impossibl.pgjdbc-ng:pgjdbc-ng:0.8.3'
implementation 'com.google.code.gson:gson:2.8.8'
}
Binary file not shown.
Binary file not shown.
+21
View File
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+45
View File
@@ -0,0 +1,45 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.BoideloV3"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.boidelov3.Jeux"
android:configChanges="orientation|screenSize"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name="com.example.boidelov3.JeuxParametres"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name="com.example.boidelov3.EndGameActivity"
android:exported="false"
android:screenOrientation="portrait" />
</application>
</manifest>
+853
View File
@@ -0,0 +1,853 @@
{
"version": "2",
"questions": [
{
"id": 1,
"question": "Celles/Ceux qui ont habité dans plus de 3 villes diferentes",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 2,
"question": "Ceux qui ont dansé aujourd'hui",
"gorger": 1,
"distribution": true,
"recois": true
},
{
"id": 3,
"question": "si tu n'as pas ton veritable nom sur insta",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 4,
"question": "si tu a des photos sur insta",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 5,
"question": "Les joueurs de Counter Strike ",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 5,
"question": "La dernière personne à avoir vomi en soirée ",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 6,
"question": "Toutes celles (ou ceux) qui ont du verni à ongles",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 7,
"question": "Tous les joueurs célibataires",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 8,
"question": "Tous ceux qui ont des lunettes",
"gorger": 2,
"distribution": true,
"recois": true
},
{
"id": 9,
"question": "Tous ceux qui ont déjà triché à un examen",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 10,
"question": "Le/La plus radin(e)",
"gorger": 4,
"distribution": false,
"recois": true
},
{
"id": 11,
"question": "<J1> a toi de juger : entre <J1> et <J2> qui stresse le plus pour un rien selon toi? Le perdant ",
"gorger": 5,
"distribution": false,
"recois": true
}, {
"id": 12,
"question": "Le mec qui a le plus gros ventre à bière ",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 13,
"question": "Tous ceux qui se sont déjà fait exclure de cours",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 14,
"question": "<J1>, donne le nombre d'habitant du/de la <variante> ( à 1 000 000 près) Si tu as faux tu bois, sinon tu ",
"gorger": 3,
"distribution": true,
"recois": false,
"variante": ["Tadjikistant", "Monaco", "Belgique", "Suisse", "Allemagne", "Chine", "Inde"]
},
{
"id": 15,
"question": "Tous ceux qui ont des frères et soeurs",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 16,
"question": "<J1> a qui appartient le slogan suivant? <variante>",
"variante": ["Des pâtes oui mais des (panzani)"," Le plaisir pour les petites faims. (Kinder Bueno)","Réveillez le lion qui est en vous. (Cereale lion)","Parce que le monde bouge (CIC)","Ça coule de source ! (Cristaline)", "Pensez différemment (apple)" ],
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 17,
"question": "Celles et ceux qui ont eu un Windows phone",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 18,
"question": "<J1>, Boire un café fait baisser le taux d'alcool? Si tu as faux ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 19,
"question": "Celles/Ceux qui se sont déjà battus",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 20,
"question": "Celui/Celle qui pèse le plus lourd",
"variante": ["lourd","leger"],
"gorger": 3,
"distribution": true,
"recois": false
},
{
"id": 21,
"question": "Pour se décoincer, le/la plus <variante>",
"variante": ["timide", "enervé ", "angoissé","aigri"],
"gorger": 2,
"distribution": false,
"recois": true
},
{
"id": 22,
"question": "Le/La plus <variante>",
"gorger": 3,
"variante": ["jeune","vieille"],
"distribution": false,
"recois": true
},
{
"id": 23,
"question": "Celles/Ceux qui ont fait des études <variante>",
"gorger": 3,
"variante": ["L","Scientifique", "Bac Professionel", "STMG"],
"distribution": true,
"recois": true
},
{
"id": 25,
"question": "Celles et ceux qui ont deja joué <variante> de maniere recurrente ",
"gorger": 3,
"variante": ["du piano","de la guitare", "du saxophone", "de la batterie"],
"distribution": true,
"recois": true
},
{
"id": 26,
"question": "Les gens qui se sont masturbés aujourd'hui",
"gorger": 3,
"distribution": true,
"recois": true,
"caliente": true
},
{
"id": 27,
"question": "Celui ou celle a la meilleure place",
"gorger": 2,
"distribution": false,
"recois": true
},
{
"id": 28,
"question": "Celles et ceux qui n'ont jamais trompé leur partenaire",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 29,
"question": "Celui/Celle avec les vêtements les plus beaux ",
"gorger": 1,
"distribution": false,
"recois": true
},
{
"id": 30,
"question": "Celui/Celle qui a les cheveux les plus <variante> ",
"gorger": 2,
"variante": ["longs","courts"],
"distribution": true,
"recois": true
},
{
"id": 31,
"question": "Les végans ",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 32,
"question": "La personne la plus maquillé ",
"gorger": 2,
"distribution": true,
"recois": true
}, {
"id": 33,
"question": "Celles/Ceux qui ont déjà appelé leur partenaire par le prénom de leurs ex",
"gorger": 4,
"distribution": false,
"recois": true
},
{
"id": 34,
"question": "Celles et ceux qui boit de la <variante> actuellement",
"gorger": 3,
"distribution": true,
"recois": true,
"variante": ["vodka", "rhum", "tequila", "whisky"]
},
{
"id": 35,
"question": "Les joueurs qui ont un <variante> dans leurs prénom",
"gorger": 3,
"distribution": false,
"recois": true,
"variante": ["a","e","i","o","u","y"]
},
{
"id": 36,
"question": "Le/La joueur/euse avec le plus gros cul",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 37,
"question": "Celles/Ceux qui ont moins de <variante> ans",
"gorger": 3,
"distribution": false,
"recois": true,
"variante": ["21","22","23","24","25","26"]
},
{
"id": 38,
"question": "Celui/celle avec le plus gros appetit sexuel",
"gorger": 3,
"distribution": false,
"recois": true,
"caliente": true
},
{
"id": 39,
"question": "Ceux/Celles qui fumes (VapeNation compris)",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 40,
"question": "Celles et ceux qui ont au moins un BAC +<variante>",
"gorger": 1,
"distribution": true,
"recois": true,
"variante": [0,1,2,3,4,5]
},
{
"id": 41,
"question": "Le premier joueur à se lever",
"doubledistribution": true,
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 42,
"question": "Ceux qui n'ont jamais eu l'occasion de faire un strip tease",
"gorger": 3,
"distribution": false,
"recois": true,
"caliente": true
},
{
"id": 43,
"question": "Le premier joueur à enlever un vêtements",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 44,
"question": "Tous ceux qui ont déjà uriné dans une piscine ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 30,
"question": "Celui/Celle avec le plus de follow sur <variante>",
"gorger": 3,
"distribution": true,
"recois": true,
"variante": ["instagram","facebook","tik-tok"]
},
{
"id": 31,
"question": "Celui/Celle avec le nom de famille le plus compliqué",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 32,
"question": "Les joueurs qui n'ont pas encore distribué de gorgées",
"gorger": 3,
"distribution": false,
"recois": true
}, {
"id": 33,
"question": "Le premier joueur à donner l'heure",
"doubledistribution": true,
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 34,
"question": "Celles et ceux qui ont déjà dépenser plus de 2000 euros en un achat",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 35,
"question": "La personne la moins courageuse",
"gorger": 1,
"distribution": false,
"recois": true
},
{
"id": 36,
"question": "Celles/Ceux qui rentre chez eux à la fin de la soirée",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 37,
"question": "Celles et ceux dont le jour d'anniversaire est un nombre <variante>",
"gorger": 3,
"distribution": true,
"recois": true,
"variante": ["impaire","paire"]
},
{
"id": 38,
"question": "Si tu as un téléphone qui a un prix supperieur d'achat a 1000Euros, tu est riche donc en tant que personne généreuse",
"gorger": 3,
"distribution": true,
"recois": false
},
{
"id": 39,
"question": "Tous ceux qui ont fait plus de 100km pour venir ici ",
"gorger": 3,
"distribution": true,
"recois": false
},
{
"id": 40,
"jeux": true,
"question": "Le jeu du revolver: Chaque joueur a maintenant 7 balles, une balle correspondant à une gorgée. Les joueurs ont la capacité de tirer des balles à tout moment du jeu.",
"distribution": false,
"recois": false
},
{
"id": 41,
"question": "<J1>",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 42,
"jeux": true,
"question": "<J1> est le vieu/vieille briscard ! Interdiction de montrer tes dents pendant <manche> manches",
"manches": true,
"arret": "Tu peux arreter de cacher tes belles dents"
},
{
"id": 43,
"jeux": true,
"question": "<J1> et <J2> liser le premier SMS qui s'affiche quand on tape <variante> dans la barre de recherche. le plus marrant",
"gorger": 3,
"variante": ["désolé","caca","bourré","mine","nazi"],
"distribution": true,
"recois": false
}, {
"id": 44,
"jeux": true,
"question": "A tour de role, vous avez exactement 3 secondes pour donner un mot en rapport avec le mots dit precedemment.<J1> tu commences en choissisant un mot. Le perdant",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 45,
"jeux": true,
"question": "Le jeu du PIM PAM POUM. Le premier qui perd ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 46,
"jeux": true,
"question": "<J1> defie <J2> au chifoumi ! Le perdant",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 47,
"jeux": true,
"question": "<J1> est dans le <variante> ! Tu dois parler au <variante> pendant <manches> manches ",
"variante": ["passé", "futur"],
"manches": true,
"arret": "Tu est revenu dans le present",
"distribution": false,
"recois": false,
"caliente": false
},
{
"id": 48,
"question": "<J1> tu bois autant de gorgées que tu as d'années d'études après le BAC"
},
{
"id": 49,
"jeux": true,
"question": "<J1> et <J2> ferment leurs yeux ! Ils/Elles doivent deviner la couleur des yeux de l'autre. ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 50,
"jeux": true,
"question": "<J1> est manchot ! Il/Elle ne peut plus utiliser ses doigts durant <manches> manches . Si il/elle s'en sert, il/elle devra boire autant de gorgées qu'il/elle a utilisé de doigts",
"distribution": false,
"arret": "Tu n'es plus manchot",
"recois": true
},
{
"id": 51,
"jeux": true,
"question": "<J1> et <J2> , si vous êtes ensemble dans la vraie vie, vous pouvez distribuer 2 gorgées , autrement buvez-les"
},
{
"id": 52,
"jeux": true,
"question": "<J1> a la tourette ! A chaque fois que tu bois une gorgée, tu dois CRIER une insulte. C'est un stade avancé, ça dure <manches> manches",
"manches": true,
"arret": "Tu n'as plus tourette."
},
{
"id": 53,
"jeux": true,
"question": "<J1>, donne la couleur préférée de <J2> si tu te trompes",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 54,
"jeux": true,
"question": "<J1> à l'oeil de serpent ! Dès qu'un joueur te regarde dans les yeux, il/elle boit. Si tu es arrivé a faire boire personne avant <manches> manches, tu ",
"gorger": 4,
"distribution": false,
"recois": true
}, {
"id": 55,
"jeux": true,
"question": "<J1> et <J2> se mesurent ! Le/la plus <variante>",
"gorger": 3,
"variante": ["petit","grand"],
"distribution": true,
"recois": true
},
{
"id": 56,
"jeux": true,
"question": "<J1> doit terminer toutes ses phrases par - <variante> pendant <manches> manches",
"variante": ["C'est clair","han","quoicoubeh"]
},
{
"id": 57,
"jeux": true,
"question": "<J1> et <J2> se défient au 'je te tiens, tu me tiens', le premier qui rit sera dechiré, et ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 58,
"jeux": true,
"question": "<J1> et <J2> n'ont plus le droit d'utiliser leur téléphone pendant <manches> manches !",
"manches": "true",
"arret": "vous pouvez enfin utiliser vos téléphone bande de geek"
},
{
"id": 59,
"jeux": true,
"question": "<J1> et <J2> racontent une anecdote, celui/celle qui sort la plus <variante> ",
"variante": ["banale","incroyable","marrante"],
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 60,
"jeux": true,
"question": "<J1>, Si on te dit Marco? ... Si tu as dis Polo ",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 61,
"jeux": true,
"question": "<J1> est l'aigris pendant <manches> manches ! Dès que tu souris ou rigoles,",
"gorger": 1,
"manches": true,
"distribution": false,
"arret": "Tu n'es plus aigris!",
"recois": true
},
{
"id": 62,
"jeux": true,
"question": "<J1> fait un geste, le suivant répète et en ajoute un. Le perdant ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 63,
"question": "<J1>, <J2> et <J3> vont désigner quelqu'un qui doit terminer son verre",
"jeux": true
},
{
"id": 64,
"question": "Récitez l'alphabet en énonçant une lettre à tour de rôle. Si <J1> finit son verre avant, cul sec pour tout le monde !",
"jeux": true
},
{
"id": 65,
"question": "Si <J1> arrive a finir son verre en moins de 5 secondes, il/elle ",
"gorger": 6,
"distribution": true,
"recois": false,
"jeux": true
},
{
"id": 66,
"jeux": true,
"question": "<J1> et <J2> sont lies, si l'un boit alors l'autre aussi, et ce pendant <manches> manches",
"manches": true,
"arret": "Vous n'etes plus liés par le verre de l'amitié et plus.."
},
{
"id": 67,
"question": "<J1> dit un mot, la personne suivante le répète et en ajoute un nouveau, ainsi de suite jusqu'a ce que quelqu'un se trompe. Le perdant boit autant de gorgées qu'il y a eu de personne avant lui",
"jeux": true
},
{
"id": 68,
"question": "<J1> doit choisir un mot que tout le monde devra dire à chaque fois qu'une personne boit. Pendant <manches> manches",
"jeux": false,
"manches": true,
"arret": "Plus besoin de dire le mots avant de boire"
},
{
"id": 69,
"question": "Quand l'heure affichera un multiple de 10 (22h, 22h10 ...) le premier a crier 'merde j'ai oublié mon chat'",
"gorger": 3,
"distribut":false,
"manches": true,
"arret": "Vous avez retrouver le chat!"
},
{
"id": 70,
"question": "Plutôt ne plus avoir de mains ou de jambes? les perdants ",
"gorger": 3,
"jeux": false,
"distribution": false,
"recois": true
},
{
"id": 71,
"question": "Vive la poésie ! Nos phrases doivent rimer sous peine d'une gorgée pendant <manches> manches",
"manches": true,
"arret": "Vous ne devez plus faire de rime."
},
{
"id": 72,
"question": "Choisissez le joueur le <variante> drôle d'entre vous, ce dernier ",
"variante": ["moins", "plus"],
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 73,
"question": "Les <variante>",
"variante": ["filles","garçons","couples","celibataires"],
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 74,
"jeux": true,
"question": "Plutôt avoir un tapis volant, ou un frigo qui se remplit tout seul ? Votez tous en même temps. La minorité ",
"gorger": 3,
"distribution": false,
"recois": true,
"manches": false
},
{
"id": 75,
"question": "Plutôt avoir du temps ou de l'argent ? Votez tous en même temps. La minorité ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 76,
"question": "Le premier joueur qui en embrasse un autre sur la bouche",
"gorger": 5,
"distribution": true,
"recois": false,
"caliente": true
},
{
"id": 77,
"question": "Plutôt série ou film ? Votez tous en même temps. La minorité ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 78,
"question": "Plutôt jeux-videos ou livre ? Votez tous en même temps. La minorité ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 79,
"question": "Plutôt anime ou jeux-videos ? Votez tous en même temps. La minorité ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 80,
"question": "Elisez le plus <variante> d'entre vous, ce dernier ",
"variante": ["con", "intelligent", "beau", "gentil","dragueur","timide"],
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 81,
"question": "Le premier qui donne un film de <variante> ",
"gorger": 3,
"distribution": true,
"recois": false,
"variante": ["Christopher Nolan","James Cameron","Tim Burton","Quentin tarantino","Steven Spielberg"]
},
{
"id": 82,
"question": "Le premier qui donne un film avec ",
"variante": ["Christian Clavier","Morgan freeman","Brad Pitt", "Jean Reno","Marion Cotillard"],
"gorger": 3,
"distribution": true,
"recois": false
},
{
"id": 83,
"question": "La première personne qui désigne le/la plus <variante> ",
"gorger": 3,
"distribution": true,
"recois": false,
"variante": ["jeune", "vieille"]
},
{
"id": 84,
"question": "Plutôt avoir des connaissances illimitées ou diriger le monde ? Votez tous en même temps. La minorité",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 85,
"question": "Plutôt n'avoir aucun ami ou ne plus pouvoir utiliser d'appareil électronique ? Votez tous en même temps. La minorité ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 86,
"question": "Plutot vaincre le patrikaka ou la polution dans le monde? Votez tous en meme temps. La minorité ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 87,
"question": "Jeu du LUTIN : Pendant <manches> manches. Vous devez enlever le lutin de votre verre pour pouvoir boire et le remettre ensuite sinon vous devait reboire",
"gorger": 3,
"distribution": false,
"recois": false,
"manches": true,
"arret": "Le Lutin est parti. Vous pouvez boire normalement"
},
{
"id": 88,
"question": "Le premier joueur à ramener un objet <variante> (pas de vêtements) ",
"gorger": 3,
"distribution": true,
"variante": ["rouge","vert","bleu","jaune"],
"recois": false,
"manches": false
},
{
"id": 89,
"question": "Le premier joueur qui dévoile un de ses secrets et que personne ne sait ",
"gorger": 3,
"distribution": true,
"recois": false
},
{
"id": 90,
"question": "Jeu des peaux! Triez vous du joueur le plus bronzé au joueur le moins bronzé. Le plus bronzé prend 1 gorgée, le second 2 gorgées, etc.",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 91,
"question": "Plutôt avoir du pouvoir ou de la connaissance ? Votez tous en même temps. La minorité ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 92,
"question": "Il est désormais interdit de se tutoyer pendant <manches> manches",
"manches": true,
"arret":"Vous pouvez vous enfin vous tutoyer"
},
{
"id": 93,
"question": "Vaccin contre le COVID19 : Le DR Raoul à dit que boire un cul sec avait les mêmes effets que le vaccin. Tout le monde bois sont verre cul sec"
},
{
"id": 94,
"question": "Faites un concours de clash : Rap contenders entre <J1> et <J2> le perdant ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 95,
"question": "Choisissez un joueur qui doit imiter un animal pendant <manches> manches sans se faire prendre",
"manches": true,
"arret": "Fin de l'imitation animale"
},
{
"id": 96,
"question": "Qui a le plus de talents cachés ? Votez et le perdant",
"gorger": 2,
"distribution": false,
"recois": true
},
{
"id": 97,
"question": "Le prochain qui parle de travail ou d'école doit boire un shot",
"duree": true,
"arret": "Fin de l'interdiction"
},
{
"id": 98,
"question": "Karaoké improvisé : <J1> choisit une chanson pour <J2>",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 99,
"question": "Qui serait le plus susceptible de survivre dans un film de survie ? Votez",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 100,
"question": "Défi cuisine : <J1> doit Créez la combinaison d'alcool la plus bizarre avec les ingrédients présents, <J2> doit boire la mixture",
"gorger": 2,
"distribution": false,
"recois": true
}
]
}
+809
View File
@@ -0,0 +1,809 @@
{
"version": "2",
"questions": [
{
"id": 1,
"question": "Celles/Ceux qui ont habité dans plus de 3 villes diferentes",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 2,
"question": "Ceux qui ont dansé aujourd'hui",
"gorger": 1,
"distribution": true,
"recois": true
},
{
"id": 3,
"question": "si tu n'as pas ton veritable nom sur insta",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 4,
"question": "si tu a des photos sur insta",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 5,
"question": "Les joueurs de Counter Strike ",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 5,
"question": "La dernière personne à avoir vomi en soirée ",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 6,
"question": "Toutes celles (ou ceux) qui ont du verni à ongles",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 7,
"question": "Tous les joueurs célibataires",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 8,
"question": "Tous ceux qui ont des lunettes",
"gorger": 2,
"distribution": true,
"recois": true
},
{
"id": 9,
"question": "Tous ceux qui ont déjà triché à un examen",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 10,
"question": "Le/La plus radin(e)",
"gorger": 4,
"distribution": false,
"recois": true
},
{
"id": 11,
"question": "<J1> a toi de juger : entre <J1> et <J2> qui stresse le plus pour un rien selon toi? Le perdant ",
"gorger": 5,
"distribution": false,
"recois": true
}, {
"id": 12,
"question": "Le mec qui a le plus gros ventre à bière ",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 13,
"question": "Tous ceux qui se sont déjà fait exclure de cours",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 14,
"question": "<J1>, donne le nombre d'habitant du/de la <variante> ( à 1 000 000 près) Si tu as faux tu bois, sinon tu ",
"gorger": 3,
"distribution": true,
"recois": false,
"variante": ["Tadjikistant", "Monaco", "Belgique", "Suisse", "Allemagne", "Chine", "Inde"]
},
{
"id": 15,
"question": "Tous ceux qui ont des frères et soeurs",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 16,
"question": "<J1> a qui appartient le slogan suivant? <variante>",
"variante": ["Des pâtes oui mais des (panzani)"," Le plaisir pour les petites faims. (Kinder Bueno)","Réveillez le lion qui est en vous. (Cereale lion)","Parce que le monde bouge (CIC)","Ça coule de source ! (Cristaline)", "Pensez différemment (apple)" ],
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 17,
"question": "Celles et ceux qui ont eu un Windows phone",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 18,
"question": "<J1>, Boire un café fait baisser le taux d'alcool? Si tu as faux ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 19,
"question": "Celles/Ceux qui se sont déjà battus",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 20,
"question": "Celui/Celle qui pèse le plus lourd",
"variante": ["lourd","leger"],
"gorger": 3,
"distribution": true,
"recois": false
},
{
"id": 21,
"question": "Pour se décoincer, le/la plus <variante>",
"variante": ["timide", "enervé ", "angoissé","aigri"],
"gorger": 2,
"distribution": false,
"recois": true
},
{
"id": 22,
"question": "Le/La plus <variante>",
"gorger": 3,
"variante": ["jeune","vieille"],
"distribution": false,
"recois": true
},
{
"id": 23,
"question": "Celles/Ceux qui ont fait des études <variante>",
"gorger": 3,
"variante": ["L","Scientifique", "Bac Professionel", "STMG"],
"distribution": true,
"recois": true
},
{
"id": 25,
"question": "Celles et ceux qui ont deja joué <variante> de maniere recurrente ",
"gorger": 3,
"variante": ["du piano","de la guitare", "du saxophone", "de la batterie"],
"distribution": true,
"recois": true
},
{
"id": 26,
"question": "Les gens qui se sont masturbés aujourd'hui",
"gorger": 3,
"distribution": true,
"recois": true,
"caliente": true
},
{
"id": 27,
"question": "Celui ou celle a la meilleure place",
"gorger": 2,
"distribution": false,
"recois": true
},
{
"id": 28,
"question": "Celles et ceux qui n'ont jamais trompé leur partenaire",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 29,
"question": "Celui/Celle avec les vêtements les plus beaux ",
"gorger": 1,
"distribution": false,
"recois": true
},
{
"id": 30,
"question": "Celui/Celle qui a les cheveux les plus <variante> ",
"gorger": 2,
"variante": ["longs","courts"],
"distribution": true,
"recois": true
},
{
"id": 31,
"question": "Les végans ",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 32,
"question": "La personne la plus maquillé ",
"gorger": 2,
"distribution": true,
"recois": true
}, {
"id": 33,
"question": "Celles/Ceux qui ont déjà appelé leur partenaire par le prénom de leurs ex",
"gorger": 4,
"distribution": false,
"recois": true
},
{
"id": 34,
"question": "Celles et ceux qui boit de la <variante> actuellement",
"gorger": 3,
"distribution": true,
"recois": true,
"variante": ["vodka", "rhum", "tequila", "whisky"]
},
{
"id": 35,
"question": "Les joueurs qui ont un <variante> dans leurs prénom",
"gorger": 3,
"distribution": false,
"recois": true,
"variante": ["a","e","i","o","u","y"]
},
{
"id": 36,
"question": "Le/La joueur/euse avec le plus gros cul",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 37,
"question": "Celles/Ceux qui ont moins de <variante> ans",
"gorger": 3,
"distribution": false,
"recois": true,
"variante": ["21","22","23","24","25","26"]
},
{
"id": 38,
"question": "Celui/celle avec le plus gros appetit sexuel",
"gorger": 3,
"distribution": false,
"recois": true,
"caliente": true
},
{
"id": 39,
"question": "Ceux/Celles qui fumes (VapeNation compris)",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 40,
"question": "Celles et ceux qui ont au moins un BAC +<variante>",
"gorger": 1,
"distribution": true,
"recois": true,
"variante": [0,1,2,3,4,5]
},
{
"id": 41,
"question": "Le premier joueur à se lever",
"doubledistribution": true,
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 42,
"question": "Ceux qui n'ont jamais eu l'occasion de faire un strip tease",
"gorger": 3,
"distribution": false,
"recois": true,
"caliente": true
},
{
"id": 43,
"question": "Le premier joueur à enlever un vêtements",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 44,
"question": "Tous ceux qui ont déjà uriné dans une piscine ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 30,
"question": "Celui/Celle avec le plus de follow sur <variante>",
"gorger": 3,
"distribution": true,
"recois": true,
"variante": ["instagram","facebook","tik-tok"]
},
{
"id": 31,
"question": "Celui/Celle avec le nom de famille le plus compliqué",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 32,
"question": "Les joueurs qui n'ont pas encore distribué de gorgées",
"gorger": 3,
"distribution": false,
"recois": true
}, {
"id": 33,
"question": "Le premier joueur à donner l'heure",
"doubledistribution": true,
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 34,
"question": "Celles et ceux qui ont déjà dépenser plus de 2000 euros en un achat",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 35,
"question": "La personne la moins courageuse",
"gorger": 1,
"distribution": false,
"recois": true
},
{
"id": 36,
"question": "Celles/Ceux qui rentre chez eux à la fin de la soirée",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 37,
"question": "Celles et ceux dont le jour d'anniversaire est un nombre <variante>",
"gorger": 3,
"distribution": true,
"recois": true,
"variante": ["impaire","paire"]
},
{
"id": 38,
"question": "Si tu as un téléphone qui a un prix supperieur d'achat a 1000Euros, tu est riche donc en tant que personne généreuse",
"gorger": 3,
"distribution": true,
"recois": false
},
{
"id": 39,
"question": "Tous ceux qui ont fait plus de 100km pour venir ici ",
"gorger": 3,
"distribution": true,
"recois": false
},
{
"id": 40,
"jeux": true,
"question": "Le jeu du revolver: Chaque joueur a maintenant 7 balles, une balle correspondant à une gorgée. Les joueurs ont la capacité de tirer des balles à tout moment du jeu.",
"distribution": false,
"recois": false
},
{
"id": 41,
"question": "<J1>",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 42,
"jeux": true,
"question": "<J1> est le vieu/vieille briscard ! Interdiction de montrer tes dents pendant <manche> manches",
"manche": true,
"arret": "Tu peux arreter de cacher tes belles dents"
},
{
"id": 43,
"jeux": true,
"question": "<J1> et <J2> liser le premier SMS qui s'affiche quand on tape <variante> dans la barre de recherche. le plus marrant",
"gorger": 3,
"variante": ["désolé","caca","bourré","mine","nazi"],
"distribution": true,
"recois": false
}, {
"id": 44,
"jeux": true,
"question": "A tour de role, vous avez exactement 3 secondes pour donner un mot en rapport avec le mots dit precedemment.<J1> tu commences en choissisant un mot. Le perdant",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 45,
"jeux": true,
"question": "Le jeu du PIM PAM POUM. Le premier qui perd ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 46,
"jeux": true,
"question": "<J1> defie <J2> au chifoumi ! Le perdant",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 47,
"jeux": true,
"question": "<J1> est dans le <variante> ! Tu dois parler au <variante> pendant <manches> manches ",
"variante": ["passé", "futur"],
"manche": true,
"arret": "Tu est revenu dans le present",
"distribution": false,
"recois": false,
"caliente": false
},
{
"id": 48,
"question": "<J1> tu bois autant de gorgées que tu as d'années d'études après le BAC"
},
{
"id": 49,
"jeux": true,
"question": "<J1> et <J2> ferment leurs yeux ! Ils/Elles doivent deviner la couleur des yeux de l'autre. ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 50,
"jeux": true,
"question": "<J1> est manchot ! Il/Elle ne peut plus utiliser ses doigts durant <manches> manches . Si il s'en sert, il/elle devra boire autant de gorgées qu'il/elle a utilisé de doigts",
"distribution": false,
"arret": "Tu n'es plus manchot",
"recois": false
},
{
"id": 51,
"jeux": true,
"question": "<J1> et <J2> , si vous êtes ensemble dans la vraie vie, vous pouvez distribuer 2 gorgées , autrement buvez-les"
},
{
"id": 52,
"jeux": true,
"question": "<J1> a la tourette ! A chaque fois que tu bois une gorgée, tu dois CRIER une insulte. C'est un stade avancé, ça dure <manches> manches",
"manches": true,
"arret": "Tu n'as plus tourette."
},
{
"id": 53,
"jeux": true,
"question": "<J1>, donne la couleur préférée de <J2> si tu te trompes",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 54,
"jeux": true,
"question": "<J1> à l'oeil de serpent ! Dès qu'un joueur te regarde dans les yeux, il/elle boit. Si tu es arrivé a faire boire personne avant <manches> manches, tu ",
"gorger": 4,
"distribution": false,
"recois": true
}, {
"id": 55,
"jeux": true,
"question": "<J1> et <J2> se mesurent ! Le/la plus <variante>",
"gorger": 3,
"variante": ["petit","grand"],
"distribution": true,
"recois": true
},
{
"id": 56,
"jeux": true,
"question": "<J1> doit terminer toutes ses phrases par - <variante> pendant <manches> manches",
"variante": ["C'est clair","han","quoicoubeh"]
},
{
"id": 57,
"jeux": true,
"question": "<J1> et <J2> se défient au 'je te tiens, tu me tiens', le premier qui rit sera dechiré, et ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 58,
"jeux": true,
"question": "<J1> et <J2> n'ont plus le droit d'utiliser leur téléphone pendant <manches> manches !",
"manches": "true"
},
{
"id": 59,
"jeux": true,
"question": "<J1> et <J2> racontent une anecdote, celui/celle qui sort la plus <variante> ",
"variante": ["banale","incroyable","marrante"],
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 60,
"jeux": true,
"question": "<J1>, Si on te dit Marco? ... Si tu as dis Polo ",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 61,
"jeux": true,
"question": "<J1> est l'aigris pendant <manches> manches ! Dès que tu souris ou rigoles,",
"gorger": 1,
"manches": true,
"distribution": false,
"arret": "Tu n'es plus aigris!",
"recois": true
},
{
"id": 62,
"jeux": true,
"question": "<J1> fait un geste, le suivant répète et en ajoute un. Le perdant ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 63,
"question": "<J1>, <J2> et <J3> vont désigner quelqu'un qui doit terminer son verre",
"jeux": true
},
{
"id": 64,
"question": "Récitez l'alphabet en énonçant une lettre à tour de rôle. Si <J1> finit son verre avant, cul sec pour tout le monde !",
"jeux": true
},
{
"id": 65,
"question": "Si <J1> arrive a finir son verre en moins de 5 secondes, il/elle ",
"gorger": 6,
"distribution": true,
"recois": false,
"jeux": true
},
{
"id": 66,
"jeux": true,
"question": "<J1> et <J2> sont lies, si l'un boit alors l'autre aussi, et ce pendant <manches> manches",
"manches": true
},
{
"id": 67,
"question": "<J1> dit un mot, la personne suivante le répète et en ajoute un nouveau, ainsi de suite jusqu'a ce que quelqu'un se trompe. Le perdant boit autant de gorgées qu'il y a eu de personne avant lui",
"jeux": true
},
{
"id": 68,
"question": "<J1> doit choisir un mot que tout le monde devra dire à chaque fois qu'une personne boit. Pendant <manches> manches",
"jeux": false,
"manches": true,
"arret": "Plus besoin de dire le mots avant de boire"
},
{
"id": 69,
"question": "Quand l'heure affichera un multiple de 10 (22h, 22h10 ...) le premier a crier 'merde j'ai oublié mon chat'",
"gorger": 3,
"distribut":false,
"manches": true,
"arret": "Vous avez retrouver le chat!"
},
{
"id": 70,
"question": "Plutôt ne plus avoir de mains ou de jambes? les perdants ",
"gorger": 3,
"jeux": false,
"distribution": false,
"recois": true
},
{
"id": 71,
"question": "Vive la poésie ! Nos phrases doivent rimer sous peine d'une gorgée pendant <manches> manches",
"manches": true,
"arret": "Vous ne devez plus faire de rime."
},
{
"id": 72,
"question": "Choisissez le joueur le <variante> drôle d'entre vous, ce dernier ",
"variante": ["moins", "plus"],
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 73,
"question": "Les <variante>",
"variante": ["filles","garçons","couples","celibataires"],
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 74,
"jeux": true,
"question": "Plutôt avoir un tapis volant, ou un frigo qui se remplit tout seul ? Votez tous en même temps. La minorité ",
"gorger": 3,
"distribution": false,
"recois": true,
"manches": false
},
{
"id": 75,
"question": "Plutôt avoir du temps ou de l'argent ? Votez tous en même temps. La minorité ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 76,
"question": "Le premier joueur qui en embrasse un autre sur la bouche",
"gorger": 5,
"distribution": true,
"recois": false,
"caliente": true
},
{
"id": 77,
"question": "Plutôt série ou film ? Votez tous en même temps. La minorité ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 78,
"question": "Plutôt jeux-videos ou livre ? Votez tous en même temps. La minorité ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 79,
"question": "Plutôt anime ou jeux-videos ? Votez tous en même temps. La minorité ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 80,
"question": "Elisez le plus <variante> d'entre vous, ce dernier ",
"variante": ["con", "intelligent", "beau", "gentil","dragueur","timide"],
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 81,
"question": "Le premier qui donne un film de <variante> ",
"gorger": 3,
"distribution": true,
"recois": false,
"variante": ["Christopher Nolan","James Cameron","Tim Burton","Quentin tarantino","Steven Spielberg"]
},
{
"id": 82,
"question": "Le premier qui donne un film avec ",
"variante": ["Christian Clavier","Morgan freeman","Brad Pitt", "Jean Reno","Marion Cotillard"],
"gorger": 3,
"distribution": true,
"recois": false
},
{
"id": 83,
"question": "La première personne qui désigne le/la plus <variante> ",
"gorger": 3,
"distribution": true,
"recois": false,
"variante": ["jeune", "vieille"]
},
{
"id": 84,
"question": "Plutôt avoir des connaissances illimitées ou diriger le monde ? Votez tous en même temps. La minorité",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 85,
"question": "Plutôt n'avoir aucun ami ou ne plus pouvoir utiliser d'appareil électronique ? Votez tous en même temps. La minorité ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 86,
"question": "Plutot vaincre le patrikaka ou la polution dans le monde? Votez tous en meme temps. La minorité ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 87,
"question": "Jeu du LUTIN : Pendant <manches> manches. Vous devez enlever le lutin de votre verre pour pouvoir boire et le remettre ensuite sinon vous devait reboire",
"gorger": 3,
"distribution": false,
"recois": false,
"manches": true,
"arret": "Le Lutin est parti. Vous pouvez boire normalement"
},
{
"id": 88,
"question": "Le premier joueur à ramener un objet <variante> (pas de vêtements) ",
"gorger": 3,
"distribution": true,
"variante": ["rouge","vert","bleu","jaune"],
"recois": false,
"manches": false
},
{
"id": 89,
"question": "Le premier joueur qui dévoile un de ses secrets et que personne ne sait ",
"gorger": 3,
"distribution": true,
"recois": false
},
{
"id": 90,
"question": "Jeu des peaux! Triez vous du joueur le plus bronzé au joueur le moins bronzé. Le plus bronzé prend 1 gorgée, le second 2 gorgées, etc.",
"gorger": 3,
"distribution": true,
"recois": true
},
{
"id": 91,
"question": "Plutôt avoir du pouvoir ou de la connaissance ? Votez tous en même temps. La minorité ",
"gorger": 3,
"distribution": false,
"recois": true
},
{
"id": 92,
"question": "Il est désormais interdit de se tutoyer pendant <manches> manches",
"manches": true,
"arret":"Vous pouvez vous tutoyer"
},
{
"id": 93,
"question": "Vaccin contre le COVID19 : Le DR Raoul à dit que boire un cul sec avait les mêmes effets que le vaccin. Tout le monde bois sont verre cul sec"
},
{
"id": 94,
"question": "Faites un concours de clash : Rap contenders entre <J1> et <J2> le perdant ",
"gorger": 3,
"distribution": false,
"recois": true
}
]
}
@@ -0,0 +1,415 @@
package com.example.boidelov3;
import android.animation.ArgbEvaluator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.VibrationEffect;
import android.os.Vibrator;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.view.animation.OvershootInterpolator;
import androidx.core.content.ContextCompat;
/**
* Classe utilitaire pour les animations et effets visuels
*/
public class BoideloAnimationUtils {
private static final Interpolator OVERSHOOT = new OvershootInterpolator();
/**
* Anime le changement de couleur de fond d'une vue
*
* @param view La vue à animer
* @param targetColor La couleur cible
* @param duration La durée de l'animation en ms
*/
public static void animateBackgroundColor(View view, int targetColor, int duration) {
if (view == null) return;
int currentColor = getBackgroundColor(view);
if (currentColor == targetColor) return;
ValueAnimator anim = ValueAnimator.ofObject(new ArgbEvaluator(), currentColor, targetColor);
anim.setDuration(duration);
anim.addUpdateListener(animation -> {
int color = (int) animation.getAnimatedValue();
view.setBackgroundColor(color);
});
anim.start();
}
/**
* Anime le changement de couleur de fond avec la durée par défaut (500ms)
*/
public static void animateBackgroundColor(View view, int targetColor) {
animateBackgroundColor(view, targetColor, 500);
}
/**
* Obtient la couleur de fond actuelle d'une vue
*/
private static int getBackgroundColor(View view) {
if (view.getBackground() instanceof ColorDrawable) {
return ((ColorDrawable) view.getBackground()).getColor();
}
return 0xFFFFFFFF; // Blanc par défaut
}
/**
* Déclenche une vibration haptique
*
* @param context Le contexte
* @param duration Durée de la vibration en ms
*/
public static void triggerHapticFeedback(Context context, int duration) {
if (context == null) return;
Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
if (vibrator != null && vibrator.hasVibrator()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
VibrationEffect effect = VibrationEffect.createOneShot(duration, VibrationEffect.DEFAULT_AMPLITUDE);
vibrator.vibrate(effect);
} else {
vibrator.vibrate(duration);
}
}
}
/**
* Déclenche une vibration haptique courte (100ms)
*/
public static void triggerHapticFeedback(Context context) {
triggerHapticFeedback(context, 100);
}
/**
* Déclenche une vibration haptique de succès
*/
public static void triggerSuccessHaptic(Context context) {
if (context == null) return;
Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
if (vibrator != null && vibrator.hasVibrator() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
long[] pattern = {0, 50, 50, 50};
VibrationEffect effect = VibrationEffect.createWaveform(pattern, -1);
vibrator.vibrate(effect);
}
}
/**
* Déclenche une vibration haptique d'erreur
*/
public static void triggerErrorHaptic(Context context) {
if (context == null) return;
Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
if (vibrator != null && vibrator.hasVibrator() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
long[] pattern = {0, 100, 50, 100};
VibrationEffect effect = VibrationEffect.createWaveform(pattern, -1);
vibrator.vibrate(effect);
}
}
/**
* Anime l'apparition d'une vue avec un effet de fade-in
*
* @param view La vue à animer
* @param duration Durée de l'animation
*/
public static void fadeIn(View view, int duration) {
if (view == null) return;
view.setAlpha(0f);
view.setVisibility(View.VISIBLE);
view.animate()
.alpha(1f)
.setDuration(duration)
.start();
}
/**
* Anime la disparition d'une vue avec un effet de fade-out
*
* @param view La vue à animer
* @param duration Durée de l'animation
*/
public static void fadeOut(View view, int duration) {
if (view == null) return;
view.animate()
.alpha(0f)
.setDuration(duration)
.withEndAction(() -> view.setVisibility(View.GONE))
.start();
}
/**
* Anime une vue avec un effet de scale
*
* @param view La vue à animer
* @param scale Échelle cible (1.0 = normal, 0.5 = moitié)
* @param duration Durée de l'animation
*/
public static void scale(View view, float scale, int duration) {
if (view == null) return;
view.animate()
.scaleX(scale)
.scaleY(scale)
.setDuration(duration)
.setInterpolator(OVERSHOOT)
.start();
}
/**
* Anime une vue avec un effet de slide depuis le bas
*
* @param view La vue à animer
* @param duration Durée de l'animation
*/
public static void slideUp(View view, int duration) {
if (view == null) return;
view.setTranslationY(view.getHeight());
view.setVisibility(View.VISIBLE);
view.animate()
.translationY(0f)
.setDuration(duration)
.setInterpolator(new android.view.animation.DecelerateInterpolator())
.start();
}
/**
* Applique une animation de pression à un bouton
*
* @param view La vue (bouton) à animer
*/
public static void applyButtonPressAnimation(View view) {
if (view == null) return;
view.setOnTouchListener((v, event) -> {
switch (event.getAction()) {
case android.view.MotionEvent.ACTION_DOWN:
v.animate()
.scaleX(0.95f)
.scaleY(0.95f)
.setDuration(100)
.start();
return true;
case android.view.MotionEvent.ACTION_UP:
case android.view.MotionEvent.ACTION_CANCEL:
v.animate()
.scaleX(1f)
.scaleY(1f)
.setDuration(100)
.start();
v.performClick();
return true;
}
return false;
});
}
/**
* Anime une vue avec un effet de pulsation
*
* @param view La vue à animer
* @param duration Durée d'un cycle de pulsation
*/
public static void pulse(View view, int duration) {
if (view == null) return;
view.animate()
.scaleX(1.05f)
.scaleY(1.05f)
.setDuration(duration / 2)
.withEndAction(() -> {
view.animate()
.scaleX(1f)
.scaleY(1f)
.setDuration(duration / 2)
.start();
})
.start();
}
/**
* Anime une vue avec un effet de shake (tremblement)
*
* @param view La vue à animer
*/
public static void shake(View view) {
if (view == null) return;
Animation shake = AnimationUtils.loadAnimation(view.getContext(), R.anim.button_press);
view.startAnimation(shake);
}
/**
* Obtient la couleur depuis une ressource de couleur
*/
public static int getColorFromResource(Context context, int colorResId) {
return ContextCompat.getColor(context, colorResId);
}
/**
* Anime une vue avec un effet de bounce (rebond)
*
* @param view La vue à animer
* @param duration Durée de l'animation
*/
public static void bounce(View view, int duration) {
if (view == null) return;
view.animate()
.scaleY(0.8f)
.scaleX(0.8f)
.setDuration(duration / 2)
.setInterpolator(new android.view.animation.DecelerateInterpolator())
.withEndAction(() -> {
view.animate()
.scaleY(1f)
.scaleX(1f)
.setDuration(duration / 2)
.setInterpolator(OVERSHOOT)
.start();
})
.start();
}
/**
* Anime une vue pour la supprimer (slide out + fade out)
*
* @param view La vue à animer
* @param duration Durée de l'animation
* @param endAction Action à exécuter après l'animation
*/
public static void slideOutToRemove(View view, int duration, Runnable endAction) {
if (view == null) return;
view.animate()
.translationX(-view.getWidth())
.alpha(0f)
.setDuration(duration)
.setInterpolator(new android.view.animation.AccelerateInterpolator())
.withEndAction(endAction)
.start();
}
/**
* Anime l'apparition d'une vue (slide in + fade in)
*
* @param view La vue à animer
* @param duration Durée de l'animation
*/
public static void slideIn(View view, int duration) {
if (view == null) return;
view.setTranslationX(view.getWidth());
view.setAlpha(0f);
view.setVisibility(View.VISIBLE);
view.animate()
.translationX(0f)
.alpha(1f)
.setDuration(duration)
.setInterpolator(new android.view.animation.DecelerateInterpolator())
.start();
}
/**
* Anime une vue avec un effet de rotation
*
* @param view La vue à animer
* @param degrees Angle de rotation en degrés
* @param duration Durée de l'animation
*/
public static void rotate(View view, float degrees, int duration) {
if (view == null) return;
view.animate()
.rotation(degrees)
.setDuration(duration)
.setInterpolator(new android.view.animation.DecelerateInterpolator())
.start();
}
/**
* Anime une vue avec un effet de wiggle (gauche-droite)
*
* @param view La vue à animer
*/
public static void wiggle(View view) {
if (view == null) return;
view.animate()
.rotation(5f)
.setDuration(50)
.withEndAction(() -> {
view.animate()
.rotation(-5f)
.setDuration(50)
.withEndAction(() -> {
view.animate()
.rotation(3f)
.setDuration(50)
.withEndAction(() -> {
view.animate()
.rotation(0f)
.setDuration(50)
.start();
})
.start();
})
.start();
})
.start();
}
/**
* Anime une vue avec un effet de pop-in (apparition avec scale)
*
* @param view La vue à animer
* @param duration Durée de l'animation
*/
public static void popIn(View view, int duration) {
if (view == null) return;
view.setScaleX(0f);
view.setScaleY(0f);
view.setAlpha(0f);
view.setVisibility(View.VISIBLE);
view.animate()
.scaleX(1f)
.scaleY(1f)
.alpha(1f)
.setDuration(duration)
.setInterpolator(OVERSHOOT)
.start();
}
/**
* Anime une vue avec un effet de pop-out (disparition avec scale)
*
* @param view La vue à animer
* @param duration Durée de l'animation
* @param endAction Action à exécuter après l'animation
*/
public static void popOut(View view, int duration, Runnable endAction) {
if (view == null) return;
view.animate()
.scaleX(0f)
.scaleY(0f)
.alpha(0f)
.setDuration(duration)
.setInterpolator(new android.view.animation.AccelerateInterpolator())
.withEndAction(endAction)
.start();
}
}
@@ -0,0 +1,85 @@
package com.example.boidelov3;
//public class ChatGPTTask extends AsyncTask<Void, Void, String> {
//// private Jeux jeuxActivity;
//// private String keyOpenai;
////
//// public ChatGPTTask(Jeux jeuxActivity, String keyOpenai) {
//// this.jeuxActivity = jeuxActivity;
//// this.keyOpenai = keyOpenai;
//// }
////
////
//// @Override
//// protected String doInBackground(Void... voids) {
//// String url = "https://api.openai.com/v1/chat/completions";
//// String apiKey = keyOpenai;
//// System.out.println("apiKey de ChatGPTTASK.java: " + apiKey);
//// String model = "gpt-3.5-turbo";
////
//// String prompt = "Tu es une IA française qui génère des questions ainsi que la categories de la question. Voici des exemples :" +
//// "Celles/Ceux qui ont habité dans plus de 3 villes diferentes';'La vie" +
//// "Ceux qui ont dansé aujourd'hui' ; 'Soirée'" +
//// "'Pour se décoincer, le/la plus timide' ; 'Caractère'" +
//// "'Celles et ceux qui ont déjà dépenser plus de 2000 euros en un achat' ; 'Dépense'" +
//// "'Le/La plus radin(e)' ; 'Caractère'";
//
//// try {
//// URL obj = new URL(url);
//// HttpURLConnection connection = (HttpURLConnection) obj.openConnection();
//// connection.setRequestMethod("POST");
//// connection.setRequestProperty("Authorization", "Bearer " + apiKey);
//// connection.setRequestProperty("Content-Type", "application/json");
////
//// // The request body
//// String body = "{\"model\": \"" + model + "\", \"messages\": [{\"role\": \"user\", \"content\": \"" + prompt + "\"}]}";
//// System.out.println("body: " + body);
//// connection.setDoOutput(true);
//// OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
//// writer.write(body);
//// writer.flush();
//// writer.close();
////
//// // Response from ChatGPT
//// BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));
//// String line;
////
//// StringBuffer response = new StringBuffer();
////
//// while ((line = br.readLine()) != null) {
//// response.append(line);
//// }
//// br.close();
////
//// // calls the method to extract the message.
//// return extractMessageFromJSONResponse(response.toString());
////
//// } catch (IOException e) {
//// System.out.println("Il y a eu une erreur" + e);
//// throw new RuntimeException(e);
////
//// }
//// }
////
//// public String extractMessageFromJSONResponse(String response) {
//// int start = response.indexOf("content") + 11;
//// int end = response.indexOf("\"", start);
//// String extractedMessage = response.substring(start, end);
//// System.out.println("extractedMessage: " + extractedMessage);
//// return extractedMessage;
//// }
////
//// @Override
//// protected void onPostExecute(String result) {
//// if (result != null) {
//// // Handle the extracted message here
//// jeuxActivity.handleExtractedMessage(result);
//// } else {
//// Toast.makeText(jeuxActivity.getApplicationContext(), "Échec de la communication avec l'API !", Toast.LENGTH_SHORT).show();
//// jeuxActivity.navigateToJeuxParametres();
//// }
//// }
//
//
// return url;
// }}
@@ -0,0 +1,40 @@
package com.example.boidelov3;
import android.os.AsyncTask;
import com.impossibl.postgres.api.jdbc.PGConnection;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class DatabaseConnection extends AsyncTask<Void, Void, PGConnection> {
private static final String DB_URL = "jdbc:postgresql://82.65.214.214:5432/boidelo";
private static final String USER = "Tux2543";
private static final String PASSWORD = "6wa*teCnuxsG#grAc5HzC!Rh%#@c&";
@Override
protected PGConnection doInBackground(Void... params) {
PGConnection connection = null;
try {
// Code de connexion à la base de données PostgreSQL
String url = DB_URL;
String username = USER;
String password = PASSWORD;
connection = (PGConnection) DriverManager.getConnection(url, username, password);
} catch (SQLException e) {
e.printStackTrace();
}
return connection;
}
protected void onPostExecute(Connection connection) {
// Traitez le résultat de la connexion ici
if (connection != null) {
// Connexion réussie
} else {
// Échec de la connexion
}
}
}
@@ -0,0 +1,191 @@
package com.example.boidelov3;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import com.google.android.material.button.MaterialButton;
import java.util.ArrayList;
/**
* Activité de fin de partie
* Affiche un résumé de la partie et permet de rejouer ou retourner à l'accueil
*/
public class EndGameActivity extends AppCompatActivity {
// Vues
private TextView questionsPlayedValue;
private TextView playersCountValue;
private TextView gorgeesTotalValue;
private MaterialButton homeButton;
private MaterialButton replayButton;
// Données
private int questionsPlayed;
private int playersCount;
private ArrayList<String> players;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_end_game);
// Initialiser les vues
initViews();
// Récupérer les données de la partie
getGameData();
// Afficher les statistiques
displayStats();
// Configurer les boutons
setupButtons();
// Animations d'entrée
animateEntry();
}
/**
* Initialise toutes les vues
*/
private void initViews() {
questionsPlayedValue = findViewById(R.id.questionsPlayedValue);
playersCountValue = findViewById(R.id.playersCountValue);
gorgeesTotalValue = findViewById(R.id.gorgeesTotalValue);
homeButton = findViewById(R.id.homeButton);
replayButton = findViewById(R.id.replayButton);
// Appliquer les animations aux boutons
BoideloAnimationUtils.applyButtonPressAnimation(homeButton);
BoideloAnimationUtils.applyButtonPressAnimation(replayButton);
}
/**
* Récupère les données de la partie terminée
*/
private void getGameData() {
// Récupérer les données depuis l'intent
questionsPlayed = getIntent().getIntExtra("EXTRA_QUESTIONS_PLAYED", 0);
playersCount = getIntent().getIntExtra("EXTRA_PLAYERS_COUNT", 0);
players = getIntent().getStringArrayListExtra("EXTRA_PLAYERS");
// Si pas de données, utiliser les SharedPreferences
if (questionsPlayed == 0) {
android.content.SharedPreferences prefs = getSharedPreferences("game_stats", Context.MODE_PRIVATE);
questionsPlayed = prefs.getInt("questions_played", 0);
playersCount = prefs.getInt("players_count", 0);
}
}
/**
* Affiche les statistiques de la partie
*/
private void displayStats() {
// Animer les chiffres
animateValue(questionsPlayedValue, 0, questionsPlayed, 1000);
animateValue(playersCountValue, 0, playersCount, 1000);
// Afficher les joueurs (simplifié pour l'instant)
if (players != null && !players.isEmpty()) {
StringBuilder playersText = new StringBuilder();
for (int i = 0; i < players.size(); i++) {
if (i > 0) playersText.append(", ");
playersText.append(players.get(i));
}
}
// Afficher un message de félicitations
showCongratulationMessage();
}
/**
* Affiche un message de félicitations selon le nombre de questions
*/
private void showCongratulationMessage() {
// Le message pourrait être personnalisé selon les performances
// Pour l'instant, on utilise le titre par défaut du layout
}
/**
* Configure les boutons
*/
private void setupButtons() {
homeButton.setOnClickListener(v -> {
BoideloAnimationUtils.triggerHapticFeedback(this);
goToHome();
});
replayButton.setOnClickListener(v -> {
BoideloAnimationUtils.triggerSuccessHaptic(this);
replay();
});
}
/**
* Retourne à l'écran d'accueil
*/
private void goToHome() {
Intent intent = new Intent(this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
}
/**
* Relance une nouvelle partie
*/
private void replay() {
Intent intent = new Intent(this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
}
/**
* Anime l'entrée des éléments
*/
private void animateEntry() {
// Animation du trophée
View trophyIcon = findViewById(R.id.trophyIcon);
BoideloAnimationUtils.scale(trophyIcon, 1.0f, 400);
// Animation fade-in pour le contenu
View titleText = findViewById(R.id.titleText);
View subtitleText = findViewById(R.id.subtitleText);
BoideloAnimationUtils.fadeIn(titleText, 600);
BoideloAnimationUtils.fadeIn(subtitleText, 800);
}
/**
* Anime un chiffre de 0 à la valeur cible
*/
private void animateValue(TextView textView, int start, int end, int duration) {
if (textView == null) return;
android.animation.ValueAnimator animator = android.animation.ValueAnimator.ofInt(start, end);
animator.setDuration(duration);
animator.setInterpolator(new DecelerateInterpolator());
animator.addUpdateListener(animation -> {
int value = (int) animation.getAnimatedValue();
textView.setText(String.valueOf(value));
});
animator.start();
}
@Override
public void onBackPressed() {
// Retourner à l'accueil au lieu de revenir au jeu
goToHome();
}
}
@@ -0,0 +1,687 @@
package com.example.boidelov3;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Bundle;
import android.text.Html;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import com.google.android.material.button.MaterialButton;
import com.google.gson.Gson;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import java.util.Set;
/**
* Activité principale du jeu Boidelo
* Affiche les questions et gère les interactions de jeu
*/
public class Jeux extends AppCompatActivity {
// Vues
private TextView questionTextView;
private TextView progressTextView;
private TextView mancheCounterTextView;
private TextView mancheQuestionText;
private ProgressBar progressBar;
private MaterialButton suivantButton;
private MaterialButton skipButton;
private LinearLayout questionIndicator;
private ImageView indicatorIcon;
private TextView indicatorText;
// Données
private Questions questions;
private List<String> toutlesjoueurs;
private List<Question> questionsAvecManches = new ArrayList<>();
// Paramètres de partie
private int nombreQuestions;
private int ajoutGorgees;
private boolean openAI;
private int ratiOpenai;
private String keyOpenai;
// État du jeu
private int currentQuestionIndex = 0;
private int totalQuestionsAsked = 0;
private String currentQuestionText = "";
private boolean isMancheActive = false;
// Clés pour sauvegarde d'état
private static final String KEY_TOTAL_QUESTIONS = "total_questions_asked";
private static final String KEY_CURRENT_QUESTION_TEXT = "current_question_text";
private static final String KEY_IS_MANCHE_ACTIVE = "is_manche_active";
private static final String KEY_MANCHES_COUNT = "manches_count";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_jeux);
// Initialiser les vues
initViews();
// Récupération des données passées par l'activité précédente
toutlesjoueurs = getIntent().getStringArrayListExtra("EXTRA_LIST_JOUEUR");
nombreQuestions = getIntent().getIntExtra("EXTRA_NOMBRE_QUESTIONS", 50);
ajoutGorgees = getIntent().getIntExtra("EXTRA_AJOUT_GORGEE", 0);
openAI = getIntent().getBooleanExtra("EXTRA_OPENAI", false);
ratiOpenai = getIntent().getIntExtra("EXTRA_RATIO_OPENAI", 0);
keyOpenai = getIntent().getStringExtra("EXTRA_KEY_OPENAI");
// Charger les questions depuis le JSON
loadQuestions();
// Configurer la barre de progression
setupProgressBar();
// Restaurer l'état si disponible (rotation)
if (savedInstanceState != null) {
restoreGameState(savedInstanceState);
} else {
// Afficher la première question
updateQuestion();
}
// Configuration des listeners de boutons
setupButtonListeners();
}
/**
* Initialise toutes les vues de l'activité
*/
private void initViews() {
questionTextView = findViewById(R.id.textView1);
progressTextView = findViewById(R.id.progressText);
mancheCounterTextView = findViewById(R.id.mancheCounter);
mancheQuestionText = findViewById(R.id.mancheQuestionText);
progressBar = findViewById(R.id.progressBar);
suivantButton = findViewById(R.id.button);
skipButton = findViewById(R.id.skipButton);
questionIndicator = findViewById(R.id.questionIndicator);
indicatorIcon = findViewById(R.id.indicatorIcon);
indicatorText = findViewById(R.id.indicatorText);
// Appliquer les animations aux boutons
BoideloAnimationUtils.applyButtonPressAnimation(suivantButton);
BoideloAnimationUtils.applyButtonPressAnimation(skipButton);
// Initialiser la couleur de fond (respecte le mode jour/nuit)
int backgroundColor = ContextCompat.getColor(this, R.color.game_normal);
getWindow().getDecorView().setBackgroundColor(backgroundColor);
}
/**
* Charge les questions depuis le fichier JSON
*/
private void loadQuestions() {
try {
InputStream is = getAssets().open("question.json");
int size = is.available();
byte[] buffer = new byte[size];
is.read(buffer);
is.close();
String json = new String(buffer, "UTF-8");
Gson gson = new Gson();
questions = gson.fromJson(json, Questions.class);
} catch (IOException ex) {
ex.printStackTrace();
Toast.makeText(this, "Erreur de chargement des questions", Toast.LENGTH_SHORT).show();
}
}
/**
* Configure la barre de progression initiale
*/
private void setupProgressBar() {
progressBar.setMax(nombreQuestions);
progressBar.setProgress(0);
updateProgressText();
}
/**
* Configure les listeners des boutons
*/
private void setupButtonListeners() {
suivantButton.setOnClickListener(v -> {
BoideloAnimationUtils.triggerHapticFeedback(this);
updateQuestion();
});
skipButton.setOnClickListener(v -> {
BoideloAnimationUtils.triggerHapticFeedback(this);
skipQuestion();
});
}
/**
* Met à jour le texte de progression
*/
private void updateProgressText() {
progressTextView.setText("Question " + (totalQuestionsAsked + 1) + " / " + nombreQuestions);
}
/**
* Met à jour la barre de progression
*/
private void updateProgressBar() {
progressBar.setProgress(totalQuestionsAsked);
updateProgressText();
}
/**
* Met à jour la question affichée avec toutes les animations
*/
private void updateQuestion() {
// Vérifier si toutes les questions ont été posées
if (totalQuestionsAsked >= nombreQuestions) {
// Vérifier s'il y a encore des manches actives
if (!questionsAvecManches.isEmpty()) {
// Afficher le message de fin de manche et terminer
showFinalMancheEndMessage();
return;
}
endGame();
return;
}
// Gérer les questions avec manches actives
Iterator<Question> iterator = questionsAvecManches.iterator();
boolean hasMancheActive = false;
while (iterator.hasNext()) {
Question mancheQuestion = iterator.next();
mancheQuestion.setManchesRestantes(mancheQuestion.getManchesRestantes() - 1);
if (mancheQuestion.getManchesRestantes() <= 0) {
// Afficher brièvement le message d'arrêt et continuer
showMancheEndNotification(mancheQuestion.getArretMessageManche());
iterator.remove();
// Continuer avec une nouvelle question après la fin de manche
break;
} else {
// Afficher la question de manche en petit et continuer
hasMancheActive = true;
displayMancheQuestionSmall(mancheQuestion);
break; // Un seul défi à manches à la fois
}
}
// Afficher une nouvelle question (que ce soit pendant ou hors manche)
Question question = getRandomQuestion();
if (question != null) {
displayQuestion(question, hasMancheActive);
totalQuestionsAsked++;
updateProgressBar();
} else {
endGame();
}
}
/**
* Affiche une notification de fin de manche (sans bloquer le jeu)
*/
private void showMancheEndNotification(String message) {
// Afficher un Toast avec le message de fin
Toast.makeText(this, message, Toast.LENGTH_LONG).show();
// Vibration de succès
BoideloAnimationUtils.triggerSuccessHaptic(this);
// Masquer le compteur de manches et l'indicateur
mancheCounterTextView.setVisibility(View.GONE);
questionIndicator.setVisibility(View.GONE);
mancheQuestionText.setVisibility(View.GONE);
// Animation de fond jaune temporaire
int yellowColor = ContextCompat.getColor(this, R.color.game_manche_end);
BoideloAnimationUtils.animateBackgroundColor(getWindow().getDecorView(), yellowColor);
// Revenir à la couleur normale après un délai
mancheCounterTextView.postDelayed(() -> {
int defaultColor = ContextCompat.getColor(this, R.color.game_normal);
BoideloAnimationUtils.animateBackgroundColor(getWindow().getDecorView(), defaultColor);
}, 1000);
}
/**
* Affiche le message de fin de manche finale (quand le jeu se termine)
*/
private void showFinalMancheEndMessage() {
// Récupérer le message de la dernière manche
if (!questionsAvecManches.isEmpty()) {
Question lastManche = questionsAvecManches.get(0);
questionTextView.setText(Html.fromHtml(lastManche.getArretMessageManche(), Html.FROM_HTML_MODE_LEGACY));
}
// Animation de fond jaune
int yellowColor = ContextCompat.getColor(this, R.color.game_manche_end);
BoideloAnimationUtils.animateBackgroundColor(getWindow().getDecorView(), yellowColor);
// Vibration de succès
BoideloAnimationUtils.triggerSuccessHaptic(this);
// Masquer le compteur et l'indicateur
mancheCounterTextView.setVisibility(View.GONE);
questionIndicator.setVisibility(View.GONE);
mancheQuestionText.setVisibility(View.GONE);
// Terminer après un délai
mancheCounterTextView.postDelayed(() -> {
questionsAvecManches.clear();
endGame();
}, 3000);
}
/**
* Affiche une question de manche en petit (sans bloquer le jeu)
*/
private void displayMancheQuestionSmall(Question question) {
// Afficher la question de manche en petit avec le nombre de manches restantes
String mancheQuestion = question.getQuestion() + " <small>(" + question.getManchesRestantes() + " manche(s) restante(s))</small>";
mancheQuestionText.setText(Html.fromHtml(mancheQuestion, Html.FROM_HTML_MODE_LEGACY));
mancheQuestionText.setVisibility(View.VISIBLE);
// Mettre à jour le compteur
updateMancheCounter(question.getManchesRestantes(), question.getQuestion());
}
/**
* Affiche une question de manche active (ancienne méthode, plus utilisée)
*/
private void displayMancheQuestion(Question question) {
questionTextView.setText(Html.fromHtml(question.getQuestion(), Html.FROM_HTML_MODE_LEGACY));
// Fond bleu pour les manches
int blueColor = ContextCompat.getColor(this, R.color.game_question_manche);
BoideloAnimationUtils.animateBackgroundColor(getWindow().getDecorView(), blueColor);
// Afficher l'indicateur de manche
showQuestionIndicator(R.drawable.ic_manche, "Manche en cours");
// Mettre à jour le compteur
updateMancheCounter(question.getManchesRestantes(), question.getQuestion());
}
/**
* Met à jour le compteur de manches (affiché comme rappel)
*/
private void updateMancheCounter(int manchesRestantes, String mancheQuestion) {
mancheCounterTextView.setText("Défi en cours: " + manchesRestantes + " tour(s) restant(s)");
mancheCounterTextView.setVisibility(View.VISIBLE);
// Afficher l'indicateur de manche en haut
showQuestionIndicator(R.drawable.ic_manche, "Manche en cours");
// Animation du compteur
BoideloAnimationUtils.pulse(mancheCounterTextView, 300);
}
/**
* Affiche une nouvelle question
*/
private void displayQuestion(Question question, boolean hasMancheActive) {
questionTextView.setText(Html.fromHtml(question.getQuestion(), Html.FROM_HTML_MODE_LEGACY));
// Masquer ou afficher la question de manche selon l'état
if (!hasMancheActive) {
mancheQuestionText.setVisibility(View.GONE);
}
// Déterminer le type de question et animer le fond en conséquence
String questionText = question.getQuestion();
// Réinitialiser les indicateurs
questionIndicator.setVisibility(View.GONE);
mancheCounterTextView.setVisibility(View.GONE);
// Fond par défaut (respecte le mode jour/nuit)
int defaultColor = ContextCompat.getColor(this, R.color.game_normal);
BoideloAnimationUtils.animateBackgroundColor(
getWindow().getDecorView(),
defaultColor
);
// Vérifier le type de question
boolean isJoueurs1 = questionText.contains("<J1>");
boolean isJoueurs2 = questionText.contains("<J2>");
boolean isJoueurs3 = questionText.contains("<J3>");
boolean hasManches = questionText.contains("<manches>");
if (hasManches) {
int blueColor = ContextCompat.getColor(this, R.color.game_question_manche);
BoideloAnimationUtils.animateBackgroundColor(getWindow().getDecorView(), blueColor);
showQuestionIndicator(R.drawable.ic_manche, "Défi à manches");
} else if (isJoueurs1 && isJoueurs2 && isJoueurs3) {
int greenDarkColor = ContextCompat.getColor(this, R.color.game_question_3players);
BoideloAnimationUtils.animateBackgroundColor(getWindow().getDecorView(), greenDarkColor);
showQuestionIndicator(R.drawable.ic_player_three, "3 joueurs");
} else if (isJoueurs1 && isJoueurs2) {
int greenColor = ContextCompat.getColor(this, R.color.game_question_2players);
BoideloAnimationUtils.animateBackgroundColor(getWindow().getDecorView(), greenColor);
showQuestionIndicator(R.drawable.ic_player_two, "2 joueurs");
} else if (isJoueurs1) {
int greenLightColor = ContextCompat.getColor(this, R.color.game_question_1player);
BoideloAnimationUtils.animateBackgroundColor(getWindow().getDecorView(), greenLightColor);
showQuestionIndicator(R.drawable.ic_player_one, "1 joueur");
}
}
/**
* Affiche l'indicateur de type de question
*/
private void showQuestionIndicator(int iconRes, String text) {
indicatorIcon.setImageResource(iconRes);
indicatorText.setText(text);
questionIndicator.setVisibility(View.VISIBLE);
BoideloAnimationUtils.fadeIn(questionIndicator, 300);
}
/**
* Passe la question actuelle
*/
private void skipQuestion() {
// Marquer la question comme posée pour ne pas la revoir
totalQuestionsAsked++;
updateProgressBar();
updateQuestion();
}
/**
* Termine la partie et affiche l'écran de fin
*/
private void endGame() {
// Sauvegarder les statistiques de la partie
saveGameStats();
// Lancer l'activité de fin de partie
Intent intent = new Intent(this, EndGameActivity.class);
intent.putExtra("EXTRA_QUESTIONS_PLAYED", totalQuestionsAsked);
intent.putExtra("EXTRA_PLAYERS_COUNT", toutlesjoueurs != null ? toutlesjoueurs.size() : 0);
intent.putStringArrayListExtra("EXTRA_PLAYERS", (ArrayList<String>) toutlesjoueurs);
startActivity(intent);
// Animation de transition
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
// Vibration de fin
BoideloAnimationUtils.triggerErrorHaptic(this);
// Réinitialiser les questions posées pour une prochaine partie
resetAskedQuestions();
// Terminer l'activité
finish();
}
/**
* Sauvegarde les statistiques de la partie
*/
private void saveGameStats() {
SharedPreferences prefs = getSharedPreferences("game_stats", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = prefs.edit();
editor.putInt("questions_played", totalQuestionsAsked);
editor.putInt("players_count", toutlesjoueurs != null ? toutlesjoueurs.size() : 0);
editor.apply();
}
/**
* Réinitialise la liste des questions posées
*/
private void resetAskedQuestions() {
SharedPreferences prefs = getSharedPreferences("app", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = prefs.edit();
editor.remove("askedQuestions");
editor.apply();
}
/**
* Sélectionne trois joueurs aléatoires différents
*/
public List<String> TroisJoueurAleatoire(List<String> toutlesjoueurs) {
Set<String> setJoueur = new HashSet<>();
Random rand = new Random();
while (setJoueur.size() < 3 && toutlesjoueurs.size() >= 3) {
setJoueur.add(toutlesjoueurs.get(rand.nextInt(toutlesjoueurs.size())));
}
return new ArrayList<>(setJoueur);
}
/**
* Récupère le message d'arrêt par ID
*/
private String getArretById(int id) {
for (Question question : questions.getQuestions()) {
if (question.getId() == id) {
return question.getArret();
}
}
return null;
}
/**
* Obtient une question aléatoire qui n'a pas encore été posée
*/
private Question getRandomQuestion() {
if (questions == null) {
return null;
}
SharedPreferences prefs = getSharedPreferences("app", Context.MODE_PRIVATE);
Set<String> askedQuestions = prefs.getStringSet("askedQuestions", new HashSet<>());
List<Question> unaskedQuestions = new ArrayList<>();
for (Question question : questions.getQuestions()) {
if (!askedQuestions.contains(String.valueOf(question.getId()))) {
unaskedQuestions.add(question);
}
}
if (unaskedQuestions.isEmpty()) {
return null;
}
Random random = new Random();
Question question = unaskedQuestions.get(random.nextInt(unaskedQuestions.size()));
askedQuestions.add(String.valueOf(question.getId()));
// Sauvegarder les questions posées
SharedPreferences.Editor editor = prefs.edit();
editor.putStringSet("askedQuestions", askedQuestions);
editor.apply();
// Traiter la question
processQuestion(question);
return question;
}
/**
* Traite une question (remplace les variables, etc.)
*/
private void processQuestion(Question question) {
Random random = new Random();
String questionText = question.getQuestion();
// Remplacer les variantes
if (question.getVariante() != null && !question.getVariante().isEmpty()) {
String chosenVariante = question.getVariante().get(random.nextInt(question.getVariante().size()));
questionText = questionText.replace("<variante>", chosenVariante);
}
// Gérer les manches
if (questionText.contains("<manches>")) {
int nbaleatoiremanches = random.nextInt(10) + 5;
questionText = questionText.replace("<manches>", String.valueOf(nbaleatoiremanches));
question.setManchesRestantes(nbaleatoiremanches);
String stopid = getArretById(question.getId());
question.setArretMessageManche("Fin de défi!\n" + stopid);
questionsAvecManches.add(question);
}
// Remplacer les joueurs
boolean isJoueurs1 = questionText.contains("<J1>");
boolean isJoueurs2 = questionText.contains("<J2>");
boolean isJoueurs3 = questionText.contains("<J3>");
if (isJoueurs1 || isJoueurs2 || isJoueurs3) {
List<String> aleatoirejoueurs = TroisJoueurAleatoire(toutlesjoueurs);
if (isJoueurs1 && isJoueurs2 && isJoueurs3 && aleatoirejoueurs.size() >= 3) {
questionText = questionText.replace("<J1>", aleatoirejoueurs.get(0));
questionText = questionText.replace("<J2>", aleatoirejoueurs.get(1));
questionText = questionText.replace("<J3>", aleatoirejoueurs.get(2));
} else if (isJoueurs1 && isJoueurs2 && aleatoirejoueurs.size() >= 2) {
questionText = questionText.replace("<J1>", aleatoirejoueurs.get(0));
questionText = questionText.replace("<J2>", aleatoirejoueurs.get(1));
} else if (isJoueurs1 && aleatoirejoueurs.size() >= 1) {
questionText = questionText.replace("<J1>", aleatoirejoueurs.get(0));
}
}
// Ajouter les gorgées
if (question.isDistribution() || question.isRecois()) {
if (question.isRecois() && question.isDistribution()) {
boolean rand = random.nextBoolean();
if (rand) {
questionText = questionText.concat(" <b>bois</b>");
} else {
questionText = questionText.concat(" <b>distribue</b>");
}
} else if (question.isRecois()) {
questionText = questionText.concat(" <b>bois</b>");
} else if (question.isDistribution()) {
questionText = questionText.concat(" <b>distribue</b>");
}
questionText = questionText.concat(" " + (question.getGorger() + ajoutGorgees) + " gorgée" +
((question.getGorger() + ajoutGorgees) > 1 ? "s" : "") + ".");
}
question.setQuestion(questionText);
}
/**
* Méthode publique pour le bouton suivant (compatibilité avec XML)
*/
public void OnClickButton1(View view) {
BoideloAnimationUtils.triggerHapticFeedback(this);
updateQuestion();
}
/**
* Méthode publique pour le bouton passer
*/
public void onSkipClick(View view) {
BoideloAnimationUtils.triggerHapticFeedback(this);
skipQuestion();
}
/**
* Navigue vers l'activité JeuxParametres en cas d'échec API
*/
public void navigateToJeuxParametres() {
Intent intent = new Intent(Jeux.this, JeuxParametres.class);
Toast.makeText(getApplicationContext(), "Échec de la communication avec l'API !", Toast.LENGTH_SHORT).show();
startActivity(intent);
finish();
}
/**
* Sauvegarde l'état du jeu avant la rotation
*/
@Override
protected void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
outState.putInt(KEY_TOTAL_QUESTIONS, totalQuestionsAsked);
outState.putString(KEY_CURRENT_QUESTION_TEXT, questionTextView.getText().toString());
outState.putBoolean(KEY_IS_MANCHE_ACTIVE, isMancheActive);
// Sauvegarder l'état des manches actives
ArrayList<Integer> mancheIds = new ArrayList<>();
ArrayList<Integer> mancheCounts = new ArrayList<>();
for (Question q : questionsAvecManches) {
mancheIds.add(q.getId());
mancheCounts.add(q.getManchesRestantes());
}
outState.putIntegerArrayList("manche_ids", mancheIds);
outState.putIntegerArrayList("manche_counts", mancheCounts);
}
/**
* Restaure l'état du jeu après rotation
*/
private void restoreGameState(Bundle savedInstanceState) {
totalQuestionsAsked = savedInstanceState.getInt(KEY_TOTAL_QUESTIONS, 0);
currentQuestionText = savedInstanceState.getString(KEY_CURRENT_QUESTION_TEXT, "");
isMancheActive = savedInstanceState.getBoolean(KEY_IS_MANCHE_ACTIVE, false);
// Restaurer la progression
progressBar.setProgress(totalQuestionsAsked);
updateProgressText();
// Restaurer le texte de la question
if (!currentQuestionText.isEmpty()) {
questionTextView.setText(Html.fromHtml(currentQuestionText, Html.FROM_HTML_MODE_LEGACY));
}
// Restaurer les manches actives
ArrayList<Integer> mancheIds = savedInstanceState.getIntegerArrayList("manche_ids");
ArrayList<Integer> mancheCounts = savedInstanceState.getIntegerArrayList("manche_counts");
if (mancheIds != null && mancheCounts != null) {
questionsAvecManches.clear();
for (int i = 0; i < mancheIds.size(); i++) {
Question q = findQuestionById(mancheIds.get(i));
if (q != null) {
q.setManchesRestantes(mancheCounts.get(i));
questionsAvecManches.add(q);
}
}
}
}
/**
* Trouve une question par son ID
*/
private Question findQuestionById(int id) {
if (questions == null) return null;
for (Question q : questions.getQuestions()) {
if (q.getId() == id) {
// Créer une copie pour éviter de modifier l'original
Question copy = new Question();
copy.setId(q.getId());
copy.setQuestion(q.getQuestion());
copy.setArret(q.getArret());
copy.setVariante(q.getVariante());
copy.setDistribution(q.isDistribution());
copy.setRecois(q.isRecois());
copy.setGorger(q.getGorger());
copy.setManchesRestantes(q.getManchesRestantes());
return copy;
}
}
return null;
}
}
@@ -0,0 +1,333 @@
package com.example.boidelov3;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Button;
import android.widget.CompoundButton;
import com.google.android.material.switchmaterial.SwitchMaterial;
import android.widget.EditText;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class JeuxParametres extends AppCompatActivity {
private SeekBar seekBar1, seekBar2, seekBar3;
private TextView textView1, textView2, textView5, textViewRatioGen;
private SwitchMaterial checkBoxGPT;
private EditText editText, editTextKeyGPT;
private String keyGPT;
private int nbQuestions;
private List<String> toutlesjoueurs;
@Override
protected void onCreate(Bundle savedInstanceState) {
toutlesjoueurs = getIntent().getStringArrayListExtra("EXTRA_LIST_JOUEUR");
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_jeux_parametres);
// Initialisation des vues
seekBar1 = findViewById(R.id.seekBar1);
seekBar2 = findViewById(R.id.seekBar2);
seekBar3 = findViewById(R.id.seekBar3);
textView1 = findViewById(R.id.textView1);
textView2 = findViewById(R.id.textView2);
textView5 = findViewById(R.id.textView5);
editTextKeyGPT = findViewById(R.id.editTextGPT);
textViewRatioGen = findViewById(R.id.textViewRatioGen);
// Initialiser les TextView avec les valeurs par défaut
int initialQuestions = 50;
int initialGorgees = 0;
int initialRatio = 8;
textView1.setText("Nombre de questions avant la fin de partie : " + initialQuestions);
textView2.setText("Ajout de gorgées : " + initialGorgees);
textView5.setText("Palier : Grosse merde");
textViewRatioGen.setText("Ratio BDD/OPENAI : 1/" + initialRatio);
Button buttonTestApi = findViewById(R.id.ButtonTestApi);
// Configuration de la seekBar1
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
seekBar1.setMin(20);
}
seekBar1.setMax(150);
seekBar1.setProgress(50);
// Configuration de la seekBar2
seekBar2.setMax(20);
seekBar2.setProgress(0);
// Configuration de la seekBar3
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
seekBar2.setMin(0);
seekBar3.setMin(1);
}
seekBar3.setMax(15);
seekBar3.setProgress(8);
// Configuration des listeners pour les seekBars
seekBar1.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
// Ajustement de la valeur au multiple de 10 le plus proche
int adjustedProgress = Math.round(progress / 10) * 10;
seekBar.setProgress(adjustedProgress);
textView1.setText("Nombre de questions avant la fin de partie : " + adjustedProgress);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
seekBar2.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
// Mise à jour du textView2 en fonction de la valeur de la seekBar2
textView2.setText("Ajout de gorgées : " + progress);
// Mise à jour du textView5 en fonction de la valeur de la seekBar2
switch (progress) {
case 0:
textView5.setText("Palier : Grosse merde");
break;
case 2:
textView5.setText("Palier : Petite merde");
break;
case 4:
textView5.setText("Palier : Petit joueur");
break;
case 6:
textView5.setText("Palier : Un p'tit verre ?!");
break;
case 8:
textView5.setText("Palier : ça commence à aller");
break;
case 10:
textView5.setText("Palier : Alcoolique");
break;
case 12:
textView5.setText("Palier : COMA ETHYLIX");
break;
case 13:
textView5.setText("Palier : APÉROOOOO !!");
break;
case 14:
textView5.setText("Palier : LA J'SUIS BIENG");
break;
case 15:
textView5.setText("Palier : J'VOIS PLUS RIENG");
break;
case 17:
textView5.setText("Palier : J'AI PLUS DE VERRES");
break;
case 18 :
textView5.setText("Palier : Soirée Murge");
break;
case 19:
textView5.setText("Palier : Soirée Pétée");
break;
case 20:
textView5.setText("Palier : L'ENDER DRAGON");
break;
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
// Configuration du checkBox // Q : IL sert a quoi ?
// R : Il sert à activer/désactiver les vues en dessous
checkBoxGPT = findViewById(R.id.checkBoxGPT);
checkBoxGPT.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// Activation/désactivation des vues en fonction de l'état du checkBox
editTextKeyGPT.setEnabled(isChecked);
//editText.setEnabled(isChecked);
textViewRatioGen.setEnabled(isChecked);
seekBar3.setEnabled(isChecked);
buttonTestApi.setEnabled(isChecked);
}
});
// Configuration de la seekBar3
seekBar3.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar3, int progress, boolean fromUser) {
textViewRatioGen.setText("Ratio BDD/OPENAI : 1/" + progress);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar3) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar3) {
}
});
// Partie OpenAI : enregistrement de la clé en dur.
// Récupérer une instance des SharedPreferences
SharedPreferences sharedPreferences = getSharedPreferences("MyPrefs", MODE_PRIVATE);
final SharedPreferences.Editor editor = sharedPreferences.edit();
// Récupérer l'EditText
final EditText editText = findViewById(R.id.editTextGPT);
// Récupérer la valeur enregistrée dans les SharedPreferences
String apiKey = editText.getText().toString();
// Récupérer la valeur enregistrée dans les SharedPreferences
String savedText = sharedPreferences.getString("savedText", "");
editText.setText(savedText);
// Enregistrer le contenu de l'EditText lorsque l'utilisateur modifie le texte
editText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
// Enregistrer le texte dans les SharedPreferences
editor.putString("savedText", editText.getText().toString());
editor.apply();
}
});
}
public void onClickButtonTestAPI(View view) {
String apiKey = editTextKeyGPT.getText().toString();
// Créer un client OkHttpClient pour effectuer la requête
OkHttpClient client = new OkHttpClient();
// Construire la requête d'essai vers l'API
Request request = new Request.Builder()
.url("https://api.openai.com/v1/engines/davinci") // Endpoint d'essai, vous pouvez le modifier selon vos besoins
.header("Authorization", "Bearer " + apiKey) // Ajouter la clé API dans l'en-tête de la requête
.build();
// Exécuter la requête de test
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(@NonNull Call call, IOException e) {
// Gérer les erreurs de requête
e.printStackTrace();
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getApplicationContext(), "Échec de la communication avec l'API !", Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onResponse(Call call, Response response) throws IOException {
// Vérifier le code de réponse de la requête
if (response.isSuccessful()) {
// La clé API est valide et l'API a répondu avec succès
// Vous pouvez effectuer d'autres opérations ici
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getApplicationContext(), "Communication avec l'API réussie !", Toast.LENGTH_SHORT).show();
}
});
} else {
// La clé API est invalide ou il y a eu une erreur de communication avec l'API
System.out.println("Échec de la communication avec l'API !");
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getApplicationContext(), "Échec de la communication avec l'API !", Toast.LENGTH_SHORT).show();
}
});
}
response.close();
}
});
}
public void onClickButtonStart(View view) {
// Récupérer les paramètres de la partie
int nombreQuestions = seekBar1.getProgress();
int ajoutGorgees = seekBar2.getProgress();
int ratioBddOpenAI = seekBar3.getProgress();
boolean openAI = checkBoxGPT.isChecked();
toutlesjoueurs = getIntent().getStringArrayListExtra("EXTRA_LIST_JOUEUR");
// Récupérer les joueurs (vous devrez définir comment vous les récupérez)
SharedPreferences sharedPreferences = getSharedPreferences("Joueurs", Context.MODE_PRIVATE);
ArrayList<String> joueurs = new ArrayList<>();
for (int i = 1; i <= 3; i++) {
String joueur = sharedPreferences.getString("J" + i, "");
if (!joueur.isEmpty()) {
joueurs.add(joueur);
}
}
// Récupérer les joueurs supplémentaires en utilisant une boucle
int i = 4;
String nomJoueur = sharedPreferences.getString("J" + i, "");
while (!nomJoueur.isEmpty()) {
joueurs.add(nomJoueur);
i++;
nomJoueur = sharedPreferences.getString("J" + i, "");
}
// Créer une instance de la classe Jeux avec les paramètres récupérés
Jeux jeux = new Jeux();
// Lancer l'activité Jeux avec les paramètres
Intent intent = new Intent(this, Jeux.class);
intent.putExtra("EXTRA_NOMBRE_QUESTIONS", nombreQuestions);
intent.putExtra("EXTRA_AJOUT_GORGEE", ajoutGorgees);
intent.putExtra("EXTRA_RATIO_OPENAI", ratioBddOpenAI);
intent.putExtra("EXTRA_OPENAI", openAI);
final EditText editText = findViewById(R.id.editTextGPT);
intent.putExtra("EXTRA_KEY_OPENAI",editText.getText().toString() );
toutlesjoueurs = getIntent().getStringArrayListExtra("EXTRA_LIST_JOUEUR");
intent.putStringArrayListExtra("EXTRA_LIST_JOUEUR", (ArrayList<String>) toutlesjoueurs);
startActivity(intent);
}
}
@@ -0,0 +1,350 @@
package com.example.boidelov3;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class Jeuxold extends AppCompatActivity {
private List<String> toutlesjoueurs, phraseGPT;
private int nombreQuestions;
private int ajoutGorgees;
boolean openAI;
int ratiOpenai;
String keyOpenai, phraseGPTString;
public Jeuxold() {
//System.out.println("Je suis dans le constructeur jeux");
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_jeux);
//Recuperation des valeurs des activités précédentes
toutlesjoueurs = getIntent().getStringArrayListExtra("EXTRA_LIST_JOUEUR");
nombreQuestions = getIntent().getIntExtra("EXTRA_NOMBRE_QUESTIONS", 75);
ajoutGorgees = getIntent().getIntExtra("EXTRA_AJOUT_GORGEE", 0);
openAI = getIntent().getBooleanExtra("EXTRA_OPENAI", false);
ratiOpenai = getIntent().getIntExtra("EXTRA_RATIO_OPENAI", 0);
keyOpenai = getIntent().getStringExtra("EXTRA_KEY_OPENAI");
System.out.println("ACTJeux all player : " + toutlesjoueurs);
System.out.println("ACTJeux nombre de questions : " + nombreQuestions);
System.out.println("ACTJeux ajout de gorgées : " + ajoutGorgees);
System.out.println("ACTJeux openAI : " + openAI);
System.out.println("ACTJeux ratio openAI : " + ratiOpenai);
System.out.println("ACTJeux key openAI : " + keyOpenai);
//Parti OpenAI ; keyOpenai ; ratiOpenai, openAI
//new DatabaseConnection().execute();
// if(openAI) {
// ChatGPTTask chatGPTTask = new ChatGPTTask( this, keyOpenai);
// chatGPTTask.execute();
//
// }
//Phrase avec nom ou pas?
/* if(JoueurOuPas()){
PhraseAvecNom(toutlesjoueurs);
}else{
PhraseSansNom();
}
}*/
}
public void handleExtractedMessage(String phraseGPTString) {
// Traitez la réponse extraite ici
System.out.println(phraseGPTString);
// Par exemple, affichez-la dans une TextView ou effectuez une action en fonction de la réponse
}
public void navigateToJeuxParametres() {
Intent intent = new Intent(Jeuxold.this, JeuxParametres.class);
Toast.makeText(getApplicationContext(), "Échec de la communication avec l'API !", Toast.LENGTH_SHORT).show();
startActivity(intent);
}
/*public void PhraseAvecNom(List toutlesjoueurs){
//System.out.println("Je suis dans phrase avec pseudo");
List<String> phraseAvecNom = new ArrayList<String>();
List aleatoirejoueurs = TroisJoueurAleatoire(toutlesjoueurs);
phraseAvecNom.add(ChoixJoueurAleatoire(toutlesjoueurs) + " dois boire " + Gorgeesaleatoire(2, 4)+ " Gorgées");
phraseAvecNom.add(ChoixJoueurAleatoire((toutlesjoueurs))+ " est le vieux briscard ! Interdiction de montrer tes dents pendant 5 manches");
phraseAvecNom.add(aleatoirejoueurs.get(0) + " et "+ aleatoirejoueurs.get(1) +" liser le premier SMS qui s'affiche quand on tape désolé dans la barre de recherche. Refusez pour 5 gorgées");
phraseAvecNom.add( "A tour de role, vous avez exactement 3 secondes pour donner un mot en rapport avec le mots dit precedemment. Le joueur qui perd boit "+ Gorgeesaleatoire(2, 4) + " Gorgées! "+ aleatoirejoueurs.get(2)+" tu commences en choissisant un mot.");
phraseAvecNom.add(aleatoirejoueurs.get(0)+ " defie "+ aleatoirejoueurs.get(1) + " au chifoumi ! Le joueur qui gagne distribue 5 Gorgées");
phraseAvecNom.add(aleatoirejoueurs.get(0)+ " a toi de juger : entre "+aleatoirejoueurs.get(1)+ " et "+ aleatoirejoueurs.get(2) + " qui stresse le plus pour un rien selon toi? Cette personne se detendra en buvant " + Gorgeesaleatoire(3, 5 ) + " Gorgées");
phraseAvecNom.add(aleatoirejoueurs.get(0)+" est dans le futur ! Tu dois parler au futur pendant 4 tours Une gorgées a chaque manque.");
phraseAvecNom.add("Les joueurs de Counter Strike peuvent distribuer" + GorgeesaleatoireAmeliorer(1, 4));
phraseAvecNom.add(aleatoirejoueurs.get(0)+" tu bois autant de gorgées que tu as d'années d'études après le BAC");
phraseAvecNom.add(aleatoirejoueurs.get(0)+" et "+aleatoirejoueurs.get(1)+" ferment leurs yeux ! Ils/Elles doivent deviner la couleur des yeux de l'autre. Si ils/elles se trompent, c'est "+GorgeesaleatoireAmeliorer(2, 4));
phraseAvecNom.add(aleatoirejoueurs.get(0)+" est manchot ! Il/Elle ne peut plus utiliser ses doigts durant 3 tours . Si il/elle s'en sert, il/elle devra boire autant de gorgées qu'il/elle a utilisé de doigts");
phraseAvecNom.add(aleatoirejoueurs.get(0)+" et "+ aleatoirejoueurs.get(1)+" , si vous êtes ensemble dans la vraie vie, vous pouvez distribuer 2 gorgées , autrement buvez-les");
phraseAvecNom.add(aleatoirejoueurs.get(0)+", donne le nombre d'habitant du Tadjikistant ( à 1 000 000 près) ou boit "+GorgeesaleatoireAmeliorer(2, 4));
phraseAvecNom.add(aleatoirejoueurs.get(0)+" a la tourette ! A chaque fois que tu bois une gorgée, tu dois CRIER une insulte. C'est un stade avancé, ça dure 3 tours");
phraseAvecNom.add(aleatoirejoueurs.get(0)+", donne la couleur préférée de "+aleatoirejoueurs.get(1)+" si tu te trompes, c'est 2 gorgées");
phraseAvecNom.add(aleatoirejoueurs.get(0)+" à l'oeil de serpent pendant 5 tours ! Dès qu'un joueur te regarde dans les yeux, il/elle boit. Si personne ne t'as regardé tu bois"+GorgeesaleatoireAmeliorer(5, 9));
phraseAvecNom.add(aleatoirejoueurs.get(0)+" et "+ aleatoirejoueurs.get(1)+"se mesurent ! Le plus petit peut bois"+GorgeesaleatoireAmeliorer(3, 5));
phraseAvecNom.add(aleatoirejoueurs.get(0)+" doit terminer toutes ses phrases par - C'est clair pendant 7 tours");
phraseAvecNom.add(aleatoirejoueurs.get(0)+" distribue"+GorgeesaleatoireAmeliorer(2,5)+" à la personne que tu trouves la mieux foutue");
phraseAvecNom.add(aleatoirejoueurs.get(0)+" distribue"+GorgeesaleatoireAmeliorer(2,5)+" à qui tu veux.");
phraseAvecNom.add(aleatoirejoueurs.get(0)+" et "+aleatoirejoueurs.get(1)+" se défient au 'je te tiens, tu me tiens', le premier qui rit sera une tapette, et devra boire"+GorgeesaleatoireAmeliorer(4,6));
phraseAvecNom.add(aleatoirejoueurs.get(0)+" et "+aleatoirejoueurs.get(1)+"n'ont plus le droit d'utiliser leur téléphone jusqu'à la fin du jeu ! A chaque manque c'est"+GorgeesaleatoireAmeliorer(1,3));
phraseAvecNom.add(aleatoirejoueurs.get(0)+" et "+aleatoirejoueurs.get(1)+ "racontent une anecdote, celui/celle qui sort la plus banale boit "+GorgeesaleatoireAmeliorer(3, 6));
phraseAvecNom.add(aleatoirejoueurs.get(0)+", pour"+GorgeesaleatoireAmeliorer(2,4)+", a qui est ce slogan? Y a pas plus fort. (Vigor)");
phraseAvecNom.add(aleatoirejoueurs.get(0)+", Vrai ou faux? L'eau est bleu car elle reflète le ciel? (Non) Si tu as repondu faux tu devras boire : "+GorgeesaleatoireAmeliorer(2,4));
phraseAvecNom.add(aleatoirejoueurs.get(0)+", Si on te dit Marco? ... Si tu as dis Polo tu bois "+GorgeesaleatoireAmeliorer(1,3));
phraseAvecNom.add(aleatoirejoueurs.get(0)+", Boire un café fait baisser le taux d'alcool? "+GorgeesaleatoireAmeliorer(5, 8)+"en jeu (FAUX)");
phraseAvecNom.add(aleatoirejoueurs.get(0)+" est l'aigris pendant 5tours ! Dès que tu souris ou rigoles, tu bois "+GorgeesaleatoireAmeliorer(2,3));
phraseAvecNom.add(aleatoirejoueurs.get(0)+" fait un geste, le suivant répète et en ajoute un. Le perdant boit"+GorgeesaleatoireAmeliorer(3,5));
phraseAvecNom.add(aleatoirejoueurs.get(0)+", "+aleatoirejoueurs.get(2)+" et "+aleatoirejoueurs.get(1)+" vont désigner quelqu'un qui doit terminer son verre ");
phraseAvecNom.add("Récitez l'alphabet en énonçant une lettre à tour de rôle. Si "+aleatoirejoueurs.get(0)+" finit son verre avant, cul sec pour tout le monde !");
phraseAvecNom.add("Si"+aleatoirejoueurs.get(0)+" arrive a finir son verre en moins de 5 secondes, il/elle peut distribuer"+ GorgeesaleatoireAmeliorer(5, 8));
phraseAvecNom.add(aleatoirejoueurs.get(0)+" et "+ aleatoirejoueurs.get(1)+"sont lies, si l'un boit alors l'autre aussi, et ce pendant 5 tours");
phraseAvecNom.add(aleatoirejoueurs.get(0)+", "+aleatoirejoueurs.get(2)+" et "+ aleatoirejoueurs.get(1)+"sont lies, si l'un boit alors les autres aussi, et ce pendant 5 tours");
phraseAvecNom.add(aleatoirejoueurs.get(0)+" dit un mot, la personne suivante le répète et en ajoute un nouveau, ainsi de suite jusqu'a ce que quelqu'un se trompe. Le perdant boit autant de gorgées qu'il y a eu de personne avant lui");
phraseAvecNom.add(aleatoirejoueurs.get(0)+" doit choisir un mot que tout le monde devra dire à chaque fois qu'une personne boit.");
//phraseAvecNom.add(aleatoirejoueurs.get(0)+"");
//phraseAvecNom.add(aleatoirejoueurs.get(0)+"");
//phraseAvecNom.add(aleatoirejoueurs.get(0)+"");
//Affichage :
TextView textView1 = (TextView) findViewById(R.id.textView1);
textView1.setText(Nbaleatoirelist(phraseAvecNom));
}
public void PhraseSansNom(){
//System.out.println("Je suis dans phrase sans pseudo");
List<String> phraseSansNom = new ArrayList<String>();
//Ajout de defis
phraseSansNom.add("Tout le monde boit "+ Gorgeesaleatoire(1, 2)+" gorgée(s)");
phraseSansNom.add("Quand l'heure affichera un multiple de 10 (22h, 22h10 ...) le premier a crier \"merde j'ai oublié mon chat\" distribura " + Gorgeesaleatoire(10, 12)+ " Gorgées");
phraseSansNom.add("Ceux qui ont dansé aujourd'hui boivent 4 gorgées");
phraseSansNom.add("Bois "+ Gorgeesaleatoire(2, 6)+ " Gorgées si tu n'as pas ton veritable nom sur insta");
phraseSansNom.add("Bois "+ Gorgeesaleatoire(2, 3)+ " Gorgées si tu a des photos sur insta.");
phraseSansNom.add("Plutôt ne plus avoir de mains ou de jambes? les perdants boivent "+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Celles/Ceux qui ont habité dans plus de 3 villes boivent "+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Vive la poésie ! Nos phrases doivent rimer sous peine d'une gorgée");
phraseSansNom.add("Elisez le joueur le moins drôle d'entre vous, ce dernier boit" + GorgeesaleatoireAmeliorer(1,4 ));
phraseSansNom.add("Elisez le joueur le plus drôle d'entre vous, ce dernier distribue" + GorgeesaleatoireAmeliorer(1,4 ));
phraseSansNom.add("La dernière personne à avoir vomi en soirée distribue" + GorgeesaleatoireAmeliorer(2,4));
phraseSansNom.add("Les filles peuvent distribuer"+ GorgeesaleatoireAmeliorer(1, 2));
phraseSansNom.add("Les garçons peuvent distribuer"+ GorgeesaleatoireAmeliorer(1, 2));
phraseSansNom.add("Toutes celles (ou ceux) qui ont du verni à ongles boivent"+GorgeesaleatoireAmeliorer(1,2));
phraseSansNom.add("Tous les joueurs célibataires boivent"+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Tous ceux qui ont des lunettes boivent"+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Le premier joueur qui arrive à mettre son doigt dans le nez d'un autre joueur peut distribuer"+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Tous ceux qui ont déjà triché à un examen boivent "+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Plutôt avoir un tapis volant, ou un frigo qui se remplit tout seul ? Votez tous en même temps. La minorité boit "+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Les couples trinquer ensemble "+ GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Le/La plus radin(e) boit"+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Le mec qui a le plus gros ventre à bière boit"+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Tous ceux qui se sont déjà fait exclure de cours boivent"+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Tous ceux qui ont des frères et soeurs boivent"+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Celles et ceux qui ont un Windows phone peuvent distribuer"+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Celles/Ceux qui se sont déjà battus boivent"+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Celui/Celle qui pèse le plus lourd boit "+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Pour se décoincer, le/la plus timide boit"+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Le/La plus jeune boit"+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Plutôt avoir du temps ou de l'argent ? Votez tous en même temps. La minorité boit"+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Celles/Ceux qui ont fait des études de L boivent"+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Le premier joueur qui en embrasse un autre sur la bouche pourra distribuer"+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Celles et ceux qui joue de la guitare peuvent distribuer"+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Celles et ceux qui joue du piano peuvent distribuer"+GorgeesaleatoireAmeliorer(1,4));
phraseSansNom.add("Les gens qui se sont masturbés aujourd'hui peuvent distribuer"+GorgeesaleatoireAmeliorer(1, 4));
phraseSansNom.add("Celui ou celle a la meilleure place boit"+GorgeesaleatoireAmeliorer(1, 4));
phraseSansNom.add("Celles et ceux qui n'ont jamais trompé leur partenaire (c'est bien) peuvent distribuer"+GorgeesaleatoireAmeliorer(1, 4));
phraseSansNom.add("Celui/Celle avec les vêtements les plus moches boit"+GorgeesaleatoireAmeliorer(1, 4));
phraseSansNom.add("Celui/Celle qui a les cheveux les plus longs boit"+GorgeesaleatoireAmeliorer(1, 4));
phraseSansNom.add("On doit doser son Alcool les yeux fermés"+GorgeesaleatoireAmeliorer(1, 4));
phraseSansNom.add("Plutôt série ou film ? Votez tous en même temps. La minorité boit"+GorgeesaleatoireAmeliorer(1, 4));
phraseSansNom.add("Elisez le plus débile d'entre vous, ce dernier boit"+GorgeesaleatoireAmeliorer(1, 4));
phraseSansNom.add("Le premier qui donne un film de - Christopher Nolan - pourra distribuer"+GorgeesaleatoireAmeliorer(1, 4));
phraseSansNom.add("Le premier qui donne un film avec Christian Clavier pourra boire"+GorgeesaleatoireAmeliorer(1, 4));
phraseSansNom.add("Les végans boivent "+GorgeesaleatoireAmeliorer(1, 4));
phraseSansNom.add("La fille la plus maquillé boit"+GorgeesaleatoireAmeliorer(1, 4));
phraseSansNom.add("Celles/Ceux qui ont déjà appelé leur partenaire par le prénom de leurs ex boivent"+GorgeesaleatoireAmeliorer(1, 4));
phraseSansNom.add("La première personne qui désigne le plus jeune peut distribuer"+GorgeesaleatoireAmeliorer(1, 4));
phraseSansNom.add("Plutôt avoir des connaissances illimitées ou dirigier le monde ? Votez tous en même temps. La minorité boit"+GorgeesaleatoireAmeliorer(1, 4));
phraseSansNom.add("Plutôt n'avoir aucun ami ou ne plus pouvoir utiliser d'appareil électronique ? Votez tous en même temps. La minorité boit"+ GorgeesaleatoireAmeliorer(2, 5));
phraseSansNom.add("Plutot vaincre le patrikaka ou la polution dans le monde? Votez tous en meme temps. La minorité boit"+GorgeesaleatoireAmeliorer(1, 2));
phraseSansNom.add("Jeu du LUTIN : Jusqu'a la fin du jeu. Vous devez enlever le lutin de votre verre pour pouvoir boire et le remettre ensuite sinon vous devait reboire");
phraseSansNom.add("Celles et ceux qui boivent de la Vodka peuvent distribuer "+ GorgeesaleatoireAmeliorer(2, 4));
phraseSansNom.add("Les joueurs qui ont un A dans leur prénom boivent "+GorgeesaleatoireAmeliorer(3,5));
phraseSansNom.add("Les joueurs qui ont un P dans le prénom distribue"+GorgeesaleatoireAmeliorer(1, 3));
phraseSansNom.add("Le premier joueur à ramener un objet rouge (pas de vêtements) peut distribuer"+GorgeesaleatoireAmeliorer(3,5));
phraseSansNom.add("Le premier joueur qui dévoile un de ses secrets et que personne autour ne sait peut distribuer"+ GorgeesaleatoireAmeliorer(3, 6));
phraseSansNom.add("Chaque joueur doit lire à haute voix le dernier SMS qu'il a reçu. Si il/elle refuse, c'est"+ GorgeesaleatoireAmeliorer(2, 4));
phraseSansNom.add("Le joueur avec le plus gros cul boit"+ GorgeesaleatoireAmeliorer(2, 6));
phraseSansNom.add("Celles/Ceux qui ont moins de 20ans boivent"+ GorgeesaleatoireAmeliorer(2, 7));
phraseSansNom.add("Celui ou celle avec le plus gros appetit sexuel boit"+ GorgeesaleatoireAmeliorer(2, 4));
phraseSansNom.add("Ceux/Celles qui fumes boivent "+ GorgeesaleatoireAmeliorer(2, 4));
phraseSansNom.add("Celles et ceux qui ont au moins un BAC +3 peuvent distribuer"+ GorgeesaleatoireAmeliorer(2, 4));
phraseSansNom.add("Le premier joueur à se lever peut donner"+ GorgeesaleatoireAmeliorer(6, 7));
phraseSansNom.add("Celles et ceux qui n'ont jamais fait de strip tease boivent"+ GorgeesaleatoireAmeliorer(2, 4));
phraseSansNom.add("Le premier joueur à enlever un vêtements pourra distribuer"+ GorgeesaleatoireAmeliorer(5, 7));
phraseSansNom.add("Jeu des peaux ! Triez vous du joueur le plus bronzé au joueur le moins bronzé. Le plus bronzé prend 1 gorgée, le second 2 gorgées, etc.");
phraseSansNom.add("Tous ceux qui ont déjà uriné dans une piscine boivent"+ GorgeesaleatoireAmeliorer(2, 4));
phraseSansNom.add("Celui/Celle avec le plus d'amis sur Facebook boit"+ GorgeesaleatoireAmeliorer(2, 4));
phraseSansNom.add("Celui/Celle avec le nom de famille le plus compliqué boit"+ GorgeesaleatoireAmeliorer(2, 4));
phraseSansNom.add("Les joueurs qui n'ont pas encore distribué de gorgées boivent"+ GorgeesaleatoireAmeliorer(2, 4));
phraseSansNom.add("Plutôt avoir du pouvoir ou de la connaissance ? Votez tous en même temps. La minorité boit"+ GorgeesaleatoireAmeliorer(2, 4));
phraseSansNom.add("le plus gros dalleux avec les filles boit"+ GorgeesaleatoireAmeliorer(2, 4));
phraseSansNom.add("Le premier joueur à donner l'heure pourra distribuer"+ GorgeesaleatoireAmeliorer(2, 4));
phraseSansNom.add("Celles et ceux qui ont déjà dépenser plus de 2000 euros en un achat peuvent distribuer"+ GorgeesaleatoireAmeliorer(2, 4));
phraseSansNom.add("Le mec le moins courageux boit "+ GorgeesaleatoireAmeliorer(2, 4));
phraseSansNom.add("Celles/Ceux qui rentre chez eux à la fin de la soirée boivent"+ GorgeesaleatoireAmeliorer(8, 12));
phraseSansNom.add("Il est désormais interdit de se tutoyer");
phraseSansNom.add("Toutes les règles existantes sont annulées");
phraseSansNom.add("Celles et ceux dont le jour d'anniversaire est un nombre impair boivent"+ GorgeesaleatoireAmeliorer(2, 4));
//phraseSansNom.add("");
//phraseSansNom.add("");
//phraseSansNom.add("");
//phraseSansNom.add("");
//phraseSansNom.add("");
//phraseSansNom.add("");
//phraseSansNom.add("");
//phraseSansNom.add("");
//phraseSansNom.add("");*/
//
//Affichage :
TextView textView1 = (TextView) findViewById(R.id.textView1);
//textView1.setText(Nbaleatoirelist(phraseSansNom));
//}
public int Gorgeesaleatoire(int Min, int Max){
int offset = ajoutGorgees;
int nbgorgées;
Random rand = new Random();
if (Min == 1 && Max == 2){
nbgorgées = rand.nextInt(Max + Min);
}else {
nbgorgées = Min+rand.nextInt(Max - Min);
}
if(nbgorgées == 0){
nbgorgées = 1;
}
nbgorgées = nbgorgées + offset;
return nbgorgées;
}
public String GorgeesaleatoireAmeliorer(int Min, int Max){
int offset = ajoutGorgees;
int nbgorgées;
Random rand = new Random();
if (Min == 1 && Max == 2){
nbgorgées = rand.nextInt(Max + Min);
}else {
nbgorgées = Min+rand.nextInt(Max - Min);
}
if(nbgorgées == 0){
nbgorgées = 1;
}
nbgorgées = nbgorgées + offset;
String debut;
String nbgorgéesstr;
String nbgorgéesstr1;
debut = " ";
nbgorgéesstr1 = " Gorgée(s)";
nbgorgéesstr = debut + Integer.toString(nbgorgées) + nbgorgéesstr1;
return nbgorgéesstr;
}
public String Nbaleatoirelist(List list){
Random rand = new Random();
String phrase = (String) list.get(rand.nextInt(list.size()));
return phrase;
}
public int Nbaleatoire(){
int Max = 100;
int Min = 0;
Random rand = new Random();
int nbaleatoire = rand.nextInt(Max - Min);
return nbaleatoire;
}
public boolean JoueurOuPas(){
boolean TrueFalse;
int nbaleatoire = Nbaleatoire();
int pourcentage = 40;
//System.out.println(nbaleatoire);
if(nbaleatoire >= pourcentage){
TrueFalse = false;}
else{
TrueFalse = true;
}
//System.out.println(TrueFalse);
return TrueFalse;
}
public List TroisJoueurAleatoire(List toutlesjoueurs){
List<String> listJoueur = new ArrayList<String>();
while (true){
Random rand = new Random();
String joueur1 = (String) toutlesjoueurs.get(rand.nextInt(toutlesjoueurs.size()));
String joueur2 = (String) toutlesjoueurs.get(rand.nextInt(toutlesjoueurs.size()));
String joueur3 = (String) toutlesjoueurs.get(rand.nextInt(toutlesjoueurs.size()));
if(joueur1 == joueur2 ){
}else{
if (joueur1 == joueur3){
}else {
if (joueur2 == joueur3) {
}else{
listJoueur.add(joueur1);
listJoueur.add(joueur2);
listJoueur.add(joueur3);
return listJoueur;
}
}
}
}
}
public String ChoixJoueurAleatoire( List toutlesjoueurs){
//System.out.println(inttoutlesjoueurs);
Random rand = new Random();
String joueur = (String) toutlesjoueurs.get(rand.nextInt(toutlesjoueurs.size()));
//System.out.println(joueur);
//int nbaleatoire = rand.nextInt(max -min + 1 ) + min;
//int nbaleatoire2 = nbaleatoire - 1;
//if(nbaleatoire2 == -1 ){
// nbaleatoire2 = 0;
//}
//System.out.println( "nb aleatoire " + nbaleatoire) ;
//joueur = (String) toutlesjoueurs.get(nbaleatoire2);
//System.out.println(joueur);
return joueur ;
}
public void OnClickButton1(View v){
finish();
startActivity(getIntent());
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
// Votre code pour gérer les modifications d'orientation ici
}
}
@@ -0,0 +1,298 @@
package com.example.boidelov3;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputType;
import android.text.TextWatcher;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.material.textfield.TextInputEditText;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
String J1S, J2S, J3S;
private int offset;
private List<String> toutlesjoueurs;
private TextInputEditText J1;
private TextInputEditText J2;
private TextInputEditText J3;
private List<TextInputEditText> editTextList = new ArrayList<>();
private List<View> playerRowList = new ArrayList<>(); // Liste des lignes de joueurs pour suppression
private TextView playerCountText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Récupérer le TextView du compteur
playerCountText = findViewById(R.id.playerCountText);
// Initialiser les 3 champs statiques et ajouter les listeners
J1 = findViewById(R.id.J1);
J2 = findViewById(R.id.J2);
J3 = findViewById(R.id.J3);
// Ajouter un TextWatcher à chaque champ pour mettre à jour le compteur
TextWatcher playerCountWatcher = new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
updatePlayerCount();
}
@Override
public void afterTextChanged(Editable s) {}
};
if (J1 != null) J1.addTextChangedListener(playerCountWatcher);
if (J2 != null) J2.addTextChangedListener(playerCountWatcher);
if (J3 != null) J3.addTextChangedListener(playerCountWatcher);
// Mise à jour initiale
updatePlayerCount();
}
/**
* Met à jour le compteur de joueurs en temps réel
*/
private void updatePlayerCount() {
int count = 0;
if (J1 != null && J1.getText() != null && !J1.getText().toString().isEmpty()) count++;
if (J2 != null && J2.getText() != null && !J2.getText().toString().isEmpty()) count++;
if (J3 != null && J3.getText() != null && !J3.getText().toString().isEmpty()) count++;
// Compter les champs dynamiques
for (TextInputEditText edit : editTextList) {
if (edit != null && edit.getText() != null && !edit.getText().toString().isEmpty()) {
count++;
}
}
if (playerCountText != null) {
playerCountText.setText("Joueurs: " + count + " / min. 3");
}
}
public void onClickButton1(View view) {
LinearLayout nameEntryLayout = findViewById(R.id.nameEntryLayout);
// Créer un conteneur pour la ligne de joueur (EditText + Bouton supprimer)
FrameLayout playerRow = new FrameLayout(this);
LinearLayout.LayoutParams rowParams = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
);
rowParams.setMargins(0, 8, 0, 8);
playerRow.setLayoutParams(rowParams);
// Créer un nouveau TextInputLayout
com.google.android.material.textfield.TextInputLayout textInputLayout = new com.google.android.material.textfield.TextInputLayout(this);
FrameLayout.LayoutParams textInputParams = new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
);
textInputParams.setMargins(0, 0, 60, 0); // Laisser de la place pour le bouton supprimer
textInputLayout.setLayoutParams(textInputParams);
textInputLayout.setBoxBackgroundMode(com.google.android.material.textfield.TextInputLayout.BOX_BACKGROUND_OUTLINE);
textInputLayout.setHint("Nom");
// Appliquer les couleurs du thème pour la cohérence
int primaryColor = androidx.core.content.ContextCompat.getColor(this, R.color.primary);
int hintColor = androidx.core.content.ContextCompat.getColor(this, R.color.text_hint);
textInputLayout.setBoxStrokeColor(primaryColor);
textInputLayout.setDefaultHintTextColor(androidx.core.content.ContextCompat.getColorStateList(this, R.color.text_hint));
// Créer un nouveau TextInputEditText
TextInputEditText newEditText = new TextInputEditText(this);
newEditText.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
newEditText.setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS);
newEditText.setMaxLines(1);
newEditText.setTextSize(16);
newEditText.setTextColor(androidx.core.content.ContextCompat.getColor(this, R.color.text_primary));
newEditText.setHintTextColor(androidx.core.content.ContextCompat.getColor(this, R.color.text_hint));
// Ajouter un TextWatcher pour mettre à jour le compteur en temps réel
newEditText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
updatePlayerCount();
}
@Override
public void afterTextChanged(Editable s) {}
});
// Ajouter l'EditText au TextInputLayout
textInputLayout.addView(newEditText);
// Créer le bouton de suppression
ImageButton deleteButton = new ImageButton(this);
FrameLayout.LayoutParams buttonParams = new FrameLayout.LayoutParams(
(int) (48 * getResources().getDisplayMetrics().density),
(int) (48 * getResources().getDisplayMetrics().density)
);
buttonParams.setMargins(0, 4, 8, 4);
buttonParams.gravity = android.view.Gravity.END | android.view.Gravity.CENTER_VERTICAL;
deleteButton.setLayoutParams(buttonParams);
deleteButton.setBackgroundResource(android.R.drawable.ic_menu_delete);
int errorColor = androidx.core.content.ContextCompat.getColor(this, R.color.error);
deleteButton.setColorFilter(errorColor);
deleteButton.setScaleType(ImageButton.ScaleType.CENTER_INSIDE);
deleteButton.setContentDescription("Supprimer ce joueur");
// Configuration du bouton de suppression avec animation
deleteButton.setOnClickListener(v -> removePlayerRow(playerRow, newEditText));
// Ajouter les éléments au conteneur
playerRow.addView(textInputLayout);
playerRow.addView(deleteButton);
// Ajouter à la liste et au layout avec animation
editTextList.add(newEditText);
playerRowList.add(playerRow);
nameEntryLayout.addView(playerRow);
// Animation d'apparition
BoideloAnimationUtils.popIn(playerRow, 300);
BoideloAnimationUtils.triggerHapticFeedback(this);
}
/**
* Supprime une ligne de joueur avec animation
*/
private void removePlayerRow(View playerRow, TextInputEditText editText) {
BoideloAnimationUtils.triggerHapticFeedback(this);
// Animation de suppression
BoideloAnimationUtils.slideOutToRemove(playerRow, 300, () -> {
// Retirer de la liste et du layout après l'animation
editTextList.remove(editText);
playerRowList.remove(playerRow);
ViewGroup parent = (ViewGroup) playerRow.getParent();
if (parent != null) {
parent.removeView(playerRow);
}
// Mettre à jour le compteur après suppression
updatePlayerCount();
});
}
public void onClickButtonStart(View view) {
// Récupérer les 3 premiers champs de saisie
J1 = findViewById(R.id.J1);
if (J1 != null && J1.getText() != null) {
J1S = J1.getText().toString();
} else {
J1S = "";
}
J2 = findViewById(R.id.J2);
if (J2 != null && J2.getText() != null) {
J2S = J2.getText().toString();
} else {
J2S = "";
}
J3 = findViewById(R.id.J3);
if (J3 != null && J3.getText() != null) {
J3S = J3.getText().toString();
} else {
J3S = "";
}
// Creation d'une liste avec tt les j et verif si elle est completé
toutlesjoueurs = new ArrayList<>();
if (!J1S.isEmpty()) {
toutlesjoueurs.add(J1S);
}
if (!J2S.isEmpty()) {
toutlesjoueurs.add(J2S);
}
if (!J3S.isEmpty()) {
toutlesjoueurs.add(J3S);
}
// Ajouter les champs dynamiques
int nbnom = editTextList.size();
for (int i = 0; i < nbnom; i++) {
TextInputEditText editText = editTextList.get(i);
if (editText != null && editText.getText() != null) {
String nom = editText.getText().toString();
if (!nom.isEmpty()) {
toutlesjoueurs.add(nom);
}
}
}
openParametres();
}
public void openParametres(){
//enregistrement des joueurs dans les shared preferences Joueurs
SharedPreferences sharedPreferences = getSharedPreferences("Joueurs", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString("J1", J1S != null ? J1S : "");
editor.putString("J2", J2S != null ? J2S : "");
editor.putString("J3", J3S != null ? J3S : "");
for (int i = 0; i < editTextList.size(); i++) {
TextInputEditText editText = editTextList.get(i);
if (editText != null && editText.getText() != null) {
String nom = editText.getText().toString();
editor.putString("J" + (i + 4), nom);
}
}
editor.apply();
//Lancement de l'activité (Jeux_parametres)
Intent intent = new Intent(this, JeuxParametres.class);
//Regarde si le pseudo est vide et envoie a l'activité jeux
if (toutlesjoueurs.isEmpty()){
Context context = getApplicationContext();
CharSequence text = "Merci de rentrer des joueurs";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
}
else {
if (toutlesjoueurs.size() >= 3) {
intent.putStringArrayListExtra("EXTRA_LIST_JOUEUR", (ArrayList<String>) toutlesjoueurs);
intent.putExtra("EXTRA_OFFSET", offset);
startActivity(intent);
} else {
Context context = getApplicationContext();
CharSequence text = "La partie ne peux pas commencer avec moins de 3 joueurs";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
}
}
}
}
@@ -0,0 +1,109 @@
package com.example.boidelov3;
import java.util.List;
public class Question {
private int id;
private String question;
private int gorger;
private boolean distribution;
private List<String> variante;
private boolean recois;
private boolean manches;
private String arret; // mise à jour du type de données
private int manchesRestantes; // pour le nombre de manches restantes
private String arretMessage; // pour le message d'arrêt
private String arretMessageManche; // pour le message d'arrêt pour les manches
// Constructeur par défaut
public Question() {
}
// Getters et setters pour tous les champs
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getQuestion() {
return question;
}
public void setQuestion(String question) {
this.question = question;
}
public int getGorger() {
return gorger;
}
public void setGorger(int gorger) {
this.gorger = gorger;
}
public boolean isDistribution() {
return distribution;
}
public void setDistribution(boolean distribution) {
this.distribution = distribution;
}
public List<String> getVariante() {
return variante;
}
public void setVariante(List<String> variante) {
this.variante = variante;
}
public boolean isRecois() {
return recois;
}
public void setRecois(boolean recois) {
this.recois = recois;
}
public boolean isManches() {
return manches;
}
public void setManches(boolean manches) {
this.manches = manches;
}
public String getArret() {
return arret;
}
public void setArret(String arret) {
this.arret = arret;
}
public int getManchesRestantes() {
return manchesRestantes;
}
public void setManchesRestantes(int manchesRestantes) {
this.manchesRestantes = manchesRestantes;
}
public String getArretMessage() {
return arretMessage;
}
public void setArretMessage(String arretMessage) {
this.arretMessage = arretMessage;
}
public String getArretMessageManche() {
return arretMessageManche;
}
public void setArretMessageManche(String arretMessageManche) {
this.arretMessageManche = arretMessageManche;
}
}
@@ -0,0 +1,15 @@
package com.example.boidelov3;
import java.util.List;
public class Questions {
private String version;
private List<Question> questions;
// Getters et setters pour chaque champ
public List<Question> getQuestions() {
return questions;
}
// autres getters et setters...
}
@@ -0,0 +1,123 @@
package com.example.boidelov3;
import android.content.Context;
import android.media.AudioAttributes;
import android.media.SoundPool;
/**
* Gestionnaire des effets sonores de l'application
*/
public class SoundManager {
private static SoundManager instance;
private SoundPool soundPool;
private boolean soundEnabled = true;
// IDs des sons
private int soundClick;
private int soundSuccess;
private int soundError;
private int soundNext;
private int soundManche;
/**
* Obtient l'instance unique du SoundManager
*/
public static synchronized SoundManager getInstance(Context context) {
if (instance == null) {
instance = new SoundManager(context);
}
return instance;
}
/**
* Constructeur privé
*/
private SoundManager(Context context) {
AudioAttributes audioAttributes = new AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_GAME)
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.build();
soundPool = new SoundPool.Builder()
.setMaxStreams(5)
.setAudioAttributes(audioAttributes)
.build();
// Charger les sons (pour l'instant, on utilise des sons système)
// TODO: Ajouter des fichiers audio personnalisés dans res/raw/
// soundClick = soundPool.load(context, R.raw.click, 1);
// soundSuccess = soundPool.load(context, R.raw.success, 1);
// etc.
}
/**
* Joue le son de clic
*/
public void playClick() {
if (soundEnabled && soundPool != null) {
// Son de clic par défaut
// Pour l'instant, feedback haptique uniquement
}
}
/**
* Joue le son de succès
*/
public void playSuccess() {
if (soundEnabled && soundPool != null) {
// Son de succès par défaut
}
}
/**
* Joue le son d'erreur
*/
public void playError() {
if (soundEnabled && soundPool != null) {
// Son d'erreur par défaut
}
}
/**
* Joue le son de transition (question suivante)
*/
public void playNext() {
if (soundEnabled && soundPool != null) {
// Son de transition par défaut
}
}
/**
* Joue le son de manche
*/
public void playManche() {
if (soundEnabled && soundPool != null) {
// Son de manche par défaut
}
}
/**
* Active ou désactive les sons
*/
public void setSoundEnabled(boolean enabled) {
this.soundEnabled = enabled;
}
/**
* Retourne l'état des sons
*/
public boolean isSoundEnabled() {
return soundEnabled;
}
/**
* Libère les ressources
*/
public void release() {
if (soundPool != null) {
soundPool.release();
soundPool = null;
}
instance = null;
}
}
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:fromXScale="1.0"
android:toXScale="0.95"
android:fromYScale="1.0"
android:toYScale="0.95"
android:pivotX="50%"
android:pivotY="50%"
android:duration="100"
android:interpolator="@android:anim/decelerate_interpolator" />
</set>
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:fromXScale="0.95"
android:toXScale="1.0"
android:fromYScale="0.95"
android:toYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:duration="100"
android:interpolator="@android:anim/accelerate_interpolator" />
</set>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<objectAnimator
android:propertyName="backgroundColor"
android:valueFrom="#00000000"
android:valueTo="#FFFF0000"
android:duration="1000" />
</set>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:duration="300"
android:interpolator="@android:anim/decelerate_interpolator" />
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:fromAlpha="1.0"
android:toAlpha="0.0"
android:duration="300"
android:interpolator="@android:anim/accelerate_interpolator" />
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromYDelta="0%"
android:toYDelta="100%"
android:duration="400"
android:interpolator="@android:anim/accelerate_interpolator" />
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.0"
android:duration="300"
android:interpolator="@android:anim/decelerate_interpolator" />
</set>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="-100%"
android:toXDelta="0%"
android:duration="300"
android:interpolator="@android:anim/decelerate_interpolator" />
<alpha
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:duration="200"
android:interpolator="@android:anim/accelerate_interpolator" />
</set>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="100%"
android:toXDelta="0%"
android:duration="300"
android:interpolator="@android:anim/decelerate_interpolator" />
<alpha
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:duration="200"
android:interpolator="@android:anim/accelerate_interpolator" />
</set>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="0%"
android:toXDelta="-100%"
android:duration="300"
android:interpolator="@android:anim/accelerate_interpolator" />
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.0"
android:duration="200"
android:interpolator="@android:anim/decelerate_interpolator" />
</set>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="0%"
android:toXDelta="100%"
android:duration="300"
android:interpolator="@android:anim/accelerate_interpolator" />
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.0"
android:duration="200"
android:interpolator="@android:anim/decelerate_interpolator" />
</set>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromYDelta="100%"
android:toYDelta="0%"
android:duration="400"
android:interpolator="@android:anim/decelerate_interpolator" />
<alpha
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:duration="300"
android:interpolator="@android:anim/accelerate_interpolator" />
</set>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/primary"/>
<corners android:radius="12dp"/>
</shape>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/accent"/>
<corners android:radius="12dp"/>
</shape>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white"/>
<corners android:radius="16dp"/>
<stroke
android:width="1dp"
android:color="@color/surface_variant"/>
<padding
android:left="16dp"
android:top="16dp"
android:right="16dp"
android:bottom="16dp"/>
</shape>
@@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
@@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@color/text_secondary"
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM12.5,7H11v6l5.25,3.15 0.75,-1.23 -4.5,-2.67z"/>
</vector>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@color/text_secondary"
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@color/text_secondary"
android:pathData="M16,11c1.66,0 2.99,-1.34 2.99,-3S17.66,5 16,5c-1.66,0 -3,1.34 -3,3s1.34,3 3,3zM8,11c1.66,0 2.99,-1.34 2.99,-3S9.66,5 8,5C6.34,5 5,6.34 5,8s1.34,3 3,3zM12,11c1.66,0 2.99,-1.34 2.99,-3S13.66,5 12,5c-1.66,0 -3,1.34 -3,3s1.34,3 3,3zM6,13c-2.33,0 -7,1.17 -7,3.5V19h14v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5zM18,13c-0.29,0 -0.62,0.02 -0.97,0.05 1.16,0.84 1.97,1.97 1.97,3.45V19h6v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5z"/>
</vector>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@color/text_secondary"
android:pathData="M16,11c1.66,0 2.99,-1.34 2.99,-3S17.66,5 16,5c-1.66,0 -3,1.34 -3,3s1.34,3 3,3zM8,11c1.66,0 2.99,-1.34 2.99,-3S9.66,5 8,5C6.34,5 5,6.34 5,8s1.34,3 3,3zM8,13c-2.33,0 -7,1.17 -7,3.5V19h14v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5zM16,13c-0.29,0 -0.62,0.02 -0.97,0.05 1.16,0.84 1.97,1.97 1.97,3.45V19h6v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5z"/>
</vector>
@@ -0,0 +1,299 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:background="@color/surface"
android:fitsSystemWindows="true"
tools:context=".EndGameActivity">
<!-- Background Gradient -->
<View
android:id="@+id/topBackground"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/primary"
app:layout_constraintBottom_toBottomOf="@id/guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.4" />
<!-- Main Content -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center"
android:orientation="vertical"
android:padding="24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<!-- Trophy Icon -->
<ImageView
android:id="@+id/trophyIcon"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginBottom="24dp"
android:contentDescription="Trophée"
android:src="@android:drawable/ic_menu_agenda"
app:tint="@color/accent" />
<!-- Title -->
<TextView
android:id="@+id/titleText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="Partie Terminée !"
android:textColor="@color/white"
android:textSize="32sp"
android:textStyle="bold" />
<!-- Subtitle -->
<TextView
android:id="@+id/subtitleText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="32dp"
android:text="Bien joué à tous !"
android:textColor="@color/white"
android:textSize="18sp" />
<!-- Stats Card -->
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="20dp"
app:cardElevation="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="24dp">
<!-- Questions Played -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginEnd="12dp"
android:src="@android:drawable/ic_menu_edit"
app:tint="@color/primary" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Questions jouées"
android:textColor="@color/text_secondary"
android:textSize="14sp" />
<TextView
android:id="@+id/questionsPlayedValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="50"
android:textColor="@color/text_primary"
android:textSize="24sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<!-- Divider -->
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="16dp"
android:background="@color/surface_variant" />
<!-- Players Count -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginEnd="12dp"
android:src="@drawable/ic_player_three"
app:tint="@color/accent" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Joueurs"
android:textColor="@color/text_secondary"
android:textSize="14sp" />
<TextView
android:id="@+id/playersCountValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5"
android:textColor="@color/text_primary"
android:textSize="24sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<!-- Divider -->
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="16dp"
android:background="@color/surface_variant" />
<!-- Total Gorgees -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginEnd="12dp"
android:src="@android:drawable/ic_menu_recent_history"
app:tint="@color/warning" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Gorgées totales"
android:textColor="@color/text_secondary"
android:textSize="14sp" />
<TextView
android:id="@+id/gorgeesTotalValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="--"
android:textColor="@color/text_primary"
android:textSize="24sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<!-- Players List -->
<com.google.android.material.card.MaterialCardView
android:id="@+id/playersCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="16dp"
app:cardElevation="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:text="Participants"
android:textColor="@color/text_secondary"
android:textSize="14sp"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/playersRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<!-- Buttons -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<!-- Home Button -->
<com.google.android.material.button.MaterialButton
android:id="@+id/homeButton"
style="@style/BoideloButton"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:text="Accueil"
app:backgroundTint="@color/surface_variant"
app:cornerRadius="28dp"
app:icon="@android:drawable/ic_menu_revert"
app:iconGravity="textStart" />
<!-- Replay Button -->
<com.google.android.material.button.MaterialButton
android:id="@+id/replayButton"
style="@style/BoideloButton.Primary"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:text="Rejouer"
app:cornerRadius="28dp"
app:icon="@android:drawable/ic_media_play"
app:iconGravity="textEnd" />
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
+186
View File
@@ -0,0 +1,186 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:background="@color/game_background"
android:fitsSystemWindows="true"
tools:context=".Jeux">
<!-- Progress Bar -->
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="8dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:max="100"
android:progress="0"
android:progressTint="@color/accent"
android:progressBackgroundTint="@color/surface_variant"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!-- Progress Text -->
<TextView
android:id="@+id/progressText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Question 1 / 50"
android:textColor="@color/text_secondary"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/progressBar" />
<!-- Question Type Indicator -->
<LinearLayout
android:id="@+id/questionIndicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/progressText">
<ImageView
android:id="@+id/indicatorIcon"
android:layout_width="32dp"
android:layout_height="32dp"
android:src="@drawable/ic_player_one"
app:tint="@color/text_secondary" />
<TextView
android:id="@+id/indicatorText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="1 joueur"
android:textColor="@color/text_secondary"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
<!-- Main Question Container -->
<com.google.android.material.card.MaterialCardView
android:id="@+id/questionCard"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="24dp"
android:layout_marginBottom="24dp"
app:cardBackgroundColor="@color/card_background"
app:cardCornerRadius="20dp"
app:cardElevation="8dp"
app:layout_constraintBottom_toTopOf="@id/buttonContainer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/questionIndicator">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:padding="24dp">
<!-- Manche Question Text (petit) -->
<TextView
android:id="@+id/mancheQuestionText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
android:gravity="center"
android:text="Défi en cours"
android:textColor="@color/text_secondary"
android:textSize="14sp"
android:textStyle="italic"
android:visibility="gone" />
<!-- Question Text -->
<TextView
android:id="@+id/textView1"
style="@style/BoideloQuestionText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Question"
android:textSize="26sp" />
<!-- Manche Counter (if applicable) -->
<TextView
android:id="@+id/mancheCounter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:background="@drawable/bg_card"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="16dp"
android:paddingBottom="8dp"
android:text="Manches: 5"
android:textColor="@color/primary"
android:textSize="14sp"
android:textStyle="bold"
android:visibility="gone"
tools:visibility="visible" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<!-- Button Container -->
<LinearLayout
android:id="@+id/buttonContainer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:layout_marginBottom="32dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<!-- Skip Button -->
<com.google.android.material.button.MaterialButton
android:id="@+id/skipButton"
style="@style/BoideloButton"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:onClick="onSkipClick"
android:text="Passer"
android:textColor="@color/text_secondary"
app:backgroundTint="@color/surface_variant"
app:cornerRadius="28dp" />
<!-- Next Button -->
<com.google.android.material.button.MaterialButton
android:id="@+id/button"
style="@style/BoideloButton.Primary"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginStart="8dp"
android:layout_weight="2"
android:onClick="OnClickButton1"
android:text="Suivant"
android:textSize="18sp"
app:cornerRadius="28dp"
app:icon="@android:drawable/ic_media_play"
app:iconGravity="textEnd" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,339 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:background="@color/surface"
tools:context=".JeuxParametres">
<!-- App Bar -->
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/primary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</com.google.android.material.appbar.AppBarLayout>
<!-- Main Content -->
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<!-- Title -->
<TextView
android:id="@+id/Titre"
style="@style/BoideloTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:text="@string/param_tres_du_jeu" />
<!-- Game Settings Card -->
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
app:cardBackgroundColor="@color/card_background"
app:cardCornerRadius="16dp"
app:cardElevation="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
style="@style/BoideloSubtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:text="Paramètres de partie"
app:drawableStartCompat="@android:drawable/ic_menu_edit"
app:drawableTint="@color/primary" />
<!-- Number of Questions -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:orientation="horizontal">
<TextView
android:id="@+id/textView1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Nombre de questions"
android:textColor="@color/text_primary"
android:textSize="16sp" />
<TextView
android:id="@+id/questionCountValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_card"
android:paddingStart="12dp"
android:paddingTop="4dp"
android:paddingEnd="12dp"
android:paddingBottom="4dp"
android:text="50"
android:textColor="@color/primary"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
<SeekBar
android:id="@+id/seekBar1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:progressTint="@color/accent"
android:thumbTint="@color/accent" />
</LinearLayout>
<!-- Drink Addition -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:orientation="horizontal">
<TextView
android:id="@+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Ajout de gorgées"
android:textColor="@color/text_primary"
android:textSize="16sp" />
<TextView
android:id="@+id/gorgeesValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_card"
android:paddingStart="12dp"
android:paddingTop="4dp"
android:paddingEnd="12dp"
android:paddingBottom="4dp"
android:text="0"
android:textColor="@color/accent"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
<SeekBar
android:id="@+id/seekBar2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:progressTint="@color/accent"
android:thumbTint="@color/accent" />
<!-- Palier Indicator -->
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
app:cardBackgroundColor="@color/surface_variant"
app:cardCornerRadius="8dp"
app:cardElevation="0dp">
<TextView
android:id="@+id/textView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="12dp"
android:text="Palier : Grosse merde"
android:textColor="@color/text_secondary"
android:textSize="14sp"
android:textStyle="bold" />
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<!-- OpenAI Settings Card -->
<com.google.android.material.card.MaterialCardView
android:id="@+id/openaiCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:visibility="gone"
app:cardBackgroundColor="@color/card_background"
app:cardCornerRadius="16dp"
app:cardElevation="4dp"
app:strokeColor="@color/surface_variant"
app:strokeWidth="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="8dp"
android:src="@android:drawable/ic_menu_edit"
app:tint="@color/primary" />
<TextView
android:id="@+id/textView3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/openai"
android:textColor="@color/text_primary"
android:textSize="18sp"
android:textStyle="bold" />
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/checkBoxGPT"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<!-- API Key Input -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayoutApiKey"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:enabled="false"
android:hint="@string/cl_api_openai"
app:boxBackgroundColor="@color/surface"
app:boxStrokeColor="@color/primary"
app:endIconMode="password_toggle"
app:hintTextColor="@color/text_hint"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/editTextGPT"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout>
<!-- Ratio SeekBar -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:orientation="horizontal">
<TextView
android:id="@+id/textViewRatioGen"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:enabled="false"
android:text="Ratio BDD/OPENAI : 1/8"
android:textColor="@color/text_primary"
android:textSize="14sp" />
</LinearLayout>
<SeekBar
android:id="@+id/seekBar3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:enabled="false"
android:progressTint="@color/primary_light"
android:thumbTint="@color/primary_light" />
</LinearLayout>
<!-- Test API Button -->
<com.google.android.material.button.MaterialButton
android:id="@+id/ButtonTestApi"
style="@style/BoideloButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:enabled="false"
android:onClick="onClickButtonTestAPI"
android:text="@string/test_de_connectivit_openai"
app:backgroundTint="@color/surface_variant"
app:icon="@android:drawable/ic_menu_info_details"
app:iconGravity="textStart" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<!-- Bottom Spacer -->
<View
android:layout_width="match_parent"
android:layout_height="80dp" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<!-- Floating Action Button -->
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/Go2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:onClick="onClickButtonStart"
android:text="@string/commencer_a_vous_mettre_une_mine"
android:textColor="@color/text_primary"
app:backgroundTint="@color/accent"
app:icon="@android:drawable/ic_media_play"
app:iconTint="@color/text_primary" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
+226
View File
@@ -0,0 +1,226 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:background="@color/surface"
tools:context=".MainActivity">
<!-- App Bar -->
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/primary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</com.google.android.material.appbar.AppBarLayout>
<!-- Main Content -->
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<!-- Title -->
<TextView
android:id="@+id/Titre"
style="@style/BoideloTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginBottom="16dp"
android:text="@string/bienvenue" />
<!-- Player Count Indicator -->
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
app:cardBackgroundColor="@color/primary_light"
app:cardCornerRadius="12dp"
app:cardElevation="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:padding="12dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="8dp"
android:src="@drawable/ic_player_three"
app:tint="@color/white" />
<TextView
android:id="@+id/playerCountText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Joueurs: 0 / min. 3"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<!-- Players Input Card -->
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="16dp"
app:cardElevation="4dp"
app:strokeColor="@color/surface_variant"
app:strokeWidth="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/textView2"
style="@style/BoideloCaption"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:gravity="center"
android:text="@string/laisse_vide_si_il_y_a_pas_assez_de_joueur" />
<!-- Default Player Inputs -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayoutJ1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:hint="@string/nom"
app:boxBackgroundColor="@color/surface"
app:boxStrokeColor="@color/primary"
app:boxStrokeWidth="2dp"
app:endIconMode="clear_text"
app:errorEnabled="false"
app:hintTextColor="@color/text_hint"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/J1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:maxLines="1"
android:textSize="16sp" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayoutJ2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:hint="@string/nom"
app:boxBackgroundColor="@color/surface"
app:boxStrokeColor="@color/primary"
app:boxStrokeWidth="2dp"
app:endIconMode="clear_text"
app:hintTextColor="@color/text_hint"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/J2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:maxLines="1"
android:textSize="16sp" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayoutJ3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:hint="@string/nom"
app:boxBackgroundColor="@color/surface"
app:boxStrokeColor="@color/primary"
app:boxStrokeWidth="2dp"
app:endIconMode="clear_text"
app:hintTextColor="@color/text_hint"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/J3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:maxLines="1"
android:textSize="16sp" />
</com.google.android.material.textfield.TextInputLayout>
<!-- Dynamic Player Input Container -->
<LinearLayout
android:id="@+id/nameEntryLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<!-- Add Player Button -->
<com.google.android.material.button.MaterialButton
android:id="@+id/Validation"
style="@style/BoideloButton.Secondary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:onClick="onClickButton1"
android:text="@string/c_ok"
app:icon="@android:drawable/ic_input_add"
app:iconGravity="textStart" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<!-- Bottom Spacer for FAB -->
<View
android:layout_width="match_parent"
android:layout_height="80dp" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<!-- Floating Action Button -->
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/Go"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:onClick="onClickButtonStart"
android:text="@string/go"
android:textColor="@color/text_primary"
app:backgroundTint="@color/accent"
app:icon="@android:drawable/ic_media_play"
app:iconTint="@color/text_primary" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
Binary file not shown.

After

Width:  |  Height:  |  Size: 864 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 KiB

+50
View File
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Mode SOMBRE - Amélioré pour lisibilité -->
<!-- Fond - gris moyen pour meilleur contraste -->
<color name="background">#1E1E1E</color>
<color name="surface">#2D2D2D</color>
<color name="surface_variant">#3A3A3A</color>
<color name="card_background">#2D2D2D</color>
<!-- Texte - blanc pour contraste maximal -->
<color name="text_primary">#FFFFFF</color>
<color name="text_secondary">#E0E0E0</color>
<color name="text_hint">#9E9E9E</color>
<!-- Couleur principale - violet clair sur fond sombre -->
<color name="primary">#B388FF</color>
<color name="primary_dark">#7C4DFF</color>
<color name="primary_light">#D1C4E9</color>
<!-- Couleurs de jeu - plus claires pour être visibles -->
<color name="game_normal">#2D2D2D</color>
<color name="game_background">#1E1E1E</color>
<color name="game_question_standard">#2D2D2D</color>
<color name="game_question_1player">#372E45</color>
<color name="game_question_2players">#413E5A</color>
<color name="game_question_3players">#4B4E6F</color>
<color name="game_question_manche">#2E3E5A</color>
<color name="game_manche_end">#5A4E2E</color>
<color name="game_finished">#5A3E2E</color>
<!-- États -->
<color name="success">#81C784</color>
<color name="error">#EF5350</color>
<color name="warning">#FFB74D</color>
<!-- Pour compatibilité -->
<color name="white">#FFFFFF</color>
<color name="black">#000000</color>
<color name="accent">#B388FF</color>
<color name="accent_dark">#E0E0E0</color>
<color name="primary_container">#4A3A69</color>
<color name="on_primary_container">#EDE7F6</color>
<color name="card_stroke">#404040</color>
<color name="divider">#404040</color>
<color name="text_on_game_primary">#FFFFFF</color>
<color name="text_on_colored_dark">#FFFFFF</color>
<color name="overlay_dark">#80000000</color>
<color name="overlay_light">#80FFFFFF</color>
</resources>
+14
View File
@@ -0,0 +1,14 @@
<resources>
<!-- Mode SOMBRE -->
<style name="Base.Theme.BoideloV3" parent="Theme.Material3.DayNight.NoActionBar">
<item name="android:colorBackground">@color/background</item>
<item name="android:windowBackground">@color/background</item>
<item name="android:textColorPrimary">@color/text_primary</item>
<item name="android:textColorSecondary">@color/text_secondary</item>
<item name="android:textColorHint">@color/text_hint</item>
<item name="android:statusBarColor">@color/background</item>
<item name="android:windowLightStatusBar">false</item>
<item name="colorPrimary">@color/primary</item>
<item name="colorAccent">@color/primary</item>
</style>
</resources>
+50
View File
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- REFACTORING COMPLET - Palette Simple et Contrastée -->
<!-- Mode CLAIR -->
<color name="background">#FFFFFF</color>
<color name="surface">#FFFFFF</color>
<color name="surface_variant">#F0F0F0</color>
<color name="card_background">#FFFFFF</color>
<!-- Texte - contraste maximal -->
<color name="text_primary">#000000</color>
<color name="text_secondary">#333333</color>
<color name="text_hint">#999999</color>
<!-- Couleur principale - violet visible -->
<color name="primary">#7C4DFF</color>
<color name="primary_dark">#6200EA</color>
<color name="primary_light">#B388FF</color>
<!-- Couleurs de jeu - très subtiles, lisibles -->
<color name="game_normal">#FFFFFF</color>
<color name="game_background">#FFFFFF</color>
<color name="game_question_standard">#FFFFFF</color>
<color name="game_question_1player">#F3E5F5</color>
<color name="game_question_2players">#E1BEE7</color>
<color name="game_question_3players">#CE93D8</color>
<color name="game_question_manche">#E8EAF6</color>
<color name="game_manche_end">#FFF59D</color>
<color name="game_finished">#FFCCBC</color>
<!-- États -->
<color name="success">#4CAF50</color>
<color name="error">#F44336</color>
<color name="warning">#FF9800</color>
<!-- Pour compatibilité -->
<color name="white">#FFFFFF</color>
<color name="black">#000000</color>
<color name="accent">#7C4DFF</color>
<color name="accent_dark">#333333</color>
<color name="primary_container">#EDE7F6</color>
<color name="on_primary_container">#1A0033</color>
<color name="card_stroke">#E0E0E0</color>
<color name="divider">#E0E0E0</color>
<color name="text_on_game_primary">#000000</color>
<color name="text_on_colored_dark">#FFFFFF</color>
<color name="overlay_dark">#80000000</color>
<color name="overlay_light">#80FFFFFF</color>
</resources>
+24
View File
@@ -0,0 +1,24 @@
<resources>
<string name="app_name">Boidelo</string>
<string name="j10">J10</string>
<string name="pseudo">Pseudo</string>
<string name="nom">Nom</string>
<string name="c_ki">c ki</string>
<string name="komment_il_s_appel">komment il s\'appel</string>
<string name="who">who</string>
<string name="joueur">Joueur</string>
<string name="prenom">Prenom</string>
<string name="c_ok">Ajouter une nouvelle personne</string>
<string name="laisse_vide_si_il_y_a_pas_assez_de_joueur">Pour commencer le jeu, il suffit d\'abord de rentrer le noms des joueurs</string>
<string name="joueurTITRE">Joueur :</string>
<string name="bienvenue">Bienvenue sur Boidelo </string>
<string name="eclatax_4_gorg_es">Eclatax (+4 Gorgées)</string>
<string name="habitu_s_2_gorg_es">Habitués (+2 Gorgées)</string>
<string name="go">"Suivant !"</string>
<string name="param_tres_du_jeu">Paramètres du jeu</string>
<string name="commencer_a_vous_mettre_une_mine">Commencer a vous mettre une mine !</string>
<string name="activer_les_questions_par_chatgpt">Activer les questions par ChatGPT</string>
<string name="cl_api_openai">Clé API OpenAI</string>
<string name="openai">OpenAI [En cours de développement]</string>
<string name="test_de_connectivit_openai">Test de Connectivité Openai</string>
</resources>
+164
View File
@@ -0,0 +1,164 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- ============================================================ -->
<!-- Styles des Boutons -->
<!-- ============================================================ -->
<!-- Bouton de base -->
<style name="BoideloButton" parent="Widget.Material3.Button">
<item name="android:textSize">16sp</item>
<item name="android:textStyle">bold</item>
<item name="cornerRadius">12dp</item>
<item name="android:elevation">4dp</item>
<item name="android:paddingTop">12dp</item>
<item name="android:paddingBottom">12dp</item>
<item name="android:paddingStart">24dp</item>
<item name="android:paddingEnd">24dp</item>
</style>
<!-- Bouton primaire -->
<style name="BoideloButton.Primary">
<item name="backgroundTint">@color/primary</item>
<item name="android:textColor">@color/white</item>
<item name="rippleColor">@color/primary_light</item>
</style>
<!-- Bouton secondaire -->
<style name="BoideloButton.Secondary">
<item name="backgroundTint">@color/accent</item>
<item name="android:textColor">@color/text_primary</item>
<item name="rippleColor">@color/accent_dark</item>
</style>
<!-- Bouton danger -->
<style name="BoideloButton.Danger">
<item name="backgroundTint">@color/error</item>
<item name="android:textColor">@color/white</item>
</style>
<!-- Bouton succès -->
<style name="BoideloButton.Success">
<item name="backgroundTint">@color/success</item>
<item name="android:textColor">@color/white</item>
</style>
<!-- ============================================================ -->
<!-- Styles des TextViews -->
<!-- ============================================================ -->
<!-- Titre principal -->
<style name="BoideloTitle">
<item name="android:textSize">28sp</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@color/text_primary</item>
<item name="android:gravity">center</item>
</style>
<!-- Sous-titre -->
<style name="BoideloSubtitle">
<item name="android:textSize">20sp</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@color/text_secondary</item>
</style>
<!-- Texte de question -->
<style name="BoideloQuestionText">
<item name="android:textSize">24sp</item>
<item name="android:textColor">@color/text_primary</item>
<item name="android:lineSpacingExtra">4dp</item>
<item name="android:gravity">center</item>
<item name="android:textAlignment">center</item>
</style>
<!-- Texte de corps -->
<style name="BoideloBody">
<item name="android:textSize">16sp</item>
<item name="android:textColor">@color/text_primary</item>
</style>
<!-- Texte de caption -->
<style name="BoideloCaption">
<item name="android:textSize">14sp</item>
<item name="android:textColor">@color/text_secondary</item>
</style>
<!-- ============================================================ -->
<!-- Styles des EditText -->
<!-- ============================================================ -->
<style name="BoideloEditText" parent="Widget.Material3.TextInputLayout.OutlinedBox">
<item name="boxStrokeColor">@color/primary</item>
<item name="hintTextColor">@color/text_hint</item>
<item name="android:textColor">@color/text_primary</item>
<item name="boxStrokeWidth">2dp</item>
</style>
<!-- ============================================================ -->
<!-- Styles des Cards -->
<!-- ============================================================ -->
<style name="BoideloCard" parent="Widget.Material3.CardView.Elevated">
<item name="cardBackgroundColor">@color/white</item>
<item name="cardCornerRadius">16dp</item>
<item name="cardElevation">4dp</item>
<item name="contentPadding">16dp</item>
</style>
<style name="BoideloCard.Outlined">
<item name="cardBackgroundColor">@color/white</item>
<item name="cardCornerRadius">16dp</item>
<item name="cardElevation">0dp</item>
<item name="strokeColor">@color/surface_variant</item>
<item name="strokeWidth">1dp</item>
</style>
<!-- ============================================================ -->
<!-- Styles des SeekBars -->
<!-- ============================================================ -->
<style name="BoideloSeekBar" parent="Widget.AppCompat.SeekBar">
<item name="colorAccent">@color/accent</item>
<item name="android:progressTint">@color/accent</item>
<item name="android:progressBackgroundTint">@color/surface_variant</item>
</style>
<!-- ============================================================ -->
<!-- Styles des ProgressBars -->
<!-- ============================================================ -->
<style name="BoideloProgressBar" parent="Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:progressTint">@color/accent</item>
<item name="android:progressBackgroundTint">@color/surface_variant</item>
</style>
<!-- ============================================================ -->
<!-- Styles des Toolbars -->
<!-- ============================================================ -->
<style name="BoideloToolbar" parent="Widget.Material3.Toolbar">
<item name="android:background">@color/primary</item>
<item name="titleTextColor">@color/white</item>
<item name="android:elevation">4dp</item>
</style>
<!-- ============================================================ -->
<!-- Styles pour les Chips/Badges -->
<!-- ============================================================ -->
<style name="BoideloChip" parent="Widget.Material3.Chip.Suggestion">
<item name="chipBackgroundColor">@color/accent</item>
<item name="chipStrokeColor">@color/accent_dark</item>
<item name="android:textColor">@color/text_primary</item>
</style>
<!-- ============================================================ -->
<!-- Styles pour les indicateurs de type de question -->
<!-- ============================================================ -->
<style name="QuestionIndicator">
<item name="android:layout_width">48dp</item>
<item name="android:layout_height">48dp</item>
<item name="android:layout_gravity">center</item>
<item name="android:scaleType">centerInside</item>
</style>
</resources>
+21
View File
@@ -0,0 +1,21 @@
<resources>
<!-- Mode CLAIR -->
<style name="Base.Theme.BoideloV3" parent="Theme.Material3.DayNight.NoActionBar">
<item name="android:colorBackground">@color/background</item>
<item name="android:windowBackground">@color/background</item>
<item name="android:textColorPrimary">@color/text_primary</item>
<item name="android:textColorSecondary">@color/text_secondary</item>
<item name="android:textColorHint">@color/text_hint</item>
<item name="android:statusBarColor">@color/background</item>
<item name="android:windowLightStatusBar">true</item>
<item name="colorPrimary">@color/primary</item>
<item name="colorAccent">@color/primary</item>
</style>
<style name="Theme.BoideloV3" parent="Base.Theme.BoideloV3" />
<style name="WindowAnimationTransition">
<item name="android:windowEnterAnimation">@anim/slide_in_right</item>
<item name="android:windowExitAnimation">@anim/slide_out_left</item>
</style>
</resources>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See https://developer.android.com/guide/topics/data/autobackup
for details.
Note: This file is ignored for devices older that API 31
See https://developer.android.com/about/versions/12/backup-restore
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="device.xml"/>
-->
</full-backup-content>
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<selector>
<item android:duration="1000">
<shape>
<gradient
android:startColor="#00000000"
android:endColor="#FFFF0000"
android:type="linear" />
</shape>
</item>
</selector>
</PreferenceScreen>
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>
+5
View File
@@ -0,0 +1,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.12.0' apply false
}
+21
View File
@@ -0,0 +1,21 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
Binary file not shown.
+6
View File
@@ -0,0 +1,6 @@
#Wed Dec 31 00:34:52 CET 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+185
View File
@@ -0,0 +1,185 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"
Vendored
+89
View File
@@ -0,0 +1,89 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
+17
View File
@@ -0,0 +1,17 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "BoideloV3"
include ':app'