From c24da9d9a5609153975c3abd539e76977718496b Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 5 Oct 2019 09:37:57 +0200 Subject: [PATCH] Moved reset questions to button --- FAQ.md | 2 +- .../eu/faircode/email/FragmentOptionsMisc.java | 16 +++++++++++----- .../main/res/layout/fragment_options_misc.xml | 14 +++++++++++++- app/src/main/res/menu/menu_options_misc.xml | 13 ------------- 4 files changed, 25 insertions(+), 20 deletions(-) delete mode 100644 app/src/main/res/menu/menu_options_misc.xml diff --git a/FAQ.md b/FAQ.md index 081287b075..f812163151 100644 --- a/FAQ.md +++ b/FAQ.md @@ -2356,7 +2356,7 @@ In the three-dots overflow menu at the top right there is an item to delete the **(137) How can I reset 'Don't ask again'?** -You can reset all questions set to not to be asked again in the three-dots overflow menu of the miscellaneous settings. +You can reset all questions set to be not asked again in the miscellaneous settings.
diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index 53bcbfef56..7a1cda19aa 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -56,6 +56,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc private TextView tvExperimentsHint; private SwitchCompat swCrashReports; private SwitchCompat swDebug; + private Button btnReset; private Button btnCleanup; private TextView tvProcessors; @@ -94,6 +95,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc tvExperimentsHint = view.findViewById(R.id.tvExperimentsHint); swCrashReports = view.findViewById(R.id.swCrashReports); swDebug = view.findViewById(R.id.swDebug); + btnReset = view.findViewById(R.id.btnReset); btnCleanup = view.findViewById(R.id.btnCleanup); tvProcessors = view.findViewById(R.id.tvProcessors); @@ -191,6 +193,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc } }); + btnReset.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + onResetQuestions(); + } + }); + btnCleanup.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -222,7 +231,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { - inflater.inflate(R.menu.menu_options_misc, menu); + inflater.inflate(R.menu.menu_options, menu); super.onCreateOptionsMenu(menu, inflater); } @@ -232,9 +241,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc case R.id.menu_default: onMenuDefault(); return true; - case R.id.menu_reset_questions: - onMenuResetQuestions(); - return true; default: return super.onOptionsItemSelected(item); } @@ -249,7 +255,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc ToastEx.makeText(getContext(), R.string.title_setup_done, Toast.LENGTH_LONG).show(); } - private void onMenuResetQuestions() { + private void onResetQuestions() { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); SharedPreferences.Editor editor = prefs.edit(); for (String option : RESET_QUESTIONS) diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml index 78c4a02920..1b41eb94d1 100644 --- a/app/src/main/res/layout/fragment_options_misc.xml +++ b/app/src/main/res/layout/fragment_options_misc.xml @@ -152,6 +152,18 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/swDebug" /> +