Added option for experimental features

pull/162/head
M66B 5 years ago
parent 6786abcb34
commit cbc10b4887

@ -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"
};

@ -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));

@ -99,6 +99,18 @@
app:layout_constraintTop_toBottomOf="@id/swWatchdog"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swExperiments"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_experiments"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swUpdates"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swCrashReports"
android:layout_width="0dp"
@ -107,7 +119,7 @@
android:text="@string/title_advanced_crash_reports"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swUpdates"
app:layout_constraintTop_toBottomOf="@id/swExperiments"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat

@ -291,6 +291,7 @@
<string name="title_advanced_english">Force English language</string>
<string name="title_advanced_watchdog">Periodically check if FairEmail is still active</string>
<string name="title_advanced_updates">Check for updates</string>
<string name="title_advanced_experiments">Try experimental features</string>
<string name="title_advanced_crash_reports">Send error reports</string>
<string name="title_advanced_debug">Debug mode</string>
<string name="title_advanced_cleanup">Cleanup</string>

Loading…
Cancel
Save