mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-02 11:01:23 +01:00
Added auto optimize setting
This commit is contained in:
@@ -55,6 +55,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
private TextView tvFtsPro;
|
||||
private SwitchCompat swEnglish;
|
||||
private SwitchCompat swWatchdog;
|
||||
private SwitchCompat swOptimize;
|
||||
private SwitchCompat swUpdates;
|
||||
private SwitchCompat swExperiments;
|
||||
private TextView tvExperimentsHint;
|
||||
@@ -73,7 +74,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
private Group grpDebug;
|
||||
|
||||
private final static String[] RESET_OPTIONS = new String[]{
|
||||
"fts", "english", "watchdog", "updates", "experiments", "crash_reports", "debug"
|
||||
"fts", "english", "watchdog", "auto_optimize", "updates", "experiments", "crash_reports", "debug"
|
||||
};
|
||||
|
||||
private final static String[] RESET_QUESTIONS = new String[]{
|
||||
@@ -99,6 +100,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
tvFtsPro = view.findViewById(R.id.tvFtsPro);
|
||||
swEnglish = view.findViewById(R.id.swEnglish);
|
||||
swWatchdog = view.findViewById(R.id.swWatchdog);
|
||||
swOptimize = view.findViewById(R.id.swOptimize);
|
||||
swUpdates = view.findViewById(R.id.swUpdates);
|
||||
swExperiments = view.findViewById(R.id.swExperiments);
|
||||
tvExperimentsHint = view.findViewById(R.id.tvExperimentsHint);
|
||||
@@ -185,6 +187,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
}
|
||||
});
|
||||
|
||||
swOptimize.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("auto_optimize", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swUpdates.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -360,6 +369,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
swFts.setChecked(prefs.getBoolean("fts", false));
|
||||
swEnglish.setChecked(prefs.getBoolean("english", false));
|
||||
swWatchdog.setChecked(prefs.getBoolean("watchdog", true));
|
||||
swOptimize.setChecked(prefs.getBoolean("auto_optimize", true));
|
||||
swUpdates.setChecked(prefs.getBoolean("updates", true));
|
||||
swUpdates.setVisibility(
|
||||
Helper.isPlayStoreInstall() || !Helper.hasValidFingerprint(getContext())
|
||||
|
||||
Reference in New Issue
Block a user