From cbc10b48875861d6e1909025661a57cd92af101e Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 24 Aug 2019 12:30:33 +0200 Subject: [PATCH] Added option for experimental features --- .../java/eu/faircode/email/FragmentOptions.java | 3 ++- .../eu/faircode/email/FragmentOptionsMisc.java | 12 +++++++++++- app/src/main/res/layout/fragment_options_misc.xml | 14 +++++++++++++- app/src/main/res/values/strings.xml | 1 + 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptions.java b/app/src/main/java/eu/faircode/email/FragmentOptions.java index a6f372190d..0977141d44 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptions.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptions.java @@ -38,12 +38,13 @@ public class FragmentOptions extends FragmentBase { private PagerAdapter adapter; static String[] OPTIONS_RESTART = new String[]{ + "subscriptions", "startup", "cards", "date", "threading", "highlight_unread", "avatars", "generated_icons", "identicons", "circular", "name_email", "subject_top", "subject_italic", "flags", "preview", "preview_italic", "addresses", "attachments_alt", "contrast", "monospaced", "inline_images", "contact_images", "all_images", "collapse_quotes", "autocontent", "actionbar", "autoscroll", "swipenav", "autoexpand", "autoclose", "onclose", - "subscriptions", "debug", + "experiments", "debug", "biometrics" }; diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index 09d9a07dd4..231eb573a0 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -50,6 +50,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc private SwitchCompat swEnglish; private SwitchCompat swWatchdog; private SwitchCompat swUpdates; + private SwitchCompat swExperiments; private SwitchCompat swCrashReports; private SwitchCompat swDebug; private Button btnCleanup; @@ -62,7 +63,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc private Group grpDebug; private final static String[] RESET_OPTIONS = new String[]{ - "double_back", "biometrics_timeout", "english", "watchdog", "updates", "crash_reports", "debug" + "double_back", "biometrics_timeout", "english", "watchdog", "updates", "experiments", "crash_reports", "debug" }; private final static String[] RESET_QUESTIONS = new String[]{ @@ -84,6 +85,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc swEnglish = view.findViewById(R.id.swEnglish); swWatchdog = view.findViewById(R.id.swWatchdog); swUpdates = view.findViewById(R.id.swUpdates); + swExperiments = view.findViewById(R.id.swExperiments); swCrashReports = view.findViewById(R.id.swCrashReports); swDebug = view.findViewById(R.id.swDebug); btnCleanup = view.findViewById(R.id.btnCleanup); @@ -148,6 +150,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc } }); + swExperiments.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("experiments", checked).apply(); + } + }); + swCrashReports.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -270,6 +279,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc swUpdates.setVisibility( Helper.isPlayStoreInstall(getContext()) || !Helper.hasValidFingerprint(getContext()) ? View.GONE : View.VISIBLE); + swExperiments.setChecked(prefs.getBoolean("experiments", false)); swCrashReports.setChecked(prefs.getBoolean("crash_reports", false)); swDebug.setChecked(prefs.getBoolean("debug", false)); diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml index 62685346dc..95504b404b 100644 --- a/app/src/main/res/layout/fragment_options_misc.xml +++ b/app/src/main/res/layout/fragment_options_misc.xml @@ -99,6 +99,18 @@ app:layout_constraintTop_toBottomOf="@id/swWatchdog" app:switchPadding="12dp" /> + + Force English language Periodically check if FairEmail is still active Check for updates + Try experimental features Send error reports Debug mode Cleanup