mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-02 02:50:56 +01:00
FTS proof of concept
This commit is contained in:
@@ -47,6 +47,7 @@ import androidx.preference.PreferenceManager;
|
||||
|
||||
public class FragmentOptionsMisc extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
private SwitchCompat swExternalSearch;
|
||||
private SwitchCompat swFts;
|
||||
private SwitchCompat swEnglish;
|
||||
private SwitchCompat swWatchdog;
|
||||
private SwitchCompat swUpdates;
|
||||
@@ -67,7 +68,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
private Group grpDebug;
|
||||
|
||||
private final static String[] RESET_OPTIONS = new String[]{
|
||||
"english", "watchdog", "updates", "experiments", "crash_reports", "debug"
|
||||
"fts", "english", "watchdog", "updates", "experiments", "crash_reports", "debug"
|
||||
};
|
||||
|
||||
private final static String[] RESET_QUESTIONS = new String[]{
|
||||
@@ -88,6 +89,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
// Get controls
|
||||
|
||||
swExternalSearch = view.findViewById(R.id.swExternalSearch);
|
||||
swFts = view.findViewById(R.id.swFts);
|
||||
swEnglish = view.findViewById(R.id.swEnglish);
|
||||
swWatchdog = view.findViewById(R.id.swWatchdog);
|
||||
swUpdates = view.findViewById(R.id.swUpdates);
|
||||
@@ -126,6 +128,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
}
|
||||
});
|
||||
|
||||
swFts.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("fts", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swEnglish.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -298,6 +307,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
int state = pm.getComponentEnabledSetting(new ComponentName(getContext(), ActivitySearch.class));
|
||||
|
||||
swExternalSearch.setChecked(state != PackageManager.COMPONENT_ENABLED_STATE_DISABLED);
|
||||
swFts.setChecked(prefs.getBoolean("fts", false));
|
||||
swEnglish.setChecked(prefs.getBoolean("english", false));
|
||||
swWatchdog.setChecked(prefs.getBoolean("watchdog", true));
|
||||
swUpdates.setChecked(prefs.getBoolean("updates", true));
|
||||
|
||||
Reference in New Issue
Block a user