MAj menu option

This commit is contained in:
Sehl Aylane
2026-03-23 12:12:26 +01:00
parent fa9e587a7e
commit c0d7a6d3d7
2 changed files with 3 additions and 32 deletions
@@ -13,9 +13,7 @@ public class OptionsActivity extends Activity
implements CompoundButton.OnCheckedChangeListener, View.OnClickListener { implements CompoundButton.OnCheckedChangeListener, View.OnClickListener {
private SharedPreferences prefs; private SharedPreferences prefs;
private CheckBox checkDaltonien;
private CheckBox checkHard; private CheckBox checkHard;
private Button btnRetour; private Button btnRetour;
@@ -26,23 +24,20 @@ public class OptionsActivity extends Activity
prefs = getSharedPreferences("chuzzle_prefs", MODE_PRIVATE); prefs = getSharedPreferences("chuzzle_prefs", MODE_PRIVATE);
checkDaltonien = findViewById(R.id.checkDaltonien);
checkHard = findViewById(R.id.checkHard); checkHard = findViewById(R.id.checkHard);
btnRetour = findViewById(R.id.btnBack); btnRetour = findViewById(R.id.btnBack);
checkDaltonien.setChecked(prefs.getBoolean("daltonien", false));
checkHard.setChecked(prefs.getBoolean("hard_mode", false)); checkHard.setChecked(prefs.getBoolean("hard_mode", false));
checkDaltonien.setOnCheckedChangeListener(this);
checkHard.setOnCheckedChangeListener(this); checkHard.setOnCheckedChangeListener(this);
btnRetour.setOnClickListener(this); btnRetour.setOnClickListener(this);
} }
@Override @Override
public void onCheckedChanged(CompoundButton bouton, boolean estCoche) { public void onCheckedChanged(CompoundButton bouton, boolean estCoche) {
if (bouton == checkDaltonien) { if (bouton == checkHard) {
prefs.edit().putBoolean("daltonien", estCoche).apply();
} else if (bouton == checkHard) {
prefs.edit().putBoolean("hard_mode", estCoche).apply(); prefs.edit().putBoolean("hard_mode", estCoche).apply();
} }
} }
-24
View File
@@ -14,31 +14,7 @@
android:gravity="center" android:gravity="center"
android:layout_marginBottom="64dp"/> android:layout_marginBottom="64dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginBottom="32dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Mode daltonien (symboles)"
android:textSize="18sp"/>
<CheckBox
android:id="@+id/checkDaltonien"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleX="1.5"
android:scaleY="1.5"
android:layout_marginEnd="16dp"
android:minWidth="48dp"
android:minHeight="48dp"/>
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"