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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,31 +14,7 @@
|
||||
android:gravity="center"
|
||||
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
|
||||
android:layout_width="match_parent"
|
||||
|
||||
Reference in New Issue
Block a user