Added privacy setting for always html images

This commit is contained in:
M66B 2021-09-18 11:22:28 +02:00
parent 1745a1dd29
commit 2ef084d9ee
2 changed files with 24 additions and 2 deletions

View File

@ -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));

View File

@ -137,6 +137,17 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swConfirmImages" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swHtmlImages"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_ask_show_html_images"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvConfirmImagesHint"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swConfirmHtml"
android:layout_width="0dp"
@ -146,7 +157,7 @@
android:text="@string/title_advanced_confirm_html"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvConfirmImagesHint"
app:layout_constraintTop_toBottomOf="@+id/swHtmlImages"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView