MAj menu option
This commit is contained in:
@@ -13,9 +13,7 @@ public class OptionsActivity extends Activity
|
||||
implements CompoundButton.OnCheckedChangeListener, View.OnClickListener {
|
||||
|
||||
private SharedPreferences prefs;
|
||||
private CheckBox checkDaltonien;
|
||||
private CheckBox checkHard;
|
||||
|
||||
private Button btnRetour;
|
||||
|
||||
|
||||
@@ -26,23 +24,20 @@ public class OptionsActivity extends Activity
|
||||
|
||||
prefs = getSharedPreferences("chuzzle_prefs", MODE_PRIVATE);
|
||||
|
||||
checkDaltonien = findViewById(R.id.checkDaltonien);
|
||||
|
||||
checkHard = findViewById(R.id.checkHard);
|
||||
btnRetour = findViewById(R.id.btnBack);
|
||||
|
||||
checkDaltonien.setChecked(prefs.getBoolean("daltonien", false));
|
||||
checkHard.setChecked(prefs.getBoolean("hard_mode", false));
|
||||
|
||||
checkDaltonien.setOnCheckedChangeListener(this);
|
||||
|
||||
checkHard.setOnCheckedChangeListener(this);
|
||||
btnRetour.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton bouton, boolean estCoche) {
|
||||
if (bouton == checkDaltonien) {
|
||||
prefs.edit().putBoolean("daltonien", estCoche).apply();
|
||||
} else if (bouton == checkHard) {
|
||||
if (bouton == checkHard) {
|
||||
prefs.edit().putBoolean("hard_mode", estCoche).apply();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user