Ajout activité paramètres
This commit is contained in:
parent
399fc2e2bd
commit
d9e3dab7d4
25
app/src/main/java/fr/iutfbleau/sae/SettingsActivity.java
Normal file
25
app/src/main/java/fr/iutfbleau/sae/SettingsActivity.java
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
23
app/src/main/res/xml/preferences.xml
Normal file
23
app/src/main/res/xml/preferences.xml
Normal 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>
|
Loading…
Reference in New Issue
Block a user