Moved auto optimize to sync settings

This commit is contained in:
M66B
2020-06-12 19:08:08 +02:00
parent e69f29abda
commit 0912c78430
5 changed files with 24 additions and 50 deletions

View File

@@ -73,7 +73,6 @@ 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;
@@ -98,7 +97,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private Group grpDebug;
private final static String[] RESET_OPTIONS = new String[]{
"shortcuts", "fts", "english", "watchdog", "auto_optimize", "updates",
"shortcuts", "fts", "english", "watchdog", "updates",
"experiments", "crash_reports", "debug", "auth_sasl", "cleanup_attachments"
};
@@ -129,7 +128,6 @@ 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);
@@ -235,14 +233,6 @@ 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();
ServiceSynchronize.reload(getContext(), null, false, "optimize");
}
});
swUpdates.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -542,7 +532,6 @@ 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", false));
swUpdates.setChecked(prefs.getBoolean("updates", true));
swUpdates.setVisibility(
Helper.isPlayStoreInstall() || !Helper.hasValidFingerprint(getContext())