From c6fbb325a6d22271e54f1f9819640dc60aefe0ff Mon Sep 17 00:00:00 2001 From: lubenard Date: Sat, 5 Jun 2021 12:25:04 +0200 Subject: [PATCH] Added useful links in settings --- .../oring_reminder/ui/SettingsFragment.java | 15 +++++++++ .../res/layout/useful_links_alertdialog.xml | 33 +++++++++++++++++++ app/src/main/res/values-fr/strings.xml | 3 ++ app/src/main/res/values/strings.xml | 3 ++ app/src/main/res/xml/settings_fragment.xml | 5 +++ 5 files changed, 59 insertions(+) create mode 100644 app/src/main/res/layout/useful_links_alertdialog.xml diff --git a/app/src/main/java/com/lubenard/oring_reminder/ui/SettingsFragment.java b/app/src/main/java/com/lubenard/oring_reminder/ui/SettingsFragment.java index bfdd5f2..929461e 100644 --- a/app/src/main/java/com/lubenard/oring_reminder/ui/SettingsFragment.java +++ b/app/src/main/java/com/lubenard/oring_reminder/ui/SettingsFragment.java @@ -354,6 +354,21 @@ public boolean onPreferenceClick(Preference preference) { } }); + // useful links menu preference click listener + Preference usefulLinks = findPreference("other_useful_links"); + usefulLinks.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { + public boolean onPreferenceClick(Preference preference) { + AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); + builder.setTitle(R.string.custom_useful_links); + final View customLayout = getLayoutInflater().inflate(R.layout.useful_links_alertdialog, null); + builder.setView(customLayout); + builder.setPositiveButton(android.R.string.ok, null); + AlertDialog dialog = builder.create(); + dialog.show(); + return true; + } + }); + // feedback preference click listener Preference feedback = findPreference("other_feedback"); feedback.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { diff --git a/app/src/main/res/layout/useful_links_alertdialog.xml b/app/src/main/res/layout/useful_links_alertdialog.xml new file mode 100644 index 0000000..fe24060 --- /dev/null +++ b/app/src/main/res/layout/useful_links_alertdialog.xml @@ -0,0 +1,33 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index f40c2db..0fa7bff 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -139,4 +139,7 @@ La première entrée est le :  Merci d\'autoriser l\'accès au stockage pour exporter / importer. Nouvelle session + Liens utiles + Liens utils : + Une poignée de liens utils ! diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4f0fc0b..65e093f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -135,4 +135,7 @@ The first entry is:  Please allow access to storage to export / import datas. New session + Useful links: + A bunch of useful links! + Useful links \ No newline at end of file diff --git a/app/src/main/res/xml/settings_fragment.xml b/app/src/main/res/xml/settings_fragment.xml index 43668e5..68107ae 100644 --- a/app/src/main/res/xml/settings_fragment.xml +++ b/app/src/main/res/xml/settings_fragment.xml @@ -113,6 +113,11 @@ app:title="@string/debug_menu_title" app:summary="@string/debug_menu_description"/> + +