Auto reset link/image/html questions

This commit is contained in:
M66B 2022-07-18 07:28:13 +02:00
parent c6758f9d34
commit 530a7c5216
1 changed files with 21 additions and 3 deletions

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();
}
});