Manque juste le truc pour les golmons de daltoniens (genre moi)
This commit is contained in:
6
Flow_Free/.idea/AndroidProjectSystem.xml
generated
Normal file
6
Flow_Free/.idea/AndroidProjectSystem.xml
generated
Normal 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>
|
||||||
2
Flow_Free/.idea/compiler.xml
generated
2
Flow_Free/.idea/compiler.xml
generated
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="CompilerConfiguration">
|
<component name="CompilerConfiguration">
|
||||||
<bytecodeTargetLevel target="17" />
|
<bytecodeTargetLevel target="21" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
2
Flow_Free/.idea/gradle.xml
generated
2
Flow_Free/.idea/gradle.xml
generated
@@ -4,6 +4,7 @@
|
|||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
|
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
@@ -12,7 +13,6 @@
|
|||||||
<option value="$PROJECT_DIR$/app" />
|
<option value="$PROJECT_DIR$/app" />
|
||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
<option name="resolveExternalAnnotations" value="false" />
|
|
||||||
</GradleProjectSettings>
|
</GradleProjectSettings>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
3
Flow_Free/.idea/misc.xml
generated
3
Flow_Free/.idea/misc.xml
generated
@@ -1,6 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<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" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|||||||
549
Flow_Free/.idea/other.xml
generated
549
Flow_Free/.idea/other.xml
generated
File diff suppressed because it is too large
Load Diff
17
Flow_Free/.idea/runConfigurations.xml
generated
Normal file
17
Flow_Free/.idea/runConfigurations.xml
generated
Normal 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>
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
// MainActivity.java
|
|
||||||
package com.example.flow_free;
|
package com.example.flow_free;
|
||||||
|
|
||||||
import android.app.Activity;
|
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);
|
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, puzzleList);
|
||||||
puzzleListView.setAdapter(adapter);
|
puzzleListView.setAdapter(adapter);
|
||||||
|
|
||||||
// Click sur un puzzle
|
// Utilisation de la classe listener pour les paramètres
|
||||||
puzzleListView.setOnItemClickListener((parent, view, position, id) -> {
|
settingsButton.setOnClickListener(new listener(this, SettingsActivity.class));
|
||||||
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);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Bouton paramètres
|
// Utilisation de la nouvelle classe pour la gestion des clics sur la liste des puzzles
|
||||||
settingsButton.setOnClickListener(v -> {
|
puzzleListView.setOnItemClickListener(new PuzzleClickListener(this, puzzleList));
|
||||||
Intent intent = new Intent(MainActivity.this, SettingsActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user