feat: Ajout du jeu Papelito, améliorations UX et corrections de bugs

Nouveau jeu:
- Ajout du jeu Papelito (Undercover) avec flow complet
- Configuration des joueurs, temps de discussion, votes
- Système d'élimination et gestion des égalités
- Interface Material Design avec cartes et dialogues

Corrections de bugs critiques:
- Fix crash Papelito au lancement (MaterialSwitch vs Switch)
- Fix crash lors des votes nuls (égalité entre joueurs)
- Fix crash fin de partie lors du retour (navigation vers hub)
- Fix visibilité texte questions (couleur dynamique)
- Fix compteur tours défis invisible (blanc sur blanc)
- Fix icone question manquante pendant défis

Améliorations UX Boidelo Classic:
- Harmonisation des couleurs dynamiques (toolbar, bouton)
- Bouton de réglages maintenant visible (MaterialButton)
- Conteneur IA se rétracte quand désactivé
- Meilleure gestion des couleurs selon catégorie
- Fix délai entre manches pour affichage message fin

Améliorations techniques:
- Mise à jour CLAUDE.md avec architecture Papelito
- Amélioration tests unitaires (GameEngine, PlayerStats, QuestionCategory)
- Standardisation des clés Intent entre activités
- Nettoyage code mort (méthodes non utilisées)

Tests:
- 302 tests unitaires passants
- Couverture GameEngine, PlayerStats, QuestionCategory
- Tests Papelito (game logic, player management)
- Tests Game89 (challenges, players)

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
feldenr
2026-01-16 12:05:29 +01:00
parent 1b3d67526d
commit c803469643
42 changed files with 6551 additions and 203 deletions
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<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"
@@ -12,18 +11,7 @@
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/primary"
app:navigationIcon="@android:drawable/ic_menu_revert"
app:title="@string/parameters"
app:titleTextColor="@color/text_on_primary" />
</com.google.android.material.appbar.AppBarLayout>
android:theme="@style/ThemeOverlay.AppCompat.Dark"/>
<!-- Main Content -->
<androidx.core.widget.NestedScrollView
@@ -39,12 +27,13 @@
<!-- 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_marginTop="16dp"
android:layout_marginBottom="16dp"
android:text="@string/game_settings" />
android:text="@string/param_tres_du_jeu" />
<!-- Game Settings Card -->
<com.google.android.material.card.MaterialCardView
@@ -56,117 +45,351 @@
app:cardElevation="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<!-- Number of Questions -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/number_of_questions"
android:textColor="@color/text_primary"
android:textSize="16sp"
android:textStyle="bold" />
style="@style/BoideloSubtitle"
android:layout_width="wrap_content"
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"/>
<SeekBar
android:id="@+id/questionsSeekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:max="50"
android:min="10"
android:progress="20" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:orientation="vertical">
<TextView
android:id="@+id/questionsCountText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:gravity="center"
android:textColor="@color/accent"
android:textSize="14sp"
android:textStyle="bold"
tools:text="20 questions" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:orientation="horizontal">
<!-- Number of Gorgées -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/number_of_gorgees"
android:textColor="@color/text_primary"
android:textSize="16sp"
android:textStyle="bold" />
<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"/>
<SeekBar
android:id="@+id/gorgeesSeekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:max="5"
android:min="1"
android:progress="1" />
<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"/>
<TextView
android:id="@+id/gorgeesCountText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:gravity="center"
android:textColor="@color/accent"
android:textSize="14sp"
android:textStyle="bold"
tools:text="+1 gorgée" />
</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>
<!-- Duration of Challenges -->
<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/textViewDuration"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Durée des défis"
android:textColor="@color/text_primary"
android:textSize="16sp"/>
<TextView
android:id="@+id/durationValue"
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/primary"
android:textSize="14sp"
android:textStyle="bold"/>
</LinearLayout>
<SeekBar
android:id="@+id/seekBarDuration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:progressTint="@color/accent"
android:thumbTint="@color/accent"/>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<!-- AI Settings Card -->
<!-- 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"
app:cardBackgroundColor="@color/card_background"
app:cardCornerRadius="16dp"
app:cardElevation="4dp">
app:cardElevation="4dp"
app:strokeColor="@color/surface_variant"
app:strokeWidth="1dp">
<LinearLayout
android:id="@+id/openaiCardContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/artificial_intelligence"
android:textColor="@color/text_primary"
android:textSize="16sp"
android:textStyle="bold" />
android:layout_marginBottom="16dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/aiSwitch"
<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>
<!-- Provider Selection -->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayoutProvider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/enable_ai_questions"
android:textColor="@color/text_hint"
android:textSize="14sp" />
android:layout_marginBottom="16dp"
android:enabled="false"
android:hint="Fournisseur IA"
app:boxBackgroundColor="@color/surface"
app:boxStrokeColor="@color/primary"
app:hintTextColor="@color/text_hint"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox.ExposedDropdownMenu">
<AutoCompleteTextView
android:id="@+id/autoCompleteProvider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="none"
android:text="OpenAI" />
</com.google.android.material.textfield.TextInputLayout>
<!-- 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:hint="Clé API"
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/accent"
android:thumbTint="@color/accent" />
</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>
<!-- Save Button -->
<!-- Start Game Button -->
<com.google.android.material.button.MaterialButton
android:id="@+id/saveButton"
style="@style/BoideloButton.Primary"
android:id="@+id/Go2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/save" />
android:layout_height="64dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="32dp"
android:onClick="onClickButtonStart"
android:text="@string/commencer_a_vous_mettre_une_mine"
android:textColor="@color/text_on_primary"
android:textSize="18sp"
android:textStyle="bold"
app:backgroundTint="@color/primary"
app:cornerRadius="16dp"
app:icon="@android:drawable/ic_media_play"
app:iconTint="@color/text_on_primary"
app:iconGravity="textStart"
android:elevation="8dp" />
</LinearLayout>