From 2ef084d9ee12346ebcccf7c687d1854dd517cf6f Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 18 Sep 2021 11:22:28 +0200 Subject: [PATCH] Added privacy setting for always html images --- .../eu/faircode/email/FragmentOptionsPrivacy.java | 13 ++++++++++++- .../main/res/layout/fragment_options_privacy.xml | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsPrivacy.java b/app/src/main/java/eu/faircode/email/FragmentOptionsPrivacy.java index bfe2dddc97..27a6ce9e32 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsPrivacy.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsPrivacy.java @@ -63,6 +63,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer private SwitchCompat swCheckLinksDbl; private SwitchCompat swBrowseLinks; private SwitchCompat swConfirmImages; + private SwitchCompat swHtmlImages; private SwitchCompat swConfirmHtml; private SwitchCompat swDisableTracking; private SwitchCompat swHideTimeZone; @@ -89,7 +90,8 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer private Group grpSafeBrowsing; private final static String[] RESET_OPTIONS = new String[]{ - "confirm_links", "check_links_dbl", "browse_links", "confirm_images", "confirm_html", + "confirm_links", "check_links_dbl", "browse_links", + "confirm_images", "html_always_images", "confirm_html", "disable_tracking", "hide_timezone", "pin", "biometrics", "biometrics_timeout", "client_id", "display_hidden", "incognito_keyboard", "secure", @@ -111,6 +113,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer swCheckLinksDbl = view.findViewById(R.id.swCheckLinksDbl); swBrowseLinks = view.findViewById(R.id.swBrowseLinks); swConfirmImages = view.findViewById(R.id.swConfirmImages); + swHtmlImages = view.findViewById(R.id.swHtmlImages); swConfirmHtml = view.findViewById(R.id.swConfirmHtml); swDisableTracking = view.findViewById(R.id.swDisableTracking); swHideTimeZone = view.findViewById(R.id.swHideTimeZone); @@ -172,6 +175,13 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer } }); + swHtmlImages.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("html_always_images", checked).apply(); + } + }); + swConfirmHtml.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -412,6 +422,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer swBrowseLinks.setChecked(prefs.getBoolean("browse_links", false)); swBrowseLinks.setEnabled(!swConfirmLinks.isChecked()); swConfirmImages.setChecked(prefs.getBoolean("confirm_images", true)); + swHtmlImages.setChecked(prefs.getBoolean("html_always_images", false)); swConfirmHtml.setChecked(prefs.getBoolean("confirm_html", true)); swDisableTracking.setChecked(prefs.getBoolean("disable_tracking", true)); swHideTimeZone.setChecked(prefs.getBoolean("hide_timezone", true)); diff --git a/app/src/main/res/layout/fragment_options_privacy.xml b/app/src/main/res/layout/fragment_options_privacy.xml index eb60741c33..cfbd7de1ec 100644 --- a/app/src/main/res/layout/fragment_options_privacy.xml +++ b/app/src/main/res/layout/fragment_options_privacy.xml @@ -137,6 +137,17 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/swConfirmImages" /> + +