Manque juste le truc pour les golmons de daltoniens (genre moi)

This commit is contained in:
marvin
2025-03-30 19:54:50 +02:00
parent 2db1665e92
commit fd8e709f32
8 changed files with 66 additions and 570 deletions

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>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
<bytecodeTargetLevel target="21" />
</component>
</project>

View File

@@ -4,6 +4,7 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="CHOOSE_PER_TEST" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
@@ -12,7 +13,6 @@
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveExternalAnnotations" value="false" />
</GradleProjectSettings>
</option>
</component>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

File diff suppressed because it is too large Load Diff

17
Flow_Free/.idea/runConfigurations.xml generated Normal file
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>

View File

@@ -1,4 +1,3 @@
// MainActivity.java
package com.example.flow_free;
import android.app.Activity;
@@ -45,22 +44,10 @@ public class MainActivity extends Activity {
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, puzzleList);
puzzleListView.setAdapter(adapter);
// Click sur un puzzle
puzzleListView.setOnItemClickListener((parent, view, position, id) -> {
String selectedPuzzle = puzzleList.get(position);
if (!selectedPuzzle.endsWith(".xml")) {
Toast.makeText(this, "Puzzle invalide", Toast.LENGTH_SHORT).show();
return;
}
Intent intent = new Intent(MainActivity.this, GameActivity.class);
intent.putExtra("PUZZLE_FILE", selectedPuzzle);
startActivity(intent);
});
// Utilisation de la classe listener pour les paramètres
settingsButton.setOnClickListener(new listener(this, SettingsActivity.class));
// Bouton paramètres
settingsButton.setOnClickListener(v -> {
Intent intent = new Intent(MainActivity.this, SettingsActivity.class);
startActivity(intent);
});
// Utilisation de la nouvelle classe pour la gestion des clics sur la liste des puzzles
puzzleListView.setOnItemClickListener(new PuzzleClickListener(this, puzzleList));
}
}
}

View File

@@ -0,0 +1,34 @@
package com.example.flow_free;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Toast;
import java.util.List;
public class PuzzleClickListener implements AdapterView.OnItemClickListener {
private final Context context;
private final List<String> puzzleList;
public PuzzleClickListener(Context context, List<String> puzzleList) {
this.context = context;
this.puzzleList = puzzleList;
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String selectedPuzzle = puzzleList.get(position);
if (!selectedPuzzle.endsWith(".xml")) {
Toast.makeText(context, "Puzzle invalide", Toast.LENGTH_SHORT).show();
return;
}
Intent intent = new Intent(context, GameActivity.class);
intent.putExtra("PUZZLE_FILE", selectedPuzzle);
context.startActivity(intent);
}
}