Ajout activité paramètres

This commit is contained in:
Lyanis SOUIDI 2024-03-31 22:38:07 +02:00
parent 399fc2e2bd
commit d9e3dab7d4
2 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,25 @@
package fr.iutfbleau.sae;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.preference.PreferenceActivity;
/**
* {@code SettingsActivity} is the activity that displays the settings.
*
* @autor Alexeï Kadir, Lyanis Souidi, Hugo Dimitrijevic
* @version 1.0
*/
public class SettingsActivity extends PreferenceActivity {
/**
* Creates the settings view.
*
* @param savedInstanceState The saved instance state.
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.addPreferencesFromResource(R.xml.preferences);
}
}

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:key="preference_group"
android:title="@string/title">
<ListPreference
android:defaultValue="10"
android:entries="@array/size_list"
android:entryValues="@array/size_list_values"
android:key="size_preference"
android:title="@string/size" />
<CheckBoxPreference
android:defaultValue="false"
android:key="hard_mode_preference"
android:summary="@string/hard_mode_summary"
android:title="@string/hard_mode" />
</PreferenceCategory>
</PreferenceScreen>