1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 02:07:12 +00:00

Auto reset link/image/html questions

This commit is contained in:
M66B 2022-07-18 07:28:13 +02:00
parent c6758f9d34
commit 530a7c5216

View file

@ -184,7 +184,13 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
swConfirmLinks.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("confirm_links", checked).apply();
SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean("confirm_links", checked);
if (!checked)
for (String key : prefs.getAll().keySet())
if (key.endsWith(".confirm_link"))
editor.remove(key);
editor.apply();
swCheckLinksDbl.setEnabled(checked);
}
});
@ -207,7 +213,13 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
swAskImages.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("ask_images", checked).apply();
SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean("ask_images", checked);
if (!checked)
for (String key : prefs.getAll().keySet())
if (key.endsWith(".show_images"))
editor.remove(key);
editor.apply();
}
});
@ -229,7 +241,13 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
swAskHtml.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("ask_html", checked).apply();
SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean("ask_html", checked);
if (!checked)
for (String key : prefs.getAll().keySet())
if (key.endsWith(".show_full"))
editor.remove(key);
editor.apply();
}
});