mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-02 23:26:12 +02:00
Added option to enable using block list
This commit is contained in:
@@ -87,6 +87,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||
private SwitchCompat swCheckMx;
|
||||
private SwitchCompat swCheckBlocklist;
|
||||
private TextView tvCheckBlocklistHint;
|
||||
private SwitchCompat swUseBlocklist;
|
||||
private SwitchCompat swTuneKeepAlive;
|
||||
private Group grpExempted;
|
||||
|
||||
@@ -96,7 +97,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||
"enabled", "poll_interval", "auto_optimize", "schedule", "schedule_start", "schedule_end",
|
||||
"sync_nodate", "sync_unseen", "sync_flagged", "delete_unseen", "sync_kept", "gmail_thread_id",
|
||||
"sync_folders", "sync_shared_folders", "subscriptions",
|
||||
"check_authentication", "check_reply_domain", "check_mx", "check_blocklist", "tune_keep_alive"
|
||||
"check_authentication", "check_reply_domain", "check_mx", "check_blocklist", "use_blocklist", "tune_keep_alive"
|
||||
};
|
||||
|
||||
@Override
|
||||
@@ -144,6 +145,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||
swCheckMx = view.findViewById(R.id.swCheckMx);
|
||||
swCheckBlocklist = view.findViewById(R.id.swCheckBlocklist);
|
||||
tvCheckBlocklistHint = view.findViewById(R.id.tvCheckBlocklistHint);
|
||||
swUseBlocklist = view.findViewById(R.id.swUseBlocklist);
|
||||
swTuneKeepAlive = view.findViewById(R.id.swTuneKeepAlive);
|
||||
grpExempted = view.findViewById(R.id.grpExempted);
|
||||
|
||||
@@ -343,6 +345,14 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("check_blocklist", checked).apply();
|
||||
swUseBlocklist.setEnabled(checked);
|
||||
}
|
||||
});
|
||||
|
||||
swUseBlocklist.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("use_blocklist", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -444,6 +454,8 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||
swCheckReply.setChecked(prefs.getBoolean("check_reply_domain", true));
|
||||
swCheckMx.setChecked(prefs.getBoolean("check_mx", false));
|
||||
swCheckBlocklist.setChecked(prefs.getBoolean("check_blocklist", false));
|
||||
swUseBlocklist.setChecked(prefs.getBoolean("use_blocklist", false));
|
||||
swUseBlocklist.setEnabled(swCheckBlocklist.isChecked());
|
||||
swTuneKeepAlive.setChecked(prefs.getBoolean("tune_keep_alive", true));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user