mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 14:17:03 +02:00
Added conversation actions
This commit is contained in:
@@ -27,6 +27,7 @@ import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Paint;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
@@ -52,6 +53,7 @@ import io.requery.android.database.sqlite.SQLiteDatabase;
|
||||
|
||||
public class FragmentOptionsMisc extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
private SwitchCompat swExternalSearch;
|
||||
private SwitchCompat swConversationActions;
|
||||
private SwitchCompat swFts;
|
||||
private TextView tvFtsIndexed;
|
||||
private TextView tvFtsPro;
|
||||
@@ -77,7 +79,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
private Group grpDebug;
|
||||
|
||||
private final static String[] RESET_OPTIONS = new String[]{
|
||||
"fts", "english", "watchdog", "auto_optimize", "updates", "experiments", "crash_reports", "debug"
|
||||
"conversation_actions", "fts", "english", "watchdog", "auto_optimize", "updates", "experiments", "crash_reports", "debug"
|
||||
};
|
||||
|
||||
private final static String[] RESET_QUESTIONS = new String[]{
|
||||
@@ -98,6 +100,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
// Get controls
|
||||
|
||||
swExternalSearch = view.findViewById(R.id.swExternalSearch);
|
||||
swConversationActions = view.findViewById(R.id.swConversationActions);
|
||||
swFts = view.findViewById(R.id.swFts);
|
||||
tvFtsIndexed = view.findViewById(R.id.tvFtsIndexed);
|
||||
tvFtsPro = view.findViewById(R.id.tvFtsPro);
|
||||
@@ -141,6 +144,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
}
|
||||
});
|
||||
|
||||
swConversationActions.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("conversation_actions", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swFts.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -379,6 +389,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
int state = pm.getComponentEnabledSetting(new ComponentName(getContext(), ActivitySearch.class));
|
||||
|
||||
swExternalSearch.setChecked(state != PackageManager.COMPONENT_ENABLED_STATE_DISABLED);
|
||||
swConversationActions.setChecked(prefs.getBoolean("conversation_actions", true));
|
||||
swConversationActions.setVisibility(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q ? View.VISIBLE : View.GONE);
|
||||
swFts.setChecked(prefs.getBoolean("fts", false));
|
||||
swEnglish.setChecked(prefs.getBoolean("english", false));
|
||||
swWatchdog.setChecked(prefs.getBoolean("watchdog", true));
|
||||
|
||||
Reference in New Issue
Block a user